Discussion:
[ansible-project] GCE dynamic inventory error on OSX 10 , ansible 1.62
abdulrahim umar
2015-03-13 13:24:53 UTC
Permalink
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 ***@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:

sh-3.2# ansible-playbook prdblb.yml -i inventory/ -vvvv
File "/usr/local/bin/ansible-playbook", line 326, in <module>
sys.exit(main(sys.argv[1:]))
File "/usr/local/bin/ansible-playbook", line 162, in main
inventory = ansible.inventory.Inventory(options.inventory,
vault_password=vault_pass)
File "/Library/Python/2.7/site-packages/ansible/inventory/__init__.py",
line 100, in __init__
self.parser = InventoryDirectory(filename=host_list)
File "/Library/Python/2.7/site-packages/ansible/inventory/dir.py", line
56, in __init__
parser = InventoryScript(filename=fullpath)
File "/Library/Python/2.7/site-packages/ansible/inventory/script.py",
line 49, in __init__
self.groups = self._parse(stderr)
File "/Library/Python/2.7/site-packages/ansible/inventory/script.py",
line 57, in _parse
self.raw = utils.parse_json(self.data)
File "/Library/Python/2.7/site-packages/ansible/utils/__init__.py", line
552, in parse_json
results = json.loads(data)
File "/Library/Python/2.7/site-packages/simplejson/__init__.py", line
505, in loads
return _default_decoder.decode(s)
File "/Library/Python/2.7/site-packages/simplejson/decoder.py", line
370, in decode
obj, end = self.raw_decode(s)
File "/Library/Python/2.7/site-packages/simplejson/decoder.py", line
400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1 (char
0)
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/50659983-c018-4964-b7a3-84249b26ee00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
abdulrahim umar
2015-03-13 15:01:42 UTC
Permalink
Correction ansible version is latest1.8.4 installed with macports
Post by abdulrahim umar
Having an issue when using the dynamic inventory gce.py script with a
[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
pipelining=True
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
credentials/service -o StrictHostKeyChecking=no nc %h %p
ControlMaster auto
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
sh-3.2# ansible-playbook prdblb.yml -i inventory/ -vvvv
File "/usr/local/bin/ansible-playbook", line 326, in <module>
sys.exit(main(sys.argv[1:]))
File "/usr/local/bin/ansible-playbook", line 162, in main
inventory = ansible.inventory.Inventory(options.inventory,
vault_password=vault_pass)
File "/Library/Python/2.7/site-packages/ansible/inventory/__init__.py",
line 100, in __init__
self.parser = InventoryDirectory(filename=host_list)
File "/Library/Python/2.7/site-packages/ansible/inventory/dir.py", line
56, in __init__
parser = InventoryScript(filename=fullpath)
File "/Library/Python/2.7/site-packages/ansible/inventory/script.py",
line 49, in __init__
self.groups = self._parse(stderr)
File "/Library/Python/2.7/site-packages/ansible/inventory/script.py",
line 57, in _parse
self.raw = utils.parse_json(self.data)
File "/Library/Python/2.7/site-packages/ansible/utils/__init__.py",
line 552, in parse_json
results = json.loads(data)
File "/Library/Python/2.7/site-packages/simplejson/__init__.py", line
505, in loads
return _default_decoder.decode(s)
File "/Library/Python/2.7/site-packages/simplejson/decoder.py", line
370, in decode
obj, end = self.raw_decode(s)
File "/Library/Python/2.7/site-packages/simplejson/decoder.py", line
400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1
(char 0)
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6a342e8f-3849-4bbc-9415-18ba4114e573%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Kevin Schumacher
2015-07-06 15:08:27 UTC
Permalink
Abdulrahim -

I am having the same issue, still on Ansible 1.8.4. Did you ever solve the
issue?
Post by abdulrahim umar
Correction ansible version is latest1.8.4 installed with macports
Post by abdulrahim umar
Having an issue when using the dynamic inventory gce.py script with a
[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
pipelining=True
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
credentials/service -o StrictHostKeyChecking=no nc %h %p
ControlMaster auto
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
sh-3.2# ansible-playbook prdblb.yml -i inventory/ -vvvv
File "/usr/local/bin/ansible-playbook", line 326, in <module>
sys.exit(main(sys.argv[1:]))
File "/usr/local/bin/ansible-playbook", line 162, in main
inventory = ansible.inventory.Inventory(options.inventory,
vault_password=vault_pass)
File
"/Library/Python/2.7/site-packages/ansible/inventory/__init__.py", line
100, in __init__
self.parser = InventoryDirectory(filename=host_list)
File "/Library/Python/2.7/site-packages/ansible/inventory/dir.py",
line 56, in __init__
parser = InventoryScript(filename=fullpath)
File "/Library/Python/2.7/site-packages/ansible/inventory/script.py",
line 49, in __init__
self.groups = self._parse(stderr)
File "/Library/Python/2.7/site-packages/ansible/inventory/script.py",
line 57, in _parse
self.raw = utils.parse_json(self.data)
File "/Library/Python/2.7/site-packages/ansible/utils/__init__.py",
line 552, in parse_json
results = json.loads(data)
File "/Library/Python/2.7/site-packages/simplejson/__init__.py", line
505, in loads
return _default_decoder.decode(s)
File "/Library/Python/2.7/site-packages/simplejson/decoder.py", line
370, in decode
obj, end = self.raw_decode(s)
File "/Library/Python/2.7/site-packages/simplejson/decoder.py", line
400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1
(char 0)
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/69e30c1b-7201-40a6-94ff-ffa377bd8bce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
abdulrahim umar
2015-07-08 07:51:11 UTC
Permalink
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 Mon, Jul 6, 2015 at 6:08 PM, Kevin Schumacher <
Post by Kevin Schumacher
Abdulrahim -
I am having the same issue, still on Ansible 1.8.4. Did you ever solve the
issue?
Post by abdulrahim umar
Correction ansible version is latest1.8.4 installed with macports
Post by abdulrahim umar
Having an issue when using the dynamic inventory gce.py script with a
[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
pipelining=True
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
credentials/service -o StrictHostKeyChecking=no nc %h %p
ControlMaster auto
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
sh-3.2# ansible-playbook prdblb.yml -i inventory/ -vvvv
File "/usr/local/bin/ansible-playbook", line 326, in <module>
sys.exit(main(sys.argv[1:]))
File "/usr/local/bin/ansible-playbook", line 162, in main
inventory = ansible.inventory.Inventory(options.inventory,
vault_password=vault_pass)
File
"/Library/Python/2.7/site-packages/ansible/inventory/__init__.py", line
100, in __init__
self.parser = InventoryDirectory(filename=host_list)
File "/Library/Python/2.7/site-packages/ansible/inventory/dir.py",
line 56, in __init__
parser = InventoryScript(filename=fullpath)
File "/Library/Python/2.7/site-packages/ansible/inventory/script.py",
line 49, in __init__
self.groups = self._parse(stderr)
File "/Library/Python/2.7/site-packages/ansible/inventory/script.py",
line 57, in _parse
self.raw = utils.parse_json(self.data)
File "/Library/Python/2.7/site-packages/ansible/utils/__init__.py",
line 552, in parse_json
results = json.loads(data)
File "/Library/Python/2.7/site-packages/simplejson/__init__.py", line
505, in loads
return _default_decoder.decode(s)
File "/Library/Python/2.7/site-packages/simplejson/decoder.py", line
370, in decode
obj, end = self.raw_decode(s)
File "/Library/Python/2.7/site-packages/simplejson/decoder.py", line
400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1
(char 0)
--
You received this message because you are subscribed to a topic in the
Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/ansible-project/pmiqGWriI4s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/69e30c1b-7201-40a6-94ff-ffa377bd8bce%40googlegroups.com
<https://groups.google.com/d/msgid/ansible-project/69e30c1b-7201-40a6-94ff-ffa377bd8bce%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAFgh18zVzNptfNsYazZU9C%3DV248X0m3FJfgj7yuKsfzghaLy%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
abdulrahim umar
2015-07-08 08:10:47 UTC
Permalink
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
.
Post by abdulrahim umar
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 Mon, Jul 6, 2015 at 6:08 PM, Kevin Schumacher <
Post by Kevin Schumacher
Abdulrahim -
I am having the same issue, still on Ansible 1.8.4. Did you ever solve
the issue?
Post by abdulrahim umar
Correction ansible version is latest1.8.4 installed with macports
Post by abdulrahim umar
Having an issue when using the dynamic inventory gce.py script with a
[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
pipelining=True
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
credentials/service -o StrictHostKeyChecking=no nc %h %p
ControlMaster auto
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
sh-3.2# ansible-playbook prdblb.yml -i inventory/ -vvvv
File "/usr/local/bin/ansible-playbook", line 326, in <module>
sys.exit(main(sys.argv[1:]))
File "/usr/local/bin/ansible-playbook", line 162, in main
inventory = ansible.inventory.Inventory(options.inventory,
vault_password=vault_pass)
File
"/Library/Python/2.7/site-packages/ansible/inventory/__init__.py", line
100, in __init__
self.parser = InventoryDirectory(filename=host_list)
File "/Library/Python/2.7/site-packages/ansible/inventory/dir.py",
line 56, in __init__
parser = InventoryScript(filename=fullpath)
File
"/Library/Python/2.7/site-packages/ansible/inventory/script.py", line 49,
in __init__
self.groups = self._parse(stderr)
File
"/Library/Python/2.7/site-packages/ansible/inventory/script.py", line 57,
in _parse
self.raw = utils.parse_json(self.data)
File "/Library/Python/2.7/site-packages/ansible/utils/__init__.py",
line 552, in parse_json
results = json.loads(data)
File "/Library/Python/2.7/site-packages/simplejson/__init__.py",
line 505, in loads
return _default_decoder.decode(s)
File "/Library/Python/2.7/site-packages/simplejson/decoder.py", line
370, in decode
obj, end = self.raw_decode(s)
File "/Library/Python/2.7/site-packages/simplejson/decoder.py", line
400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.scanner.JSONDecodeError: Expecting value: line 1 column 1
(char 0)
--
You received this message because you are subscribed to a topic in the
Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/ansible-project/pmiqGWriI4s/unsubscribe
.
To unsubscribe from this group and all its topics, send an email to
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/69e30c1b-7201-40a6-94ff-ffa377bd8bce%40googlegroups.com
<https://groups.google.com/d/msgid/ansible-project/69e30c1b-7201-40a6-94ff-ffa377bd8bce%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+***@googlegroups.com.
To post to this group, send email to ansible-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3d219d91-fdf3-453d-9475-dd01ccadacba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...