Issue with os_server module

Hi,

I’m trying to launch an instance using os_server module
Using simple playbook

  • name: create openstack instance
    hosts: local_host
    tasks:
  • name: launch instance
    os_server:
    auth:
    auth_url: http://<some url>
    username: ansible
    password: ansible
    project_name: ansible
    state: present
    name: ldap_client
    image: 0b9d8320-93f7-4814-a03d-4c51f15bab84
    key_name: ansible_key
    timeout: 200
    flavor: 2
    nics:
  • net-id: 1446ba1c-341c-4633-84ba-ac0787d162a2
  • net-name: private
    security_groups: default
    meta:
    hostname: ldap_client
    wait: yes

Getting following syntax error in shade when running

ansible-playbook -v -i hosts new_openstack_instance.yml

PLAY [create openstack instance] **********************************************

GATHERING FACTS ***************************************************************

ok: [localhost]

TASK: [launch instance] *******************************************************

failed: [localhost] => {“failed”: true, “parsed”: false, “playbook”: “new_openstack_instance.yml”, “role”: null, “task”: “launch instance”}

Traceback (most recent call last):

File “/root/.ansible/tmp/ansible-tmp-1433192026.99-61510740137065/os_server”, line 23, in

import shade

File “/usr/lib/python2.6/site-packages/shade/init.py”, line 112

for k in kwargs.keys() if k.endswith(service_key)}

^

SyntaxError: invalid syntax

FATAL: all hosts have already failed – aborting

PLAY RECAP ********************************************************************

to retry, use: --limit @/root/new_openstack_instance.retry

localhost : ok=1 changed=0 unreachable=0 failed=1

Any suggestions?
Thanks in advance

That looks like a bug in the shade library, its also a bug in Ansible
because we should not throw an 'unwrapped traceback'.

though to be fair, a syntax error in a library you re importing should
only happen when you are developing said library.

The problem is that the shade module requires python 2.7 as it stands. I believe there is a PR for shade module to support python 2.6.

Thanks. worked with Python2.7