-
Notifications
You must be signed in to change notification settings - Fork 3
/
virt_dns.yml
executable file
·62 lines (55 loc) · 1.58 KB
/
virt_dns.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env ansible-playbook
---
- hosts: virt_hypervisors
vars:
network_name: default
bridge_name: virbr0
network_gateway: 192.168.122.1
domain: libvirt
roles:
- role: stackhpc.libvirt-host
libvirt_host_networks:
- name: "{{network_name}}"
mode: nat
bridge: "{{bridge_name}}"
domain: "{{domain}}"
ip: "{{network_gateway}}"
netmask: 255.255.255.0
dhcp_start: 192.168.122.100
dhcp_end: 192.168.122.200
tasks:
- name: resolved-nm-hook
template:
src: kvm/network-manager-hook.sh.j2
dest: /etc/NetworkManager/dispatcher.d/{{bridge_name}}-libvirt-hook.sh
mode: u+rwx,go+rx
- name: libvirt-hooks-dir
file:
path: /etc/libvirt/hooks/network.d/
state: directory
- name: resolved-dns-hook
template:
src: kvm/resolved-dns-hook.sh.j2
dest: /etc/libvirt/hooks/network.d/{{bridge_name}}-resolved-dns-hook.sh
mode: u+rwx,go+rx
# - name: libvirt_nss_package
# yum:
# name:
# - libvirt-nss
# state: latest
# - name: nsswitch_config
# lineinfile:
# dest: "{{item}}"
# regexp: '^hosts:.*'
# line: "hosts: files libvirt libvirt_guest resolve [!UNAVAIL=return] myhostname dns"
# notify: authselect_apply
# loop:
# - /etc/authselect/user-nsswitch.conf
## - /etc/nsswitch.conf
# - name: nsswitch_change_option
# command: authselect enable-feature with-custom-hosts
# notify: authselect_apply
# handlers:
# - name: authselect_apply
# command: authselect apply-changes
...