GCE dynamic inventory error on OSX 10 , ansible 1.62

Having an issue when using the dynamic inventory gce.py script with a bastion box . ssh config proxying all connections through the bastion: ansible.cf looks like this :

[defaults]
host_key_checking=False
forks=11
ask_sudo_pass=False
timeout=10

[ssh_connection]
ssh_args = -o ControlPersist=15m -F ssh.config -q
scp_if_ssh = True
control_path = ~/.ssh/mux-%%r@%%h:%%p
pipelining=True

and in the ssh.config:

Host bastion
User myuser
HostName XX.XX.XX.XX
ProxyCommand none
IdentityFile credentials/mykey.pem
BatchMode yes
PasswordAuthentication no

Host *
ServerAliveInterval 60
TCPKeepAlive yes
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
ProxyCommand ssh -q -A myuser@XX.XX.XX.XX -i credentials/service -o StrictHostKeyChecking=no nc %h %p
ControlMaster auto
ControlPath ~/.ssh/mux-%r@%h:%p
ControlPersist 8h
IdentityFile credentials/myotherkey.pem
User myuser

the inventory subdir contains the gce.ini and gce.py files which was working before , however trying to run any playbook from this morning results in the following error:

Correction ansible version is latest1.8.4 installed with macports

Abdulrahim -

I am having the same issue, still on Ansible 1.8.4. Did you ever solve the issue?

Hi Kevin,
Mostly a Hackish workaround, with the script expecting public ips that are called in this return avraible ‘gce_public_ip’: inst.public_ips[0]. Since the instances mostly dont have one it breaks .Commenting out lines 214 and 223 in the gce.py inventory script allows me to get the full inventory working.

On checking the latest commits seems issue has been fixed in the latest version of the gce.py script at https://github.com/ansible/ansible/commit/16f66a39a6ec8ce5c041c8f08ed2b017b409885d .