Ansible 2.0.2.0 + shade 1.8.0 + openstack : Update inventory not working

42 views
Skip to first unread message

t10t...@gmail.com

unread,
May 6, 2016, 4:03:20 PM5/6/16
to Ansible Project
Hi,

I 'm an ansible newbie , I'm following lars blog to get ansible play nice with openstack

http://blog.oddbit.com/2015/10/26/ansible-20-new-openstack-modules/

I have a strange issue Issue. 
I can launch instances on openstack. But I'm unable to update the inventory.


playbook:
--snip--
 - hosts: localhost
  connection: local
  roles:
    - osp
--snip--

osp roles: main.yml

--snip--

- name: create a nova instance
  os_server:
    cloud: osp_test
    name: test
    state: present
    network: osp_50
    timeout: 200
    wait: yes
    image: centos-72u12151
    flavor: m1.xlarge
    key_name: vagrant_key
    floating_ip_pools:
      - ext_net
    security_groups:
      - default
    meta:
      group: openstack
  register: mysrv_inst

- name: Add osp instances back to inventory
  add_host:
    name: "{{ mysrv_inst.openstack.public_v4 }}"
    groups: openstack
    ansible_host: "{{ mysrv_inst.openstack.public_v4 }}"
    ansible_user: centos
    ansible_become: true

--snip--

# I dont get any error message ..

--snip--
ansible-playbook osp.yml   -v
Using /home/centos/ansible/ansible.cfg as config file

PLAY ***************************************************************************

TASK [setup] *******************************************************************
ok: [127.0.0.1]

TASK [osp : include] ***********************************************************
included: /home/centos/ansible/roles/osp/tasks/main.yml for 127.0.0.1

TASK [osp : create a nova instance] ********************************************
changed:
.
.
TASK [osp : Add osp instances back to inventory] *******************************
changed: [127.0.0.1] => {"add_host": {"groups": ["openstack"], "host_name": "172.16.202.193", "host_vars": {"ansible_become": true, "ansible_host": "172.16.202.193", "ansible_user": "centos"}}, "changed": true}

PLAY RECAP *********************************************************************
127.0.0.1                  : ok=4    changed=2    unreachable=0    failed=0  

--snip--

Am i missing some steps ...
Reply all
Reply to author
Forward
0 new messages