I am attempting to create a new server and upload a json file as userdata.
ansible-playbook indicates success but the instance doesn't seem to see the
userdata. However, it does work when I do this via nova boot or a heat
stack.
ansible 2.2.1.0
OpenStack Mitaka (AIO)
The task looks like this:
---
- name: Create WDC01 P-CSCF-01A
os_server:
auth: "{{ vnf_auth }}"
flavor: "{{ ssc_low_flavor_name }}"
security_groups: "{{ security_group_ID }}"
nics:
- port-name: "{{ wdc01_p1a_mgmt_fixed_address }}"
- port-name: "{{ wdc01_p1a_ha_fixed_address }}"
- port-name: "{{ wdc01_p1a_serv1_fixed_address }}"
- port-name: "{{ wdc01_p1a_serv2_fixed_address }}"
image: "{{ perimeta_image_name }}"
config_drive: yes
userdata: "{{ lookup('file',
'/etc/ansible/roles/WDC01/P-CSCF-01/files/SSC-A_config.json') }}"
name: "{{ p_cscf_01a_name }}"
state: present
...
And the json file is:
{
"ip_ha_local": "192.168.2.4",
"ip_ha_remote": "192.168.2.3",
"ip_ha_plen": "24"
}
=================
TASK [Create WDC01 P-CSCF-01A userdata={{ lookup('file',
'/etc/ansible/roles/WDC01/P-CSCF-01/files/SSC-A_config.json') }}, name={{
p_cscf_01a_name }}, nics=[{u'port-name': u'{{ wdc01_p1a_mgmt_fixed_address
}}'}, {u'port-name': u'{{ wdc01_p1a_ha_fixed_address }}'}, {u'port-name':
u'{{ wdc01_p1a_serv1_fixed_address }}'}, {u'port-name': u'{{
wdc01_p1a_serv2_fixed_address }}'}], image={{ perimeta_image_name }},
auth={{ vnf_auth }}, state=present, flavor={{ ssc_low_flavor_name }},
security_groups={{ security_group_ID }}, config_drive=True] ***
changed: [172.24.12.21]
=================
This shows a positive result, but the instance doesn't seem to get the
userdata. And I don't see anything in the various nova logs.
Your assistance would be most welcome.
Roy
--
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/32953271-1577-4ebb-9890-2b91d11079f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.