# Issue with os\_server module

**URL:** <https://forum.ansible.com/t/issue-with-os-server-module/18372>\
**Category:** Ansible Project\
**Created:** [June 1, 2015, 8:58pm UTC](https://forum.ansible.com/t/issue-with-os-server-module/18372 "2015-06-01T20:58:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Goldberg\_Eduard](https://avatars.discourse-cdn.com/v4/letter/g/2bfe46/32.png) [@Goldberg\_Eduard](https://forum.ansible.com/u/Goldberg_Eduard)\
**Post date:** [June 1, 2015, 8:58pm UTC](https://forum.ansible.com/t/issue-with-os-server-module/18372/1 "2015-06-01T20:58:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 1, 2015, 9:39pm UTC](https://forum.ansible.com/t/issue-with-os-server-module/18372/2 "2015-06-01T21:39:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [June 1, 2015, 9:41pm UTC](https://forum.ansible.com/t/issue-with-os-server-module/18372/3 "2015-06-01T21:41:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![James\_Martin1](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@James\_Martin1](https://forum.ansible.com/u/James_Martin1)\
**Post date:** [June 1, 2015, 10:31pm UTC](https://forum.ansible.com/t/issue-with-os-server-module/18372/4 "2015-06-01T22:31:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Goldberg\_Eduard](https://avatars.discourse-cdn.com/v4/letter/g/2bfe46/32.png) [@Goldberg\_Eduard](https://forum.ansible.com/u/Goldberg_Eduard)\
**Post date:** [June 2, 2015, 7:43pm UTC](https://forum.ansible.com/t/issue-with-os-server-module/18372/5 "2015-06-02T19:43:35Z")

</div>

Thanks. worked with Python2.7
