Sending userdata via config_drive doesn't seem to upload the userdata.

10 views
Skip to first unread message

Roy Hoerauf

unread,
Apr 17, 2017, 3:05:31 PM4/17/17
to Ansible Project
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

Reply all
Reply to author
Forward
0 new messages