forked from evolix/ansible-roles
admin-users: better grep for AllowUsers detection
Now it behaves correctly if the directive exists, but commented
This commit is contained in:
parent
030425d9f8
commit
987e35f104
|
@ -63,13 +63,12 @@
|
|||
state: present
|
||||
|
||||
- name: verify AllowUsers directive
|
||||
command: "grep AllowUsers /etc/ssh/sshd_config"
|
||||
command: "egrep '^\s+AllowUsers' /etc/ssh/sshd_config"
|
||||
changed_when: False
|
||||
failed_when: False
|
||||
register: grep_allowusers_ssh
|
||||
check_mode: no
|
||||
|
||||
|
||||
- name: "Add AllowUsers sshd directive for '{{ user.name }}'"
|
||||
lineinfile:
|
||||
dest: /etc/ssh/sshd_config
|
||||
|
|
Loading…
Reference in a new issue