diff options
Diffstat (limited to 'roles/dns')
| -rw-r--r-- | roles/dns/tasks/main.yml | 16 | ||||
| -rw-r--r-- | roles/dns/templates/resolv.conf.j2 | 7 | 
2 files changed, 23 insertions, 0 deletions
| diff --git a/roles/dns/tasks/main.yml b/roles/dns/tasks/main.yml new file mode 100644 index 0000000..41cfe8e --- /dev/null +++ b/roles/dns/tasks/main.yml @@ -0,0 +1,16 @@ + +# dns ~~ roles/dns/tasks/main.yml +# ensure host is using unified dns + +--- + +- name: ensure dns +  template: +    src: resolv.conf.j2 +    dest: /etc/resolv.conf +    owner: "{{ user_root }}" +    group: "{{ group_root }}" +    mode: 0644 + +- name: check dns resolution +  shell: ping -c 1 google.com diff --git a/roles/dns/templates/resolv.conf.j2 b/roles/dns/templates/resolv.conf.j2 new file mode 100644 index 0000000..f7240e7 --- /dev/null +++ b/roles/dns/templates/resolv.conf.j2 @@ -0,0 +1,7 @@ + +# resolv configuration ~~ /etc/resolv.conf +# managed by Ansible + +nameserver {{ global.dns[0] }} +nameserver {{ global.dns[1] }} + |