Skip to content

Commit

Permalink
fixes #646 - add another condition to getent task
Browse files Browse the repository at this point in the history
Signed-off-by: gbolo <[email protected]>
  • Loading branch information
gbolo committed Mar 6, 2023
1 parent 879ecef commit eab6f6d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion roles/os_hardening/tasks/user_accounts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
ansible.builtin.getent:
database: passwd
# creates a dict for each user containing UID/HOMEDIR etc...
when: getent_passwd is undefined # skip this task if "getent" has run before
# skip this task if getent was run before without specifying a key (single entry)
when: getent_passwd is undefined or
getent_passwd | length <= 1

- name: Read local linux shadow database
ansible.builtin.getent:
Expand Down

0 comments on commit eab6f6d

Please sign in to comment.