Open davidaparicio opened 5 years ago
I found the solution in another project, in Ansible 2.7, we must add:
metadata:
istest: true
Source:
@rambleraptor : Will it be fixed in Ansible 2.8? How do you use it without these lines? Does exist an environment variable??
But an error appears after, during the Instance Group Creation (with Ansible 2.7.5) :
TASK [create a instance group] **********************************************************************************
task path: /home/gUser/compute-video-demo-ansible/gce-lb.yml:17
<localhost> ESTABLISH LOCAL CONNECTION FOR USER: gUser
<localhost> EXEC /bin/sh -c 'echo ~gUser && sleep 0'
<localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/gUser/.ansible/tmp/ansible-tmp-1548690887.0 8-266770559619106 `" && echo ansible-tmp-1548690887.08-266770559619106="` echo /home/gUser/.ansible/tmp/ansib le-tmp-1548690887.08-266770559619106 `" ) && sleep 0'
Using module file /usr/lib/python2.7/site-packages/ansible/modules/cloud/google/gcp_compute_instance_group.py
<localhost> PUT /home/gUser/.ansible/tmp/ansible-local-19900W7_2Lq/tmpESxbOg TO /home/gUser/.ansible/tmp/ ansible-tmp-1548690887.08-266770559619106/AnsiballZ_gcp_compute_instance_group.py
<localhost> EXEC /bin/sh -c 'chmod u+x /home/gUser/.ansible/tmp/ansible-tmp-1548690887.08-266770559619106/ /h ome/gUser/.ansible/tmp/ansible-tmp-1548690887.08-266770559619106/AnsiballZ_gcp_compute_instance_group.py && s leep 0'
<localhost> EXEC /bin/sh -c '/usr/bin/python /home/gUser/.ansible/tmp/ansible-tmp-1548690887.08-2667705596191 06/AnsiballZ_gcp_compute_instance_group.py && sleep 0'
<localhost> EXEC /bin/sh -c 'rm -f -r /home/gUser/.ansible/tmp/ansible-tmp-1548690887.08-266770559619106/ > / dev/null 2>&1 && sleep 0'
fatal: [localhost]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"auth_kind": "serviceaccount",
"instances": [
{
"changed": true,
"failed": false
},
{
"changed": true,
"failed": false
}
],
"name": "instancegroup-globalforwardingrule",
"project": "myProject",
"service_account_file": "~/myfile.json",
"zone": "europe-west3-b"
}
},
"msg": "Unsupported parameters for (gcp_compute_instance_group) module: instances Supported parameters includ e: auth_kind, description, name, named_ports, network, project, region, scopes, service_account_email, service_ac count_file, state, subnetwork, zone"
}
to retry, use: --limit @/home/gUser/compute-video-demo-ansible/site.retry
PLAY RECAP ******************************************************************************************************
35.242.192.143 : ok=6 changed=2 unreachable=0 failed=0
35.246.212.196 : ok=6 changed=2 unreachable=0 failed=0
localhost : ok=9 changed=5 unreachable=0 failed=1
But an error appears after, during the Instance Group Creation (with Ansible 2.7.5) :
TASK [create a instance group] ********************************************************************************** task path: /home/gUser/compute-video-demo-ansible/gce-lb.yml:17 <localhost> ESTABLISH LOCAL CONNECTION FOR USER: gUser <localhost> EXEC /bin/sh -c 'echo ~gUser && sleep 0' <localhost> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/gUser/.ansible/tmp/ansible-tmp-1548690887.0 8-266770559619106 `" && echo ansible-tmp-1548690887.08-266770559619106="` echo /home/gUser/.ansible/tmp/ansib le-tmp-1548690887.08-266770559619106 `" ) && sleep 0' Using module file /usr/lib/python2.7/site-packages/ansible/modules/cloud/google/gcp_compute_instance_group.py <localhost> PUT /home/gUser/.ansible/tmp/ansible-local-19900W7_2Lq/tmpESxbOg TO /home/gUser/.ansible/tmp/ ansible-tmp-1548690887.08-266770559619106/AnsiballZ_gcp_compute_instance_group.py <localhost> EXEC /bin/sh -c 'chmod u+x /home/gUser/.ansible/tmp/ansible-tmp-1548690887.08-266770559619106/ /h ome/gUser/.ansible/tmp/ansible-tmp-1548690887.08-266770559619106/AnsiballZ_gcp_compute_instance_group.py && s leep 0' <localhost> EXEC /bin/sh -c '/usr/bin/python /home/gUser/.ansible/tmp/ansible-tmp-1548690887.08-2667705596191 06/AnsiballZ_gcp_compute_instance_group.py && sleep 0' <localhost> EXEC /bin/sh -c 'rm -f -r /home/gUser/.ansible/tmp/ansible-tmp-1548690887.08-266770559619106/ > / dev/null 2>&1 && sleep 0' fatal: [localhost]: FAILED! => { "changed": false, "invocation": { "module_args": { "auth_kind": "serviceaccount", "instances": [ { "changed": true, "failed": false }, { "changed": true, "failed": false } ], "name": "instancegroup-globalforwardingrule", "project": "myProject", "service_account_file": "~/myfile.json", "zone": "europe-west3-b" } }, "msg": "Unsupported parameters for (gcp_compute_instance_group) module: instances Supported parameters includ e: auth_kind, description, name, named_ports, network, project, region, scopes, service_account_email, service_ac count_file, state, subnetwork, zone" } to retry, use: --limit @/home/gUser/compute-video-demo-ansible/site.retry PLAY RECAP ****************************************************************************************************** 35.242.192.143 : ok=6 changed=2 unreachable=0 failed=0 35.246.212.196 : ok=6 changed=2 unreachable=0 failed=0 localhost : ok=9 changed=5 unreachable=0 failed=1
Hi David,
I encountered same problem and it seems that playbooks are not updated to current version of Ansible. Problem with gcp_compute_instance_group is this: "Unlike managed instance groups, you must create and add instances to an instance group manually". I am currently trying to switch to gce_mig, but that one requires instance templates :-)
Best Regards Peter
Hello,
I followed the readme, but the playbook doesn't work.
Best regards, David
PS: "googleauth" doesn't exist on pip, pip suggests "google-auth"