blob: 88f6d9ebc93e1e5fa86d9fe01c68044db44847f1 [file] [log] [blame]
Zack Williams6dc2d452017-12-20 17:50:49 -07001---
Matteo Scandolo3896c472017-08-01 13:31:42 -07002# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
Zack Williams22e89932016-03-15 11:08:06 -070016# roles/dns-configure/tasks.yml
17
Zack Williamsba5549c2017-03-25 15:04:45 -070018- name: Make sure resolvconf is doing DNS resolver mangling
19 apt:
20 name: resolvconf
21 update_cache: yes
22 cache_valid_time: 3600
23
24- name: Create resolvconf configuration files
Zack Williamsc56ac642016-03-15 11:08:47 -070025 template:
Zack Williamsba5549c2017-03-25 15:04:45 -070026 src: "{{ item }}.j2"
27 dest: "/etc/resolvconf/resolv.conf.d/{{ item }}"
28 mode: 0644
29 owner: root
30 group: root
31 with_items:
32 - base
33 - head
34 register: resolvconf_configured
35
36- name: Tell resolvconf to refresh /etc/resolv.conf file if changed
37 become: yes
38 command: resolvconf -u
39 when: resolvconf_configured.changed
40 tags:
41 - 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 -070042
Zack Williams2f5f2bd2017-12-01 15:04:22 -070043- name: Check that Openstack LXD containers can be found in DNS
44 when: use_openstack
Zack Williams82c88e92016-08-08 13:54:20 -070045 shell: "dig +short {{ item.name }}.{{ site_suffix }} | grep {{ item.ipv4_last_octet }}"
Zack Williamsba5549c2017-03-25 15:04:45 -070046 with_items: "{{ head_lxd_list }}"
Zack Williams35624562016-08-28 17:12:26 -070047 tags:
48 - 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 -070049
Zack Williams6dc2d452017-12-20 17:50:49 -070050- name: Check that aliases can be found in DNS
51 when: not use_maas
52 shell: "dig +short {{ item.1.name }}.{{ site_suffix }} | grep {{ item.1.dest }}"
53 with_subelements:
54 - "{{ nsd_zones }}"
55 - aliases
56 tags:
57 - skip_ansible_lint # purely a way to pass/fail config done so far. Ansible needs a "dns_query" module
58