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:
Ricardo Carrillo Cruz 2016-06-08 09:47:02 +00:00
parent 65ce185c2b
commit afaf0e4a2c
5 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,4 @@
---
dns_nameservers:
- 8.8.8.8
- 8.8.4.4

View File

@ -0,0 +1 @@
- template: src=resolv.conf.j2 dest=/etc/resolv.conf

View File

@ -0,0 +1,3 @@
{% for s in dns_nameservers %}
nameserver {{ s }}
{% endfor %}

8
set_resolv_conf.yml Normal file
View File

@ -0,0 +1,8 @@
---
# file: set_resolv_conf.yml
- hosts: infra
gather_facts: no
user: ubuntu
become: true
roles:
- { role: set_resolv_conf }

View File

@ -2,6 +2,7 @@
# file: site.yml
- include: generate_infra_dynamic_groups.yml
- include: wait_for_servers.yml
- include: set_resolv_conf.yml
- include: common.yml
- include: set_hostnames.yml
- include: bootstrap_puppetmaster.yml