# Can't get os\_network to work.

**URL:** <https://forum.ansible.com/t/cant-get-os-network-to-work/21206>\
**Category:** Ansible Project\
**Created:** [April 19, 2016, 3:10pm UTC](https://forum.ansible.com/t/cant-get-os-network-to-work/21206 "2016-04-19T15:10:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cees\_Moerkerken](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@Cees\_Moerkerken](https://forum.ansible.com/u/Cees_Moerkerken)\
**Post date:** [April 19, 2016, 3:10pm UTC](https://forum.ansible.com/t/cant-get-os-network-to-work/21206/1 "2016-04-19T15:10:27Z")

</div>

Hi all,

I have successfully managed to deploy some cloud servers with ansible 2.0 on openstack, but seem to get stuck on creating the network.

State should not be required according to [http://docs.ansible.com/ansible/os\_network\_module.html](http://docs.ansible.com/ansible/os_network_module.html).

When i comment out the state parameter i get:

> TASK [os\_network : OpenStack | create network] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> 
> fatal: [127.0.0.1]: FAILED! =\> {“changed”: false, “failed”: true, “module\_stderr”: “”, “module\_stdout”: “Traceback (most recent call last):\r\n File "/root/.ansible/tmp/ansible-tmp-1461078444.28-238290358250568/os\_network", line 2144, in \r\n main()\r\n File "/root/.ansible/tmp/ansible-tmp-1461078444.28-238290358250568/os\_network", line 78, in main\r\n state = module.params[‘state’]\r\nKeyError: ‘state’\r\n”, “msg”: “MODULE FAILURE”, “parsed”: false}

And when i uncomment the state parameter i get:

> TASK [os\_network : OpenStack | create network] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
> 
> fatal: [127.0.0.1]: FAILED! =\> {“changed”: false, “failed”: true, “msg”: “unsupported parameter for module: state”}

My ansible role looks like:

> * * *
> 
> - name: OpenStack | create network
> 
> os\_network:
> 
> cloud: testing
> 
> state: present
> 
> name: “{{ private\_net\_name }}”
> 
> register: mynetwork

Any help or ideas would greatly be appreciated!

Greets,  
Cees

---

<div class="post-metadata">

**Author:** ![David\_Shrewsbury1](https://avatars.discourse-cdn.com/v4/letter/d/7ab992/32.png) [@David\_Shrewsbury1](https://forum.ansible.com/u/David_Shrewsbury1)\
**Post date:** [April 19, 2016, 5:58pm UTC](https://forum.ansible.com/t/cant-get-os-network-to-work/21206/2 "2016-04-19T17:58:05Z")

</div>

Hi,

This is very odd. I’m unable to reproduce this with Ansible 2.0. Are you using the latest release?  
Do you have any more verbose output to share, or a complete playbook that reproduced the problem?

-Dave

---

<div class="post-metadata">

**Author:** ![Cees\_Moerkerken](https://avatars.discourse-cdn.com/v4/letter/c/838e76/32.png) [@Cees\_Moerkerken](https://forum.ansible.com/u/Cees_Moerkerken)\
**Post date:** [April 20, 2016, 9:08am UTC](https://forum.ansible.com/t/cant-get-os-network-to-work/21206/3 "2016-04-20T09:08:17Z")

</div>

I was using a clone from [https://github.com/ansible/ansible/tree/stable-2.0.0.1](https://github.com/ansible/ansible/tree/stable-2.0.0.1), now i’ve installed the latest version via the ppa, but it might jus be that the vm i’m using is a bit messed up. I will create a new, clean vm with just the ppa install and report back.

with the state parameter the verbose output is:

> failed: [127.0.0.1] =\> {“failed”: true, “playbook”: “deploy.yml”, “role”: null, “task”: “OpenStack | create network”}
> 
> msg: unsupported parameter for module: state
> 
> FATAL: all hosts have already failed – aborting

without the state parameter the output is:

> failed: [127.0.0.1] =\> {“failed”: true, “parsed”: false, “playbook”: “deploy.yml”, “role”: null, “task”: “OpenStack | create network”}
> 
> Traceback (most recent call last):
> 
> File “/root/.ansible/tmp/ansible-tmp-1461143206.36-132434212146433/os\_network”, line 1844, in
> 
> main()
> 
> File “/root/.ansible/tmp/ansible-tmp-1461143206.36-132434212146433/os\_network”, line 77, in main
> 
> state = module.params[‘state’]
> 
> KeyError: ‘state’
> 
> OpenSSH\_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
> 
> debug1: Reading configuration data /root/.ssh/config
> 
> debug1: Reading configuration data /etc/ssh/ssh\_config
> 
> debug1: /etc/ssh/ssh\_config line 19: Applying options for \*
> 
> debug1: auto-mux: Trying existing master
> 
> debug2: fd 3 setting O\_NONBLOCK
> 
> debug2: mux\_client\_hello\_exchange: master version 4
> 
> debug3: mux\_client\_forwards: request forwardings: 0 local, 0 remote
> 
> debug3: mux\_client\_request\_session: entering
> 
> debug3: mux\_client\_request\_alive: entering
> 
> debug3: mux\_client\_request\_alive: done pid = 15122
> 
> debug3: mux\_client\_request\_session: session request sent
> 
> debug1: mux\_client\_request\_session: master session id: 2
> 
> debug3: mux\_client\_read\_packet: read header failed: Broken pipe
> 
> debug2: Received exit status from master 0
> 
> Shared connection to 127.0.0.1 closed.

The playbook is:
