os_network cloud module cannot find my clouds.yml file

i’m using ansible 2.1.0 (devel 0c013f592a) last updated 2015/12/21 14:26:10 (GMT -700)

installed from source in ubuntu desktop.

here’s my playbook task:

  • name: create openstack network
    become: no
    os_network:
    cloud: testing
    name: mynetwork
    register: mynetwork_results

here’s my clouds.yml file (in same directory as playbook):

clouds:
testing:
auth:
auth_url: http://3.0.0.10:35357/v3
project_domain_id: default
user_domain_id: default
username: admin
password: password
project_name: admin

here’s the error I get when i run the task:\

fatal: [3.0.0.10]: FAILED! => {“changed”: false, “failed”: true, “msg”: “Traceback (most recent call last):\r\n File "/home/stack/.ansible/tmp/ansible-tmp-1450816900.25-86035633817923/os_network", line 2199, in \r\n main()\r\n File "/home/stack/.ansible/tmp/ansible-tmp-1450816900.25-86035633817923/os_network", line 144, in main\r\n cloud = shade.openstack_cloud(**module.params)\r\n File "/usr/local/lib/python2.7/dist-packages/shade/init.py", line 68, in openstack_cloud\r\n cloud_config = config.get_one_cloud(**kwargs)\r\n File "/usr/local/lib/python2.7/dist-packages/os_client_config/config.py", line 621, in get_one_cloud\r\n config = self._get_base_cloud_config(cloud)\r\n File "/usr/local/lib/python2.7/dist-packages/os_client_config/config.py", line 313, in _get_base_cloud_config\r\n name=name))\r\nos_client_config.exceptions.OpenStackConfigException: Named cloud testing requested that was not found.\r\n”, “parsed”: false}

any idea why it cannot find my cloud.yml file or my named cloud inside of that file?

Hi! It’s may be too late, I would like to share my experience.

Where are you placed clouds.yml file ?
You should place clouds.yml file to specific area of remote host server( where openstack is moved ).
http://blog.oddbit.com/2015/10/26/ansible-20-new-openstack-modules/

In my case,
Firstly I placed clouds.yml file to local, and get same error as you.
Next I place file to under /etc/openstack/ of remote server , It works :slight_smile:

2015年12月23日水曜日 6時53分18秒 UTC+9 R Melton: