juju-ansible
juju-ansible copied to clipboard
Doesn't seem to work on ubuntu trusty
Running on my trusty system, I get: root@extranet:~$ juju ansible all -m ping Error: 'list' object has no attribute 'iteritems'
ERROR: failed to parse executable inventory script results: {'msg': '', 'failed': True, 'parsed': False} ERROR subprocess encountered error code 1 I'm guessing this due to some python version changing? Maybe a 2to3 problem? I'm not sure.
Hmm, I'm unable to reproduce the error. I'm on trusty as well.
The script definitely only supports Python 2, but this is not a problem on my system -- and you'll get a different error than the one you describe if you try running with Python 3.
What is the output when you run 'juju status'? Also, what version ansible and Juju are you running?
root@extranet:~$ juju status environment: canonistack machines: "0": agent-state: started agent-version: 1.20.5 dns-name: 10.55.60.96 instance-id: 1995d7c0-316a-46c0-a8ef-49b612186216 instance-state: ACTIVE series: trusty hardware: arch=amd64 cpu-cores=1 mem=1024M root-disk=10240M state-server-member-status: has-vote "1": agent-state: started agent-version: 1.20.5 dns-name: 10.55.60.105 instance-id: 4caedc70-eb4c-4f73-bf51-c9c00c9a7e2b instance-state: ACTIVE series: trusty hardware: arch=amd64 cpu-cores=1 mem=1024M root-disk=10240M "2": agent-state: started agent-version: 1.20.5 dns-name: 10.55.60.176 instance-id: 193baedf-9db5-4888-a4d1-82bf02a2c9c3 instance-state: ACTIVE series: precise hardware: arch=amd64 cpu-cores=1 mem=1024M root-disk=10240M services: gunicorn: charm: cs:precise/gunicorn-12 exposed: false relations: wsgi-file: - qlbr subordinate-to: - qlbr postgresql: charm: cs:trusty/postgresql-3 exposed: false relations: db: - qlbr replication: - postgresql units: postgresql/0: agent-state: started agent-version: 1.20.5 machine: "1" open-ports: - 5432/tcp public-address: 10.55.60.105 qlbr: charm: cs:precise/python-django-8 exposed: true relations: pgsql: - postgresql wsgi: - gunicorn units: qlbr/0: agent-state: error agent-state-info: 'hook failed: "install"' agent-version: 1.20.5 machine: "2" public-address: 10.55.60.176 root@extranet:~$ juju --version 1.20.5-trusty-amd64 root@extranet:~$ ansible --version ansible 1.5.4
It could be an issue with juju 1.20 output. Can you paste the output of 'juju status --format json' (sorry, should have been more specific in the first place)?
{"environment":"canonistack","machines":{"0":{"agent-state":"started","agent-version":"1.20.5","dns-name":"10.55.60.96","instance-id":"1995d7c0-316a-46c0-a8ef-49b612186216","instance-state":"ACTIVE","series":"trusty","hardware":"arch=amd64 cpu-cores=1 mem=1024M root-disk=10240M","state-server-member-status":"has-vote"},"1":{"agent-state":"started","agent-version":"1.20.5","dns-name":"10.55.60.105","instance-id":"4caedc70-eb4c-4f73-bf51-c9c00c9a7e2b","instance-state":"ACTIVE","series":"trusty","hardware":"arch=amd64 cpu-cores=1 mem=1024M root-disk=10240M"},"2":{"agent-state":"started","agent-version":"1.20.5","dns-name":"10.55.60.176","instance-id":"193baedf-9db5-4888-a4d1-82bf02a2c9c3","instance-state":"ACTIVE","series":"precise","hardware":"arch=amd64 cpu-cores=1 mem=1024M root-disk=10240M"}},"services":{"gunicorn":{"charm":"cs:precise/gunicorn-12","exposed":false,"relations":{"wsgi-file":["qlbr"]},"subordinate-to":["qlbr"]},"postgresql":{"charm":"cs:trusty/postgresql-3","exposed":false,"relations":{"db":["qlbr"],"replication":["postgresql"]},"units":{"postgresql/0":{"agent-state":"started","agent-version":"1.20.5","machine":"1","open-ports":["5432/tcp"],"public-address":"10.55.60.105"}}},"qlbr":{"charm":"cs:precise/python-django-8","exposed":true,"relations":{"pgsql":["postgresql"],"wsgi":["gunicorn"]},"units":{"qlbr/0":{"agent-state":"error","agent-state-info":"hook failed: "install"","agent-version":"1.20.5","machine":"2","public-address":"10.55.60.176"}}}}}
I think this is caused by having services with no machines or machines with no services or something. See the pull request I've submitted.
See if 62e590a8fb870348cb5638a3e12240661899e5dc fixes your issue.