From 75aad3e5d7724df0b0c837c0cc5fff92d1313277 Mon Sep 17 00:00:00 2001 From: Patrick Marchand Date: Wed, 7 Aug 2019 12:15:57 -0400 Subject: [PATCH] Fixed regression in evolinux-users ssh tasks We need to register that the match user and allow user is now present after adding the first user. --- evolinux-users/tasks/ssh_allowusers.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/evolinux-users/tasks/ssh_allowusers.yml b/evolinux-users/tasks/ssh_allowusers.yml index dc9338dc..19b7d03e 100644 --- a/evolinux-users/tasks/ssh_allowusers.yml +++ b/evolinux-users/tasks/ssh_allowusers.yml @@ -7,7 +7,8 @@ insertafter: 'Subsystem' validate: '/usr/sbin/sshd -t -f %s' notify: reload sshd - when: not allow_users_present + when: not allow_users_present or not added_allow_user.changed + register: added_allow_user - name: "Append '{{ user.name }}' to AllowUsers sshd directive" replace: @@ -16,7 +17,7 @@ replace: '\1 {{ user.name }}' validate: '/usr/sbin/sshd -t -f %s' notify: reload sshd - when: allow_users_present + when: allow_users_present or added_allow_user.changed - name: "Add Match User sshd directive with '{{ user.name }}'" lineinfile: @@ -25,7 +26,8 @@ insertafter: "# END EVOLINUX PASSWORD RESTRICTIONS BY ADDRESS" validate: '/usr/sbin/sshd -t -f %s' notify: reload sshd - when: not allow_users_present + when: not match_users_present or not added_match_user.changed + register: added_match_user - name: "Append '{{ user.name }}' to Match User's sshd directive" replace: @@ -34,4 +36,4 @@ replace: '\1,{{ user.name }}' validate: '/usr/sbin/sshd -t -f %s' notify: reload sshd - when: match_users_present + when: match_users_present or added_match_user.changed