You are using the literal string 'cloud'.
Change that entry in the os_network task to:

 cloud: "{{ mycloud }}"

On Wed, 31 Jul 2019 at 09:37, Rahul Kumar <[email protected]> wrote:
>
> Hi All,
> I am trying to create Openstack instances using Ansible for Openstack.
> I have clouds.yaml as below:
> clouds:
>   mycloud:
>     auth:
>       auth_url: https://<host>:<Port>/v3
>       project_name: mycloud
>       username: mycloud
>       project_domain_name: Default
>       user_domain_name: Default
>       password: mycloudpwd
>     region_name: regionOne
>     interface: public
>     identity_api_version:
> and Main Playbook is as below:
> ---
> - name: Create a test environment
>   hosts: localhost
>   tasks:
>     - name: create network
>       os_network:
>         cloud: mycloud
>         state: present
>         name: test-network
>         external: false
>         wait: yes
> ---------------------
> ------
> But i am resulting in error:
> fatal: [localhost]: FAILED! => {"changed": false, "msg": "Cloud mycloud was 
> not found."}.
> Notice clouds.yaml and Main Playbook is in same location.
>
> Thanks
> Rahul
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/CAGH8rEzmMwBjGVa31CA5Ffj60imd_7WQ6MFCm6EUuUP2ve_YEA%40mail.gmail.com.



-- 
Dick Visser
Trust & Identity Service Operations Manager
GÉANT

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwNhvjuBwT0nMcYkjs2c9Q3qMqJUw2fD0b4pc7MVhZ%3D3oQ%40mail.gmail.com.

Reply via email to