Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Openstack unable to assign ip to Instance

I am using os_server anisble module to spinup an instance. I am able to spinup instance and attach ip to it but after creating the instance I have to manually configure the ip. How can I make it assign the Ip automatically to instance while creating. Here is my module

      - name: Deploy on OpenStack
        hosts: localhost
        gather_facts: false
        tasks:
        - name : Create a new instance
           os_server:
                state: present
                auth:
                auth_url: http://xx.xxx.xx.xx:x000/v2.0
                username: automation
                password: automation
                project_name: Automation
         name: test
         image: rhel-guest-image-7.2
         key_name: ansible 
         timeout: 200
         flavor: ucc.as
         auto_floating_ip: yes
         nics:
            - net-name: corenet
            - net-name: nmnet
            - net-name: public
        meta:
           hostname: test1

On the openstack dashboard I can see the ip assigned to the instance but when I open the console on login the instance ip are not present. I have to manually configure it.