Try libvirt nsswitch with grep
This commit is contained in:
parent
80785e3cd1
commit
ebbc0ad3ec
1 changed files with 3 additions and 7 deletions
|
@ -22,13 +22,9 @@
|
|||
groups: libvirt
|
||||
|
||||
- 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
|
||||
command: grep -c 'libvirt libvirt_guest' /etc/nsswitch.conf
|
||||
register: presence
|
||||
changed_when: presence.stdout == '0'
|
||||
|
||||
- name: Put 'libvirt libvirt_guest' in /etc/nsswitch.conf
|
||||
become: true
|
||||
|
@ -39,4 +35,4 @@
|
|||
state: present
|
||||
backrefs: true
|
||||
backup: true
|
||||
when: presence.changed
|
||||
when: presence.stdout == '0'
|
||||
|
|
Loading…
Add table
Reference in a new issue