Maybe finish lineinfile part of libvirt role
This commit is contained in:
parent
65eb7c0701
commit
80785e3cd1
1 changed files with 11 additions and 2 deletions
|
@ -21,9 +21,17 @@
|
|||
append: yes
|
||||
groups: libvirt
|
||||
|
||||
- name: Check if "libvirt libvirt_guest" is in /etc/nsswitch.conf
|
||||
- name: Check if 'libvirt libvirt_guest' is in /etc/nsswitch.conf
|
||||
become: true
|
||||
lineinfile:
|
||||
path: /etc/nsswitch.conf
|
||||
line: libvirt libvirt_guest
|
||||
state: present
|
||||
check_mode: true
|
||||
register: presence
|
||||
|
||||
- name: Put 'libvirt libvirt_guest' in /etc/nsswitch.conf
|
||||
become: true
|
||||
# TODO: this keeps adding the line over and over again
|
||||
lineinfile:
|
||||
path: /etc/nsswitch.conf
|
||||
regexp: '^hosts: (.+)'
|
||||
|
@ -31,3 +39,4 @@
|
|||
state: present
|
||||
backrefs: true
|
||||
backup: true
|
||||
when: presence.changed
|
||||
|
|
Loading…
Add table
Reference in a new issue