Set resolv.conf on nodes before bootstrap
In some clouds, the nodes created may not have a usable dns server from Neutron. Use the Google one, may set this role parameterized at some point. Change-Id: I05fcd867e47fcc45dab25d5be5c8349d272514f4
This commit is contained in:
parent
65ce185c2b
commit
afaf0e4a2c
4
roles/set_resolv_conf/defaults/main.yml
Normal file
4
roles/set_resolv_conf/defaults/main.yml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
dns_nameservers:
|
||||||
|
- 8.8.8.8
|
||||||
|
- 8.8.4.4
|
1
roles/set_resolv_conf/tasks/main.yml
Normal file
1
roles/set_resolv_conf/tasks/main.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
- template: src=resolv.conf.j2 dest=/etc/resolv.conf
|
3
roles/set_resolv_conf/templates/resolv.conf.j2
Normal file
3
roles/set_resolv_conf/templates/resolv.conf.j2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
{% for s in dns_nameservers %}
|
||||||
|
nameserver {{ s }}
|
||||||
|
{% endfor %}
|
8
set_resolv_conf.yml
Normal file
8
set_resolv_conf.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
# file: set_resolv_conf.yml
|
||||||
|
- hosts: infra
|
||||||
|
gather_facts: no
|
||||||
|
user: ubuntu
|
||||||
|
become: true
|
||||||
|
roles:
|
||||||
|
- { role: set_resolv_conf }
|
1
site.yml
1
site.yml
@ -2,6 +2,7 @@
|
|||||||
# file: site.yml
|
# file: site.yml
|
||||||
- include: generate_infra_dynamic_groups.yml
|
- include: generate_infra_dynamic_groups.yml
|
||||||
- include: wait_for_servers.yml
|
- include: wait_for_servers.yml
|
||||||
|
- include: set_resolv_conf.yml
|
||||||
- include: common.yml
|
- include: common.yml
|
||||||
- include: set_hostnames.yml
|
- include: set_hostnames.yml
|
||||||
- include: bootstrap_puppetmaster.yml
|
- include: bootstrap_puppetmaster.yml
|
||||||
|
Loading…
Reference in New Issue
Block a user