blob: 792748e3b744d9713695d07e631af664d9dde620 [file] [log] [blame]
Zack Williams22e89932016-03-15 11:08:06 -07001---
2# roles/dns-configure/tasks.yml
3
Zack Williamsba5549c2017-03-25 15:04:45 -07004- name: Make sure resolvconf is doing DNS resolver mangling
5 apt:
6 name: resolvconf
7 update_cache: yes
8 cache_valid_time: 3600
9
10- name: Create resolvconf configuration files
Zack Williamsc56ac642016-03-15 11:08:47 -070011 template:
Zack Williamsba5549c2017-03-25 15:04:45 -070012 src: "{{ item }}.j2"
13 dest: "/etc/resolvconf/resolv.conf.d/{{ item }}"
14 mode: 0644
15 owner: root
16 group: root
17 with_items:
18 - base
19 - head
20 register: resolvconf_configured
21
22- name: Tell resolvconf to refresh /etc/resolv.conf file if changed
23 become: yes
24 command: resolvconf -u
25 when: resolvconf_configured.changed
26 tags:
27 - skip_ansible_lint # needs to run before the DNS check which happens next, so can't be a handler
Zack Williams22e89932016-03-15 11:08:06 -070028
Zack Williams82c88e92016-08-08 13:54:20 -070029- name: Check that VM's can be found in DNS
30 shell: "dig +short {{ item.name }}.{{ site_suffix }} | grep {{ item.ipv4_last_octet }}"
Zack Williamsba5549c2017-03-25 15:04:45 -070031 with_items: "{{ head_lxd_list }}"
Zack Williams35624562016-08-28 17:12:26 -070032 tags:
33 - skip_ansible_lint # purely a way to pass/fail config done so far. Ansible needs a "dns_query" module
Zack Williams82c88e92016-08-08 13:54:20 -070034