Improvements to seed VM provisioning
Fully bounce interfaces, fix permissions of /etc/resolv.conf (it gets written out with 0660, but should be 0644), increase SSH wait timeout to 360 seconds. The latter change allows for a commonly used 5 minute DHCP timeout which may be applied before cloud-init is run.
This commit is contained in:
parent
7a8e087731
commit
2a66c77525
@ -19,15 +19,19 @@
|
|||||||
state: directory
|
state: directory
|
||||||
|
|
||||||
# The user data script is used to bring up the network interfaces that will
|
# The user data script is used to bring up the network interfaces that will
|
||||||
# be configured by metadata in the configdrive. It could be used for other
|
# be configured by metadata in the configdrive. For some reason resolv.conf
|
||||||
# things in future if necessary.
|
# gets configured with 660 permissions, so fix that here also.
|
||||||
- name: Ensure the user data file exists
|
- name: Ensure the user data file exists
|
||||||
copy:
|
copy:
|
||||||
content: |
|
content: |
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
{% for interface in seed_hostvars.network_interfaces | map('net_interface', seed_host) %}
|
{% for interface in seed_hostvars.network_interfaces | map('net_interface', seed_host) %}
|
||||||
|
# Bounce {{ interface }}.
|
||||||
|
ifdown {{ interface }}
|
||||||
ifup {{ interface }}
|
ifup {{ interface }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
# Fix permissions of resolv.conf.
|
||||||
|
chmod 644 /etc/resolv.conf
|
||||||
dest: "{{ seed_user_data_path }}"
|
dest: "{{ seed_user_data_path }}"
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
@ -110,3 +114,6 @@
|
|||||||
host: "{{ seed_hostvars.ansible_host }}"
|
host: "{{ seed_hostvars.ansible_host }}"
|
||||||
port: 22
|
port: 22
|
||||||
state: started
|
state: started
|
||||||
|
# NOTE: Ensure we exceed the 5 minute DHCP timeout of the eth0
|
||||||
|
# interface if necessary.
|
||||||
|
timeout: 360
|
||||||
|
Loading…
x
Reference in New Issue
Block a user