google.cloud
google.cloud copied to clipboard
gcp_compute_instance_group_manager error
SUMMARY
When I try to use the gcp_compute_instance_group_manager module I get an invalid JSON response error.
ISSUE TYPE
- Bug Report
COMPONENT NAME
gco_compute_instance_group_manager
ANSIBLE VERSION
ansible 2.10.4
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/userx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.6.8 (default, Sep 21 2021, 20:17:36) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)]
COLLECTION VERSION
$ ansible-galaxy collection list google.cloud
# /home/userx/.ansible/collections/ansible_collections
Collection Version
------------ -------
google.cloud 1.0.0
CONFIGURATION
'<!--- Paste verbatim output from "ansible-config dump --only-changed" between quotes -->
COLLECTIONS_PATHS(/etc/ansible/ansible.cfg) = ['/home/userx/.ansible/collections', '/usr/share/ansible/collections']
DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = ['/etc/ansible/hosts']
DEFAULT_ROLES_PATH(/etc/ansible/ansible.cfg) = ['/home/userx/.ansible/roles', '/usr/share/ansible/roles', '/etc/ansible/roles']
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
INVENTORY_ENABLED(/etc/ansible/ansible.cfg) = ['host_list', 'ini', 'community.vmware.vmware_vm_inventory']'
OS / ENVIRONMENT
Ansible Server is CentOS 8. Target is Google Cloud Platform Managed Instance Group Autoscaler Configuration.
STEPS TO REPRODUCE
Run the playbook with -tags test --ask-become-pass -vvvv
'- name: GCP MIG Template Update
hosts: "{{ host_grp }}"
gather_facts: false
become: true
become_method: sudo
vars_files:
- ./vars/vars_web-inst.yml
tasks:
- name: Get timestamp from the system
shell: "date +%Y-%m-%d%H-%M-%S"
register: tstamp
delegate_to: localhost
connection: local
tags:
- date
- test
- name: Set variables
set_fact:
cur_date: "{{ tstamp.stdout[0:10]}}"
delegate_to: localhost
connection: local
tags:
- date
- test
- name: register disk
google.cloud.gcp_compute_disk:
name: sjsu-it-web-rhel7-temp-1
project: "{{ img_project }}"
zone: "{{ prj_zone }}"
auth_kind: serviceaccount
service_account_file: "{{ gcp_serviceaccount_file }}"
state: present
register: disk
delegate_to: localhost
connection: local
tags:
- create_image
- test
- name: create image
google.cloud.gcp_compute_image:
name: "{{ image_name }}-{{ cur_date }}"
source_disk: "{{ disk }}"
project: "{{ img_project }}"
family: webserver
auth_kind: serviceaccount
service_account_file: "{{ gcp_serviceaccount_file }}"
state: present
delegate_to: localhost
connection: local
tags:
- create_image
- test
- name: register network
google.cloud.gcp_compute_network:
name: "{{ img_network }}"
project: "{{ net_host_prj }}"
auto_create_subnetworks: 'false'
auth_kind: serviceaccount
service_account_file: "{{ gcp_serviceaccount_file }}"
state: present
register: network
delegate_to: localhost
connection: local
tags:
- register_network
- test
- name: register subnetwork
google.cloud.gcp_compute_subnetwork:
name: "{{img_network}}{{ img_subnetwork}}"
project: "{{ net_host_prj }}"
region: "{{ prj_region }}"
network: "{{ network }}"
ip_cidr_range: "{{ subnet_cidr_range }}"
state: present
auth_kind: serviceaccount
service_account_file: "{{ gcp_serviceaccount_file }}"
register: subnetwork
delegate_to: localhost
connection: local
tags:
- register_network
- test
- name: create a instance template
google.cloud.gcp_compute_instance_template:
name: "{{ image_name }}-{{ cur_date }}"
properties:
disks:
- auto_delete: 'true'
boot: 'true'
initialize_params:
source_image: "{{ src_image }}"
machine_type: g1-small
network_interfaces:
# - network: "{{ network }}"
- subnetwork: "{{ subnetwork }}"
project: "{{ img_project }}"
auth_kind: serviceaccount
service_account_file: "{{ gcp_serviceaccount_file }}"
state: present
register: inst_template
delegate_to: localhost
connection: local
tags:
- create_instance_tmpl
- test
# Bug
- name: Create/Update Instance group manager
google.cloud.gcp_compute_instance_group_manager:
name: "{{ instance_group }}"
instance_template: "{{ inst_template }}"
base_instance_name: "{{ base_inst_name }}"
named_ports:
- name: http
port: 80
- name: https
port: 443
target_size: 1
zone: "{{ prj_zone }}"
project: "{{ img_project }}"
auth_kind: serviceaccount
service_account_file: "{{ gcp_serviceaccount_file }}"
state: present
register: igm
delegate_to: localhost
connection: local
tags:
- create_instance_grp
- test'
EXPECTED RESULTS
I expected the already existing managed instance group to be updated with the new template name.
ACTUAL RESULTS
The last task "Create/Update Instance group manager" fails with a non-descriptive error about JSON not being able to be parsed. The JSON file used for the service account works on all other plays so I don't think that's the issue.
"[userx@servername systems]$ ansible-playbook web-instances.yml --tags test --ask-become-pass -vvvv
ansible-playbook 2.10.4
config file = /etc/ansible/ansible.cfg
configured module search path = ['/home/userx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
executable location = /usr/local/bin/ansible-playbook
python version = 3.6.8 (default, Sep 21 2021, 20:17:36) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)]
Using /etc/ansible/ansible.cfg as config file
BECOME password:
setting up inventory plugins
Loading collection community.vmware from /home/userx/.ansible/collections/ansible_collections/community/vmware
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Set default localhost to localhost
Not replacing invalid character(s) "{'-'}" in group name (ansible-servers)
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see details
Parsed /etc/ansible/hosts inventory source with ini plugin
Loading collection google.cloud from /home/userx/.ansible/collections/ansible_collections/google/cloud
redirecting (type: modules) ansible.builtin.gcp_compute_instance to google.cloud.gcp_compute_instance
Loading collection community.general from /home/userx/.ansible/collections/ansible_collections/community/general
Loading callback plugin default of type stdout, v2.0 from /usr/local/lib/python3.6/site-packages/ansible/plugins/callback/default.py
Skipping callback 'default', as we already have a stdout callback.
Skipping callback 'minimal', as we already have a stdout callback.
Skipping callback 'oneline', as we already have a stdout callback.
PLAYBOOK: web-instances.yml ****************************************************************************************************************************************************************
Positional arguments: web-instances.yml
verbosity: 4
connection: smart
timeout: 10
become_method: sudo
become_ask_pass: True
tags: ('test',)
inventory: ('/etc/ansible/hosts',)
forks: 5
1 plays in web-instances.yml
Read vars_file './vars/vars_web-inst.yml'
Read vars_file './vars/vars_web-inst.yml'
Read vars_file './vars/vars_web-inst.yml'
PLAY [GCP Image Patching | Remote Systems Prep] ********************************************************************************************************************************************
Read vars_file './vars/vars_web-inst.yml'
META: ran handlers
Read vars_file './vars/vars_web-inst.yml'
Read vars_file './vars/vars_web-inst.yml'
TASK [Get timestamp from the system] *******************************************************************************************************************************************************
task path: /tmp/data/devel_gcp_project_management/gcp_scheduled_jobs/systems_patching/web-instances.yml:295
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: userx
<127.0.0.1> EXEC /bin/sh -c 'echo ~userx && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/userx/.ansible/tmp `"&& mkdir "` echo /home/userx/.ansible/tmp/ansible-tmp-1634147637.47235-146517-36815718650114 `" && echo ansible-tmp-1634147637.47235-146517-36815718650114="` echo /home/userx/.ansible/tmp/ansible-tmp-1634147637.47235-146517-36815718650114 `" ) && sleep 0'
<src_vm> Attempting python interpreter discovery
<127.0.0.1> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
Using module file /usr/local/lib/python3.6/site-packages/ansible/modules/command.py
<127.0.0.1> PUT /home/userx/.ansible/tmp/ansible-local-146509k3e3zzvb/tmpnbrm39nm TO /home/userx/.ansible/tmp/ansible-tmp-1634147637.47235-146517-36815718650114/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/userx/.ansible/tmp/ansible-tmp-1634147637.47235-146517-36815718650114/ /home/userx/.ansible/tmp/ansible-tmp-1634147637.47235-146517-36815718650114/AnsiballZ_command.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -p "[sudo via ansible, key=hgzmwkpcphfzmxhmctlwnjxoaqfhrghg] password:" -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-hgzmwkpcphfzmxhmctlwnjxoaqfhrghg ; /usr/bin/python /home/userx/.ansible/tmp/ansible-tmp-1634147637.47235-146517-36815718650114/AnsiballZ_command.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/userx/.ansible/tmp/ansible-tmp-1634147637.47235-146517-36815718650114/ > /dev/null 2>&1 && sleep 0'
[DEPRECATION WARNING]: Distribution centos 8.4.2105 on host src_vm should use /usr/libexec/platform-python, but is using /usr/bin/python for backward compatibility with
prior Ansible releases. A future Ansible release will default to using the discovered platform python for this host. See
https://docs.ansible.com/ansible/2.10/reference_appendices/interpreter_discovery.html for more information. This feature will be removed in version 2.12. Deprecation warnings can be
disabled by setting deprecation_warnings=False in ansible.cfg.
changed: [src_vm] => {
"changed": true,
"cmd": "date +%Y-%m-%d%H-%M-%S",
"delta": "0:00:00.003948",
"end": "2021-10-13 10:53:57.947474",
"invocation": {
"module_args": {
"_raw_params": "date +%Y-%m-%d%H-%M-%S",
"_uses_shell": true,
"argv": null,
"chdir": null,
"creates": null,
"executable": null,
"removes": null,
"stdin": null,
"stdin_add_newline": true,
"strip_empty_ends": true,
"warn": true
}
},
"rc": 0,
"start": "2021-10-13 10:53:57.943526",
"stderr": "",
"stderr_lines": [],
"stdout": "2021-10-1310-53-57",
"stdout_lines": [
"2021-10-1310-53-57"
]
}
Read vars_file './vars/vars_web-inst.yml'
Read vars_file './vars/vars_web-inst.yml'
TASK [Set variables] ***********************************************************************************************************************************************************************
task path: /tmp/data/devel_gcp_project_management/gcp_scheduled_jobs/systems_patching/web-instances.yml:305
ok: [src_vm] => {
"ansible_facts": {
"cur_date": "2021-10-13"
},
"changed": false
}
Read vars_file './vars/vars_web-inst.yml'
Read vars_file './vars/vars_web-inst.yml'
TASK [register disk] ***********************************************************************************************************************************************************************
task path: /tmp/data/devel_gcp_project_management/gcp_scheduled_jobs/systems_patching/web-instances.yml:315
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: userx
<127.0.0.1> EXEC /bin/sh -c 'echo ~userx && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/userx/.ansible/tmp `"&& mkdir "` echo /home/userx/.ansible/tmp/ansible-tmp-1634147638.0525258-146547-227198424444456 `" && echo ansible-tmp-1634147638.0525258-146547-227198424444456="` echo /home/userx/.ansible/tmp/ansible-tmp-1634147638.0525258-146547-227198424444456 `" ) && sleep 0'
<src_vm> Attempting python interpreter discovery
<127.0.0.1> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
Using module file /home/userx/.ansible/collections/ansible_collections/google/cloud/plugins/modules/gcp_compute_disk.py
<127.0.0.1> PUT /home/userx/.ansible/tmp/ansible-local-146509k3e3zzvb/tmpkv1g3ble TO /home/userx/.ansible/tmp/ansible-tmp-1634147638.0525258-146547-227198424444456/AnsiballZ_gcp_compute_disk.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/userx/.ansible/tmp/ansible-tmp-1634147638.0525258-146547-227198424444456/ /home/userx/.ansible/tmp/ansible-tmp-1634147638.0525258-146547-227198424444456/AnsiballZ_gcp_compute_disk.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -p "[sudo via ansible, key=priyyfjgcopmepinaoxfexcitabfbehm] password:" -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-priyyfjgcopmepinaoxfexcitabfbehm ; /usr/bin/python /home/userx/.ansible/tmp/ansible-tmp-1634147638.0525258-146547-227198424444456/AnsiballZ_gcp_compute_disk.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/userx/.ansible/tmp/ansible-tmp-1634147638.0525258-146547-227198424444456/ > /dev/null 2>&1 && sleep 0'
ok: [src_vm] => {
"changed": false,
"creationTimestamp": "2021-07-07T17:01:05.202-07:00",
"guestOsFeatures": [
{
"type": "UEFI_COMPATIBLE"
}
],
"id": "587265871010594479",
"invocation": {
"module_args": {
"auth_kind": "serviceaccount",
"description": null,
"disk_encryption_key": null,
"env_type": null,
"labels": null,
"licenses": null,
"name": "src_vm",
"physical_block_size_bytes": null,
"project": "project-1",
"scopes": [
"https://www.googleapis.com/auth/compute"
],
"service_account_contents": null,
"service_account_email": null,
"service_account_file": "/opt/keys/project-1.json",
"size_gb": null,
"source_image": null,
"source_image_encryption_key": null,
"source_snapshot": null,
"source_snapshot_encryption_key": null,
"state": "present",
"type": null,
"zone": "us-west2-a"
}
},
"kind": "compute#disk",
"labelFingerprint": "42WmSpB8rSM=",
"lastAttachTimestamp": "2021-07-07T17:01:05.203-07:00",
"licenseCodes": [
"1000006"
],
"licenses": [
"https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-7-server"
],
"name": "src_vm",
"physicalBlockSizeBytes": "4096",
"selfLink": "https://www.googleapis.com/compute/v1/projects/project-1/zones/us-west2-a/disks/src_vm",
"sizeGb": "20",
"sourceImage": "https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/images/rhel-7-v20210701",
"sourceImageId": "5367737885060514901",
"status": "READY",
"type": "https://www.googleapis.com/compute/v1/projects/project-1/zones/us-west2-a/diskTypes/pd-balanced",
"users": [
"https://www.googleapis.com/compute/v1/projects/project-1/zones/us-west2-a/instances/src_vm"
],
"zone": "https://www.googleapis.com/compute/v1/projects/project-1/zones/us-west2-a"
}
Read vars_file './vars/vars_web-inst.yml'
Read vars_file './vars/vars_web-inst.yml'
TASK [create image] ************************************************************************************************************************************************************************
task path: /tmp/data/devel_gcp_project_management/gcp_scheduled_jobs/systems_patching/web-instances.yml:331
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: userx
<127.0.0.1> EXEC /bin/sh -c 'echo ~userx && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/userx/.ansible/tmp `"&& mkdir "` echo /home/userx/.ansible/tmp/ansible-tmp-1634147639.1658053-146580-233261014319141 `" && echo ansible-tmp-1634147639.1658053-146580-233261014319141="` echo /home/userx/.ansible/tmp/ansible-tmp-1634147639.1658053-146580-233261014319141 `" ) && sleep 0'
<src_vm> Attempting python interpreter discovery
<127.0.0.1> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
Using module file /home/userx/.ansible/collections/ansible_collections/google/cloud/plugins/modules/gcp_compute_image.py
<127.0.0.1> PUT /home/userx/.ansible/tmp/ansible-local-146509k3e3zzvb/tmpyg99p83b TO /home/userx/.ansible/tmp/ansible-tmp-1634147639.1658053-146580-233261014319141/AnsiballZ_gcp_compute_image.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/userx/.ansible/tmp/ansible-tmp-1634147639.1658053-146580-233261014319141/ /home/userx/.ansible/tmp/ansible-tmp-1634147639.1658053-146580-233261014319141/AnsiballZ_gcp_compute_image.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -p "[sudo via ansible, key=pvgcgyutariglqtmcnxtxckbkcykrcsu] password:" -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-pvgcgyutariglqtmcnxtxckbkcykrcsu ; /usr/bin/python /home/userx/.ansible/tmp/ansible-tmp-1634147639.1658053-146580-233261014319141/AnsiballZ_gcp_compute_image.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/userx/.ansible/tmp/ansible-tmp-1634147639.1658053-146580-233261014319141/ > /dev/null 2>&1 && sleep 0'
ok: [src_vm] => {
"archiveSizeBytes": "2679722048",
"changed": false,
"creationTimestamp": "2021-10-13T10:36:26.099-07:00",
"diskSizeGb": "20",
"family": "webserver",
"guestOsFeatures": [
{
"type": "UEFI_COMPATIBLE"
}
],
"id": "175107907229755382",
"invocation": {
"module_args": {
"auth_kind": "serviceaccount",
"description": null,
"disk_size_gb": null,
"env_type": null,
"family": "webserver",
"guest_os_features": null,
"image_encryption_key": null,
"labels": null,
"licenses": null,
"name": "image-name",
"project": "project-1",
"raw_disk": null,
"scopes": [
"https://www.googleapis.com/auth/compute"
],
"service_account_contents": null,
"service_account_email": null,
"service_account_file": "/opt/keys/project-1.json",
"source_disk": {
"changed": false,
"creationTimestamp": "2021-07-07T17:01:05.202-07:00",
"deprecations": [
{
"msg": "Distribution centos 8.4.2105 on host src_vm should use /usr/libexec/platform-python, but is using /usr/bin/python for backward compatibility with prior Ansible releases. A future Ansible release will default to using the discovered platform python for this host. See https://docs.ansible.com/ansible/2.10/reference_appendices/interpreter_discovery.html for more information",
"version": "2.12"
}
],
"failed": false,
"guestOsFeatures": [
{
"type": "UEFI_COMPATIBLE"
}
],
"id": "587265871010594479",
"kind": "compute#disk",
"labelFingerprint": "42WmSpB8rSM=",
"lastAttachTimestamp": "2021-07-07T17:01:05.203-07:00",
"licenseCodes": [
"1000006"
],
"licenses": [
"https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-7-server"
],
"name": "src_vm",
"physicalBlockSizeBytes": "4096",
"selfLink": "https://www.googleapis.com/compute/v1/projects/project-1/zones/us-west2-a/disks/src_vm",
"sizeGb": "20",
"sourceImage": "https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/images/rhel-7-v20210701",
"sourceImageId": "5367737885060514901",
"status": "READY",
"type": "https://www.googleapis.com/compute/v1/projects/project-1/zones/us-west2-a/diskTypes/pd-balanced",
"users": [
"https://www.googleapis.com/compute/v1/projects/project-1/zones/us-west2-a/instances/src_vm"
],
"zone": "https://www.googleapis.com/compute/v1/projects/project-1/zones/us-west2-a"
},
"source_disk_encryption_key": null,
"source_disk_id": null,
"source_type": null,
"state": "present"
}
},
"kind": "compute#image",
"labelFingerprint": "42WmSpB8rSM=",
"licenseCodes": [
"1000006"
],
"licenses": [
"https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-7-server"
],
"name": "image-name",
"selfLink": "https://www.googleapis.com/compute/v1/projects/project-1/global/images/image-name",
"sourceDisk": "https://www.googleapis.com/compute/v1/projects/project-1/zones/us-west2-a/disks/src_vm",
"sourceDiskId": "587265871010594479",
"sourceType": "RAW",
"status": "READY",
"storageLocations": [
"us"
]
}
Read vars_file './vars/vars_web-inst.yml'
Read vars_file './vars/vars_web-inst.yml'
TASK [register network] ********************************************************************************************************************************************************************
task path: /tmp/data/devel_gcp_project_management/gcp_scheduled_jobs/systems_patching/web-instances.yml:347
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: userx
<127.0.0.1> EXEC /bin/sh -c 'echo ~userx && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/userx/.ansible/tmp `"&& mkdir "` echo /home/userx/.ansible/tmp/ansible-tmp-1634147640.351617-146628-240722723188749 `" && echo ansible-tmp-1634147640.351617-146628-240722723188749="` echo /home/userx/.ansible/tmp/ansible-tmp-1634147640.351617-146628-240722723188749 `" ) && sleep 0'
<src_vm> Attempting python interpreter discovery
<127.0.0.1> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
Using module file /home/userx/.ansible/collections/ansible_collections/google/cloud/plugins/modules/gcp_compute_network.py
<127.0.0.1> PUT /home/userx/.ansible/tmp/ansible-local-146509k3e3zzvb/tmp7xepiamd TO /home/userx/.ansible/tmp/ansible-tmp-1634147640.351617-146628-240722723188749/AnsiballZ_gcp_compute_network.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/userx/.ansible/tmp/ansible-tmp-1634147640.351617-146628-240722723188749/ /home/userx/.ansible/tmp/ansible-tmp-1634147640.351617-146628-240722723188749/AnsiballZ_gcp_compute_network.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -p "[sudo via ansible, key=lrfolothbfmnfgqkxnalcdyxbpwaaxul] password:" -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-lrfolothbfmnfgqkxnalcdyxbpwaaxul ; /usr/bin/python /home/userx/.ansible/tmp/ansible-tmp-1634147640.351617-146628-240722723188749/AnsiballZ_gcp_compute_network.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/userx/.ansible/tmp/ansible-tmp-1634147640.351617-146628-240722723188749/ > /dev/null 2>&1 && sleep 0'
ok: [src_vm] => {
"autoCreateSubnetworks": false,
"changed": false,
"creationTimestamp": "2021-03-04T20:41:36.851-08:00",
"id": "7234393601771047023",
"invocation": {
"module_args": {
"auth_kind": "serviceaccount",
"auto_create_subnetworks": false,
"description": null,
"env_type": null,
"name": "network-1",
"project": "host-proj",
"routing_config": null,
"scopes": [
"https://www.googleapis.com/auth/compute"
],
"service_account_contents": null,
"service_account_email": null,
"service_account_file": "/opt/keys/project-1.json",
"state": "present"
}
},
"kind": "compute#network",
"name": "network-1",
"peerings": [
{
"autoCreateRoutes": true,
"exchangeSubnetRoutes": true,
"exportCustomRoutes": true,
"exportSubnetRoutesWithPublicIp": false,
"importCustomRoutes": true,
"importSubnetRoutesWithPublicIp": false,
"name": "netapp-cv-nw-customer-peer",
"network": "https://www.googleapis.com/compute/v1/projects/n5c24e4e0a4b9bc0e-tp/global/networks/netapp-tenant-vpc",
"state": "ACTIVE",
"stateDetails": "[2021-08-05T17:34:38.601-07:00]: Connected."
},
{
"autoCreateRoutes": true,
"exchangeSubnetRoutes": true,
"exportCustomRoutes": true,
"exportSubnetRoutesWithPublicIp": false,
"importCustomRoutes": true,
"importSubnetRoutesWithPublicIp": false,
"name": "peer-usw2-dmz-to-cvs",
"network": "https://www.googleapis.com/compute/v1/projects/host-proj/global/networks/sjsu-it-usw2-cvs",
"peerMtu": 1460,
"state": "ACTIVE",
"stateDetails": "[2021-08-27T14:31:56.689-07:00]: Connected."
},
{
"autoCreateRoutes": true,
"exchangeSubnetRoutes": true,
"exportCustomRoutes": true,
"exportSubnetRoutesWithPublicIp": false,
"importCustomRoutes": true,
"importSubnetRoutesWithPublicIp": false,
"name": "peering-usw2-dmz-to-trust1",
"network": "https://www.googleapis.com/compute/v1/projects/host-proj/global/networks/host-proj-trust1",
"state": "ACTIVE",
"stateDetails": "[2021-08-27T15:39:09.898-07:00]: Connected."
},
{
"autoCreateRoutes": true,
"exchangeSubnetRoutes": true,
"exportCustomRoutes": true,
"exportSubnetRoutesWithPublicIp": false,
"importCustomRoutes": true,
"importSubnetRoutesWithPublicIp": false,
"name": "servicenetworking-googleapis-com",
"network": "https://www.googleapis.com/compute/v1/projects/t862c253545571d1fp-tp/global/networks/servicenetworking",
"state": "ACTIVE",
"stateDetails": "[2021-09-24T09:57:55.902-07:00]: Connected."
}
],
"routingConfig": {
"routingMode": "REGIONAL"
},
"selfLink": "https://www.googleapis.com/compute/v1/projects/host-proj/global/networks/network-1",
"subnetworks": [
"https://www.googleapis.com/compute/v1/projects/host-proj/regions/us-west2/subnetworks/network-1-dev",
"https://www.googleapis.com/compute/v1/projects/host-proj/regions/us-west2/subnetworks/network-1-prod"
]
}
Read vars_file './vars/vars_web-inst.yml'
Read vars_file './vars/vars_web-inst.yml'
TASK [register subnetwork] *****************************************************************************************************************************************************************
task path: /tmp/data/devel_gcp_project_management/gcp_scheduled_jobs/systems_patching/web-instances.yml:363
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: userx
<127.0.0.1> EXEC /bin/sh -c 'echo ~userx && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/userx/.ansible/tmp `"&& mkdir "` echo /home/userx/.ansible/tmp/ansible-tmp-1634147641.3552701-146653-265474976960102 `" && echo ansible-tmp-1634147641.3552701-146653-265474976960102="` echo /home/userx/.ansible/tmp/ansible-tmp-1634147641.3552701-146653-265474976960102 `" ) && sleep 0'
<src_vm> Attempting python interpreter discovery
<127.0.0.1> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
Using module file /home/userx/.ansible/collections/ansible_collections/google/cloud/plugins/modules/gcp_compute_subnetwork.py
<127.0.0.1> PUT /home/userx/.ansible/tmp/ansible-local-146509k3e3zzvb/tmpn8dxiqs9 TO /home/userx/.ansible/tmp/ansible-tmp-1634147641.3552701-146653-265474976960102/AnsiballZ_gcp_compute_subnetwork.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/userx/.ansible/tmp/ansible-tmp-1634147641.3552701-146653-265474976960102/ /home/userx/.ansible/tmp/ansible-tmp-1634147641.3552701-146653-265474976960102/AnsiballZ_gcp_compute_subnetwork.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -p "[sudo via ansible, key=rwhcvwvbfxidhaugzdtdyebgiobkyzpj] password:" -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-rwhcvwvbfxidhaugzdtdyebgiobkyzpj ; /usr/bin/python /home/userx/.ansible/tmp/ansible-tmp-1634147641.3552701-146653-265474976960102/AnsiballZ_gcp_compute_subnetwork.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/userx/.ansible/tmp/ansible-tmp-1634147641.3552701-146653-265474976960102/ > /dev/null 2>&1 && sleep 0'
ok: [src_vm] => {
"changed": false,
"creationTimestamp": "2021-03-04T20:57:55.426-08:00",
"fingerprint": "ZPo5UBtjfmY=",
"gatewayAddress": "10.1.1.1",
"id": "2657321824293749948",
"invocation": {
"module_args": {
"auth_kind": "serviceaccount",
"description": null,
"env_type": null,
"ip_cidr_range": "10.1.1.0/24",
"name": "network-1-dev",
"network": {
"autoCreateSubnetworks": false,
"changed": false,
"creationTimestamp": "2021-03-04T20:41:36.851-08:00",
"deprecations": [
{
"msg": "Distribution centos 8.4.2105 on host src_vm should use /usr/libexec/platform-python, but is using /usr/bin/python for backward compatibility with prior Ansible releases. A future Ansible release will default to using the discovered platform python for this host. See https://docs.ansible.com/ansible/2.10/reference_appendices/interpreter_discovery.html for more information",
"version": "2.12"
}
],
"failed": false,
"id": "7234393601771047023",
"kind": "compute#network",
"name": "network-1",
"peerings": [
{
"autoCreateRoutes": true,
"exchangeSubnetRoutes": true,
"exportCustomRoutes": true,
"exportSubnetRoutesWithPublicIp": false,
"importCustomRoutes": true,
"importSubnetRoutesWithPublicIp": false,
"name": "netapp-cv-nw-customer-peer",
"network": "https://www.googleapis.com/compute/v1/projects/n5c24e4e0a4b9bc0e-tp/global/networks/netapp-tenant-vpc",
"state": "ACTIVE",
"stateDetails": "[2021-08-05T17:34:38.601-07:00]: Connected."
},
{
"autoCreateRoutes": true,
"exchangeSubnetRoutes": true,
"exportCustomRoutes": true,
"exportSubnetRoutesWithPublicIp": false,
"importCustomRoutes": true,
"importSubnetRoutesWithPublicIp": false,
"name": "peer-usw2-dmz-to-cvs",
"network": "https://www.googleapis.com/compute/v1/projects/host-proj/global/networks/sjsu-it-usw2-cvs",
"peerMtu": 1460,
"state": "ACTIVE",
"stateDetails": "[2021-08-27T14:31:56.689-07:00]: Connected."
},
{
"autoCreateRoutes": true,
"exchangeSubnetRoutes": true,
"exportCustomRoutes": true,
"exportSubnetRoutesWithPublicIp": false,
"importCustomRoutes": true,
"importSubnetRoutesWithPublicIp": false,
"name": "peering-usw2-dmz-to-trust1",
"network": "https://www.googleapis.com/compute/v1/projects/host-proj/global/networks/host-proj-trust1",
"state": "ACTIVE",
"stateDetails": "[2021-08-27T15:39:09.898-07:00]: Connected."
},
{
"autoCreateRoutes": true,
"exchangeSubnetRoutes": true,
"exportCustomRoutes": true,
"exportSubnetRoutesWithPublicIp": false,
"importCustomRoutes": true,
"importSubnetRoutesWithPublicIp": false,
"name": "servicenetworking-googleapis-com",
"network": "https://www.googleapis.com/compute/v1/projects/t862c253545571d1fp-tp/global/networks/servicenetworking",
"state": "ACTIVE",
"stateDetails": "[2021-09-24T09:57:55.902-07:00]: Connected."
}
],
"routingConfig": {
"routingMode": "REGIONAL"
},
"selfLink": "https://www.googleapis.com/compute/v1/projects/host-proj/global/networks/network-1",
"subnetworks": [
"https://www.googleapis.com/compute/v1/projects/host-proj/regions/us-west2/subnetworks/network-1-dev",
"https://www.googleapis.com/compute/v1/projects/host-proj/regions/us-west2/subnetworks/network-1-prod"
]
},
"private_ip_google_access": null,
"project": "host-proj",
"region": "us-west2",
"scopes": [
"https://www.googleapis.com/auth/compute"
],
"secondary_ip_ranges": null,
"service_account_contents": null,
"service_account_email": null,
"service_account_file": "/opt/keys/project-1.json",
"state": "present"
}
},
"ipCidrRange": "10.1.1.0/24",
"kind": "compute#subnetwork",
"name": "network-1-dev",
"network": "https://www.googleapis.com/compute/v1/projects/host-proj/global/networks/network-1",
"privateIpGoogleAccess": false,
"privateIpv6GoogleAccess": "DISABLE_GOOGLE_ACCESS",
"purpose": "PRIVATE",
"region": "https://www.googleapis.com/compute/v1/projects/host-proj/regions/us-west2",
"selfLink": "https://www.googleapis.com/compute/v1/projects/host-proj/regions/us-west2/subnetworks/network-1-dev",
"stackType": "UNSPECIFIED_STACK_TYPE"
}
Read vars_file './vars/vars_web-inst.yml'
Read vars_file './vars/vars_web-inst.yml'
TASK [create a instance template] **********************************************************************************************************************************************************
task path: /tmp/data/devel_gcp_project_management/gcp_scheduled_jobs/systems_patching/web-instances.yml:381
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: userx
<127.0.0.1> EXEC /bin/sh -c 'echo ~userx && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/userx/.ansible/tmp `"&& mkdir "` echo /home/userx/.ansible/tmp/ansible-tmp-1634147642.54485-146680-127863522588504 `" && echo ansible-tmp-1634147642.54485-146680-127863522588504="` echo /home/userx/.ansible/tmp/ansible-tmp-1634147642.54485-146680-127863522588504 `" ) && sleep 0'
<src_vm> Attempting python interpreter discovery
<127.0.0.1> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
Using module file /home/userx/.ansible/collections/ansible_collections/google/cloud/plugins/modules/gcp_compute_instance_template.py
<127.0.0.1> PUT /home/userx/.ansible/tmp/ansible-local-146509k3e3zzvb/tmpzy_ltuj3 TO /home/userx/.ansible/tmp/ansible-tmp-1634147642.54485-146680-127863522588504/AnsiballZ_gcp_compute_instance_template.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/userx/.ansible/tmp/ansible-tmp-1634147642.54485-146680-127863522588504/ /home/userx/.ansible/tmp/ansible-tmp-1634147642.54485-146680-127863522588504/AnsiballZ_gcp_compute_instance_template.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -p "[sudo via ansible, key=kfbwgtojprykqtvssvcboioxeoxesqpa] password:" -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-kfbwgtojprykqtvssvcboioxeoxesqpa ; /usr/bin/python /home/userx/.ansible/tmp/ansible-tmp-1634147642.54485-146680-127863522588504/AnsiballZ_gcp_compute_instance_template.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/userx/.ansible/tmp/ansible-tmp-1634147642.54485-146680-127863522588504/ > /dev/null 2>&1 && sleep 0'
ok: [src_vm] => {
"changed": false,
"creationTimestamp": "2021-10-13T10:37:38.128-07:00",
"description": "",
"id": "4855283892225746829",
"invocation": {
"module_args": {
"auth_kind": "serviceaccount",
"description": null,
"env_type": null,
"name": "image-name",
"project": "project-1",
"properties": {
"can_ip_forward": null,
"description": null,
"disks": [
{
"auto_delete": true,
"boot": true,
"device_name": null,
"disk_encryption_key": null,
"index": null,
"initialize_params": {
"disk_name": null,
"disk_size_gb": null,
"disk_type": null,
"source_image": "projects/project-1/global/images/source-img",
"source_image_encryption_key": null
},
"interface": null,
"mode": null,
"source": null,
"type": null
}
],
"guest_accelerators": null,
"labels": null,
"machine_type": "g1-small",
"metadata": null,
"min_cpu_platform": null,
"network_interfaces": [
{
"access_configs": null,
"alias_ip_ranges": null,
"network": null,
"network_ip": null,
"subnetwork": {
"changed": false,
"creationTimestamp": "2021-03-04T20:57:55.426-08:00",
"deprecations": [
{
"msg": "Distribution centos 8.4.2105 on host src_vm should use /usr/libexec/platform-python, but is using /usr/bin/python for backward compatibility with prior Ansible releases. A future Ansible release will default to using the discovered platform python for this host. See https://docs.ansible.com/ansible/2.10/reference_appendices/interpreter_discovery.html for more information",
"version": "2.12"
}
],
"failed": false,
"fingerprint": "ZPo5UBtjfmY=",
"gatewayAddress": "10.1.1.1",
"id": "2657321824293749948",
"ipCidrRange": "10.1.1.0/24",
"kind": "compute#subnetwork",
"name": "network-1-dev",
"network": "https://www.googleapis.com/compute/v1/projects/host-proj/global/networks/network-1",
"privateIpGoogleAccess": false,
"privateIpv6GoogleAccess": "DISABLE_GOOGLE_ACCESS",
"purpose": "PRIVATE",
"region": "https://www.googleapis.com/compute/v1/projects/host-proj/regions/us-west2",
"selfLink": "https://www.googleapis.com/compute/v1/projects/host-proj/regions/us-west2/subnetworks/network-1-dev",
"stackType": "UNSPECIFIED_STACK_TYPE"
}
}
],
"scheduling": null,
"service_accounts": null,
"tags": null
},
"scopes": [
"https://www.googleapis.com/auth/compute"
],
"service_account_contents": null,
"service_account_email": null,
"service_account_file": "/opt/keys/project-1.json",
"state": "present"
}
},
"kind": "compute#instanceTemplate",
"name": "image-name",
"properties": {
"disks": [
{
"autoDelete": true,
"boot": true,
"deviceName": "persistent-disk-0",
"index": 0,
"initializeParams": {
"sourceImage": "projects/project-1/global/images/source-img"
},
"kind": "compute#attachedDisk",
"mode": "READ_WRITE",
"type": "PERSISTENT"
}
],
"machineType": "g1-small",
"networkInterfaces": [
{
"kind": "compute#networkInterface",
"name": "nic0",
"network": "https://www.googleapis.com/compute/v1/projects/host-proj/global/networks/network-1",
"subnetwork": "https://www.googleapis.com/compute/v1/projects/host-proj/regions/us-west2/subnetworks/network-1-dev"
}
]
},
"selfLink": "https://www.googleapis.com/compute/v1/projects/project-1/global/instanceTemplates/image-name"
}
Read vars_file './vars/vars_web-inst.yml'
Read vars_file './vars/vars_web-inst.yml'
TASK [Create/Update Instance group manager] ************************************************************************************************************************************************
task path: /tmp/data/devel_gcp_project_management/gcp_scheduled_jobs/systems_patching/web-instances.yml:406
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: userx
<127.0.0.1> EXEC /bin/sh -c 'echo ~userx && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/userx/.ansible/tmp `"&& mkdir "` echo /home/userx/.ansible/tmp/ansible-tmp-1634147643.5928195-146705-65440254024009 `" && echo ansible-tmp-1634147643.5928195-146705-65440254024009="` echo /home/userx/.ansible/tmp/ansible-tmp-1634147643.5928195-146705-65440254024009 `" ) && sleep 0'
<src_vm> Attempting python interpreter discovery
<127.0.0.1> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
Using module file /home/userx/.ansible/collections/ansible_collections/google/cloud/plugins/modules/gcp_compute_instance_group_manager.py
<127.0.0.1> PUT /home/userx/.ansible/tmp/ansible-local-146509k3e3zzvb/tmpz3m5jcl5 TO /home/userx/.ansible/tmp/ansible-tmp-1634147643.5928195-146705-65440254024009/AnsiballZ_gcp_compute_instance_group_manager.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/userx/.ansible/tmp/ansible-tmp-1634147643.5928195-146705-65440254024009/ /home/userx/.ansible/tmp/ansible-tmp-1634147643.5928195-146705-65440254024009/AnsiballZ_gcp_compute_instance_group_manager.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'sudo -H -S -p "[sudo via ansible, key=oheoywnicelxhkzmgywnjpgypswpelfs] password:" -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-oheoywnicelxhkzmgywnjpgypswpelfs ; /usr/bin/python /home/userx/.ansible/tmp/ansible-tmp-1634147643.5928195-146705-65440254024009/AnsiballZ_gcp_compute_instance_group_manager.py'"'"' && sleep 0'
<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/userx/.ansible/tmp/ansible-tmp-1634147643.5928195-146705-65440254024009/ > /dev/null 2>&1 && sleep 0'
The full traceback is:
File "/tmp/ansible_google.cloud.gcp_compute_instance_group_manager_payload_vccgyre5/ansible_google.cloud.gcp_compute_instance_group_manager_payload.zip/ansible_collections/google/cloud/plugins/modules/gcp_compute_instance_group_manager.py", line 495, in return_if_object
File "/tmp/ansible_google.cloud.gcp_compute_instance_group_manager_payload_vccgyre5/ansible_google.cloud.gcp_compute_instance_group_manager_payload.zip/ansible_collections/google/cloud/plugins/module_utils/gcp_utils.py", line 314, in raise_for_status
self.fail_json(msg="GCP returned error: %s" % response.json())
File "/usr/lib/python3.6/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib64/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
fatal: [src_vm]: FAILED! => {
"changed": false,
"invocation": {
"module_args": {
"auth_kind": "serviceaccount",
"base_instance_name": "usw2a-sjsuedu",
"description": null,
"env_type": null,
"instance_template": {
"changed": false,
"creationTimestamp": "2021-10-13T10:37:38.128-07:00",
"deprecations": [
{
"msg": "Distribution centos 8.4.2105 on host src_vm should use /usr/libexec/platform-python, but is using /usr/bin/python for backward compatibility with prior Ansible releases. A future Ansible release will default to using the discovered platform python for this host. See https://docs.ansible.com/ansible/2.10/reference_appendices/interpreter_discovery.html for more information",
"version": "2.12"
}
],
"description": "",
"failed": false,
"id": "4855283892225746829",
"kind": "compute#instanceTemplate",
"name": "image-name",
"properties": {
"disks": [
{
"autoDelete": true,
"boot": true,
"deviceName": "persistent-disk-0",
"index": 0,
"initializeParams": {
"sourceImage": "projects/project-1/global/images/source-img"
},
"kind": "compute#attachedDisk",
"mode": "READ_WRITE",
"type": "PERSISTENT"
}
],
"machineType": "g1-small",
"networkInterfaces": [
{
"kind": "compute#networkInterface",
"name": "nic0",
"network": "https://www.googleapis.com/compute/v1/projects/host-proj/global/networks/network-1",
"subnetwork": "https://www.googleapis.com/compute/v1/projects/host-proj/regions/us-west2/subnetworks/network-1-dev"
}
]
},
"selfLink": "https://www.googleapis.com/compute/v1/projects/project-1/global/instanceTemplates/image-name"
},
"name": "usw2-sjsuedu-rhel7-a",
"named_ports": [
{
"name": "http",
"port": 80
},
{
"name": "https",
"port": 443
}
],
"project": "project-1",
"scopes": [
"https://www.googleapis.com/auth/compute"
],
"service_account_contents": null,
"service_account_email": null,
"service_account_file": "/opt/keys/project-1.json",
"state": "present",
"target_pools": null,
"target_size": 1,
"zone": "us-west2-a"
}
},
"msg": "Invalid JSON response with error: <!DOCTYPE html>\n<html lang=en>\n <meta charset=utf-8>\n <meta name=viewport content=\"initial-scale=1, minimum-scale=1, width=device-width\">\n <title>Error 404 (Not Found)!!1</title>\n <style>\n *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}\n </style>\n <a href=//www.google.com/><span id=logo aria-label=Google></span></a>\n <p><b>404.</b> <ins>That’s an error.</ins>\n <p>The requested URL <code>/compute/v1/projects/project-1/zones/us-west2-a/instanceGroupManagers/usw2-sjsuedu-rhel7-a</code> was not found on this server. <ins>That’s all we know.</ins>\n"
}
PLAY RECAP *********************************************************************************************************************************************************************************
src_vm : ok=7 changed=1 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0"
Been a long time, not sure if you've solved it, but this did the magic for me:
tags:
items:
- 'internal-ssh2'
- 'mongo2'
Been a long time, not sure if you've solved it, but this did the magic for me:
tags: items: - 'internal-ssh2' - 'mongo2'
I did a work around to get what I needed, I'll revisit this to see if this method works.
Took me a long time to get back to this to test. I tried what you did, but that didn't work. The play won't even run if I add "items:" under the tags. Removing the tags all together I still get the same invalid JSON response error.
Can you provide the rest of the task you used? The only thing I can think of is I'm missing something or have something wrong within the task.