diff --git a/roles/set_resolv_conf/defaults/main.yml b/roles/set_resolv_conf/defaults/main.yml new file mode 100644 index 0000000..ba257cc --- /dev/null +++ b/roles/set_resolv_conf/defaults/main.yml @@ -0,0 +1,4 @@ +--- +dns_nameservers: + - 8.8.8.8 + - 8.8.4.4 diff --git a/roles/set_resolv_conf/tasks/main.yml b/roles/set_resolv_conf/tasks/main.yml new file mode 100644 index 0000000..d9ebaec --- /dev/null +++ b/roles/set_resolv_conf/tasks/main.yml @@ -0,0 +1 @@ +- template: src=resolv.conf.j2 dest=/etc/resolv.conf diff --git a/roles/set_resolv_conf/templates/resolv.conf.j2 b/roles/set_resolv_conf/templates/resolv.conf.j2 new file mode 100644 index 0000000..0d5a0bb --- /dev/null +++ b/roles/set_resolv_conf/templates/resolv.conf.j2 @@ -0,0 +1,3 @@ +{% for s in dns_nameservers %} +nameserver {{ s }} +{% endfor %} diff --git a/set_resolv_conf.yml b/set_resolv_conf.yml new file mode 100644 index 0000000..fae391f --- /dev/null +++ b/set_resolv_conf.yml @@ -0,0 +1,8 @@ +--- +# file: set_resolv_conf.yml +- hosts: infra + gather_facts: no + user: ubuntu + become: true + roles: + - { role: set_resolv_conf } diff --git a/site.yml b/site.yml index 956144d..b4f7ca2 100644 --- a/site.yml +++ b/site.yml @@ -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