# GCE dynamic inventory error on OSX 10 , ansible 1.62

**URL:** <https://forum.ansible.com/t/gce-dynamic-inventory-error-on-osx-10-ansible-1-62/17738>\
**Category:** Ansible Project\
**Created:** [March 13, 2015, 1:24pm UTC](https://forum.ansible.com/t/gce-dynamic-inventory-error-on-osx-10-ansible-1-62/17738 "2015-03-13T13:24:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![harsh001](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@harsh001](https://forum.ansible.com/u/harsh001)\
**Post date:** [March 13, 2015, 1:24pm UTC](https://forum.ansible.com/t/gce-dynamic-inventory-error-on-osx-10-ansible-1-62/17738/1 "2015-03-13T13:24:53Z")

</div>

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:

---

<div class="post-metadata">

**Author:** ![harsh001](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@harsh001](https://forum.ansible.com/u/harsh001)\
**Post date:** [March 13, 2015, 3:01pm UTC](https://forum.ansible.com/t/gce-dynamic-inventory-error-on-osx-10-ansible-1-62/17738/2 "2015-03-13T15:01:42Z")

</div>

Correction ansible version is latest1.8.4 installed with macports

---

<div class="post-metadata">

**Author:** ![Kevin\_Schumacher](https://avatars.discourse-cdn.com/v4/letter/k/58956e/32.png) [@Kevin\_Schumacher](https://forum.ansible.com/u/Kevin_Schumacher)\
**Post date:** [July 6, 2015, 3:08pm UTC](https://forum.ansible.com/t/gce-dynamic-inventory-error-on-osx-10-ansible-1-62/17738/3 "2015-07-06T15:08:27Z")

</div>

Abdulrahim -

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

---

<div class="post-metadata">

**Author:** ![harsh001](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@harsh001](https://forum.ansible.com/u/harsh001)\
**Post date:** [July 8, 2015, 7:51am UTC](https://forum.ansible.com/t/gce-dynamic-inventory-error-on-osx-10-ansible-1-62/17738/4 "2015-07-08T07:51:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![harsh001](https://avatars.discourse-cdn.com/v4/letter/h/f6c823/32.png) [@harsh001](https://forum.ansible.com/u/harsh001)\
**Post date:** [July 8, 2015, 8:10am UTC](https://forum.ansible.com/t/gce-dynamic-inventory-error-on-osx-10-ansible-1-62/17738/5 "2015-07-08T08:10:47Z")

</div>

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](https://github.com/ansible/ansible/commit/16f66a39a6ec8ce5c041c8f08ed2b017b409885d) .
