Skip to content

Adding option to force refresh of getent_passwd #858

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions roles/os_hardening/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -499,3 +499,7 @@
# keep .netrc file for users in whitelist
os_netrc_enabled: true
os_netrc_whitelist_user: []

# Set to True to force the refresh of user facts
# Usefull if you are calling this role in a workflow and you need {{ getent_passwd }} to be updated

Check failure on line 504 in roles/os_hardening/defaults/main.yml

View workflow job for this annotation

GitHub Actions / codespell / codespell

Usefull ==> Useful
os_getent_passwd_force_sync: False

Check failure on line 505 in roles/os_hardening/defaults/main.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

Truthy value should be one of [false, true]
3 changes: 2 additions & 1 deletion roles/os_hardening/tasks/user_accounts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# creates a dict for each user containing UID/HOMEDIR etc...
# skip this task if getent was run before without specifying a key (single entry)
when: getent_passwd is undefined or
getent_passwd | length <= 1
getent_passwd | length <= 1 or
os_getent_passwd_force_sync

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