File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 22- name : Get user accounts | DTAG SEC Req 3.21-4
33 command : " awk -F: '{print $1}' /etc/passwd"
44 changed_when : False
5- always_run : True
5+ check_mode : no
66 register : users
77
88- name : delete rhosts-files from system | DTAG SEC Req 3.21-4
99 file : dest='~{{ item }}/.rhosts' state=absent
10- with_items : ' {{ users.stdout_lines }}'
10+ with_items : ' {{ users.stdout_lines | default(omit) }}'
1111
1212- name : delete hosts.equiv from system | DTAG SEC Req 3.21-4
1313 file : dest='/etc/hosts.equiv' state=absent
Original file line number Diff line number Diff line change 33- name : get UID_MIN from login.defs
44 shell : awk '/^\s*UID_MIN\s*([0-9]*).*?$/ {print $2}' /etc/login.defs removes=/etc/login.defs
55 register : uid_min
6- always_run : True
6+ check_mode : no
77 changed_when : False
88
99- name : calculate UID_MAX from UID_MIN by substracting 1
1919 when : not uid_min
2020
2121- name : get all system accounts
22- command : awk -F'':'' '{ if ( $3 <= {{uid_max|quote}} ) print $1}' /etc/passwd removes=/etc/passwd
22+ command : awk -F'':'' '{ if ( $3 <= {{uid_max|quote}} ) print $1}' /etc/passwd removes=/etc/passwd
2323 changed_when : False
24- always_run : True
24+ check_mode : no
2525 register : sys_accs
2626
27- - name : remove always ignored system accounts from list
27+ - name : remove always ignored system accounts from list
2828 set_fact :
2929 sys_accs_cond : ' {{sys_accs.stdout_lines | difference(os_always_ignore_users) }}'
30+ check_mode : no
3031
3132- name : change system accounts not on the user provided ignore-list
32- user : name='{{ item }}' shell='{{os_nologin_shell_path}}' password='*'
33+ user : name='{{item}}' shell='{{os_nologin_shell_path}}' password='*'
3334 with_items :
34- - ' {{sys_accs_cond | difference(os_ignore_users) }}'
35+ - ' {{sys_accs_cond | default(omit) | difference(os_ignore_users) }}'
You can’t perform that action at this time.
0 commit comments