Issue with os_server module

157 views
Skip to first unread message

Goldberg Eduard

unread,
Jun 1, 2015, 5:10:44 PM6/1/15
to ansible...@googlegroups.com
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 <module>
    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


Brian Coca

unread,
Jun 1, 2015, 5:39:39 PM6/1/15
to ansible...@googlegroups.com
That looks like a bug in the shade library, its also a bug in Ansible
because we should not throw an 'unwrapped traceback'.


--
Brian Coca

Brian Coca

unread,
Jun 1, 2015, 5:41:25 PM6/1/15
to ansible...@googlegroups.com
though to be fair, a syntax error in a library you re importing should
only happen when you are developing said library.


--
Brian Coca

James Martin

unread,
Jun 1, 2015, 6:31:25 PM6/1/15
to ansible...@googlegroups.com
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.

Goldberg Eduard

unread,
Jun 2, 2015, 3:43:35 PM6/2/15
to ansible...@googlegroups.com
Thanks. worked with Python2.7
Reply all
Reply to author
Forward
0 new messages