add nsswhitch config for dns

This commit is contained in:
vincent 2023-11-12 11:04:09 +01:00
parent 6c0fb2e5f1
commit 4b284946e1

View File

@ -33,7 +33,7 @@
src: qemu.conf.j2 # required. Path of a Jinja2 formatted template on the Ansible controller. This can be a relative or absolute path.
become: yes
- debug:
msg: "{{ ansible_default_ipv4.type }}"
msg: '{{ ansible_default_ipv4.type }}'
- name: set bridge template
template:
@ -43,6 +43,14 @@
become: yes
notify: bridge_enable
- name: add libvirt to nsswitch hosts
ansible.builtin.lineinfile:
dest: '/etc/nsswitch.conf'
regexp: '^hosts:'
line: 'hosts: files libvirt libvirt_guest mymachines myhostname resolve [!UNAVAIL=return] dns'
state: present
create: true
become: true
- name: enable bridge
systemd:
name: netctl@bridge.service
@ -54,4 +62,3 @@
name: dhcpcd # required. Name of the service.
enabled: false
become: yes