Hi,
Looks like you misunderstood my previous mail, there is no need to edit
your openrc file. The OS_server module can load the login details from
openrc file. Hard coding openstack logins in playbook is not a recommended
practice. You can use the sample snippet given below to create an instance
in openstack using ansible and assign floating IP address.
----
[centos@centos7 ~]# cat createinstance.yml
- name: launch a compute instance
hosts: localhost
tasks:
- name: launch an instance
os_server:
name: vmtest
state: present
image: Cirros
flavor: m1.medium
security_groups: default
auto_ip: yes
[centos@centos7 centos]# source openrc.sh
[centos@centos7 ~]# ansible-playbook createinstance.yml
PLAY [launch a compute instance]
***********************************************
TASK [setup]
*******************************************************************
Friday 31 March 2017 10:44:31 +0000 (0:00:00.045) 0:00:00.045
**********
ok: [localhost]
TASK [launch an instance]
******************************************************
Friday 31 March 2017 10:44:33 +0000 (0:00:01.498) 0:00:01.543
**********
changed: [localhost]
PLAY RECAP
*********************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0
Friday 31 March 2017 10:45:19 +0000 (0:00:46.442) 0:00:47.986
**********
===============================================================================
launch an instance -----------------------------------------------------
46.44s
setup -------------------------------------------------------------------
1.50s
Playbook run took 0 days, 0 hours, 0 minutes, 47 seconds
--
Regards,
Amarjeet
On Fri, Mar 31, 2017 at 1:49 AM, balubhai555 <[email protected]> wrote:
> I gave
>
> export OS_USER_DOMAIN_NAME=default
>
> in openrc.sh and Is this one you mentioned above?
>
>
>
> --
> 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 post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/ansible-project/4d04dce9-c51c-4c26-a886-800e74db0c00%40googlegroups.
> com
> <https://groups.google.com/d/msgid/ansible-project/4d04dce9-c51c-4c26-a886-800e74db0c00%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/CACLrQb1qPaJ8iYDCMAG3pM%2BEvKV%2BdrT4C39nTjJFchpd-MC0bA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.