diff --git a/group_vars/default/base.yml b/group_vars/default/base.yml index 6efa426..9302110 100644 --- a/group_vars/default/base.yml +++ b/group_vars/default/base.yml @@ -9,6 +9,13 @@ timezone_location: Canada/Eastern # Cluster domain for node FQDNs local_domain: upstream.local +# DNS recursive servers and search domains for nodes +recursive_dns_servers: + - 8.8.8.8 + - 8.8.4.4 +recursive_dns_search_domains: + - "{{ local_domain }}" + # Cluster hardware model, used in pvc_user_configuration and grub_configuration below cluster_hardware: default diff --git a/roles/base/defaults/main.yml b/roles/base/defaults/main.yml index 1fd1260..a6a6c57 100644 --- a/roles/base/defaults/main.yml +++ b/roles/base/defaults/main.yml @@ -6,6 +6,12 @@ debian_pvc_repository: https://repo.parallelvirtualcluster.org/debian debian_pvc_signing_key_path: https://repo.parallelvirtualcluster.org/debian/bonifacelabs_signing_key.pub debian_pvc_signing_key_id: 83D07192314835D4 +recursive_dns_servers: + - 8.8.8.8 + - 8.8.4.4 +recursive_dns_search_domains: + - "{{ local_domain }}" + grub_cmdline: "systemd.unified_cgroup_hierarchy=0 console=tty0 console=ttyS{{ grub.serial_console[cluster_hardware].console }},115200 plymouth.ignore-serial-consoles splash" grub_serial: "serial --unit={{ grub.serial_console[cluster_hardware].console }} --speed=115200" diff --git a/roles/base/templates/etc/resolv.conf.j2 b/roles/base/templates/etc/resolv.conf.j2 index 7af2b16..7942863 100644 --- a/roles/base/templates/etc/resolv.conf.j2 +++ b/roles/base/templates/etc/resolv.conf.j2 @@ -2,6 +2,10 @@ # {{ ansible_managed }} domain {{ local_domain }} +{% if recursive_dns_search_domains is defined %} +search {{ recursive_dns_search_domains | join (' ') }} +{% endif %} options timeout:1 attempts:3 rotate -nameserver 8.8.8.8 -nameserver 8.8.4.4 +{% for server in recursive_dns_servers %} +nameserver {{ server }} +{% endfor %}