diff --git a/admin-users/tasks/adduser_debian.yml b/admin-users/tasks/adduser_debian.yml index 5c16f385..bcf24a0f 100644 --- a/admin-users/tasks/adduser_debian.yml +++ b/admin-users/tasks/adduser_debian.yml @@ -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