Skip to content

Commit

Permalink
add local accounts to password list
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Sjögren <[email protected]>
  • Loading branch information
konstruktoid committed Jan 8, 2024
1 parent d2ed591 commit 9a0bcca
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tasks/password.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,12 @@
- cracklib
- pam

- name: Get local accounts
ansible.builtin.command:
cmd: awk -F':' '{print $1}' /etc/passwd
changed_when: false
register: local_accounts

- name: Add local information to password list
become: true
ansible.builtin.lineinfile:
Expand All @@ -270,6 +276,7 @@
loop:
- "{{ ansible_hostname | lower }}"
- "{{ ansible_os_family | lower }}"
- "{{ local_accounts.stdout | unique | trim }}"
tags:
- cracklib
- pam

0 comments on commit 9a0bcca

Please sign in to comment.