forked from evolix/ansible-roles
admin-users: fix AllowUsers
* the command module was doing weird escaping, let's use the shell module * insert after a more appropriate position
This commit is contained in:
parent
adc3bd7a93
commit
6106a0a8f5
|
@ -64,7 +64,7 @@
|
|||
|
||||
# we must double-escape caracters, because python
|
||||
- name: verify AllowUsers directive
|
||||
command: "egrep '^\\s+AllowUsers' /etc/ssh/sshd_config"
|
||||
shell: "egrep '^AllowUsers' /etc/ssh/sshd_config"
|
||||
changed_when: False
|
||||
failed_when: False
|
||||
register: grep_allowusers_ssh
|
||||
|
@ -74,7 +74,7 @@
|
|||
lineinfile:
|
||||
dest: /etc/ssh/sshd_config
|
||||
line: "\nAllowUsers {{ user.name }}"
|
||||
insertafter: '^UsePAM'
|
||||
insertafter: '^# ForceCommand cvs server'
|
||||
validate: '/usr/sbin/sshd -T -f %s'
|
||||
notify: reload sshd
|
||||
when: grep_allowusers_ssh.rc != 0
|
||||
|
|
Loading…
Reference in a new issue