File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
etc/kayobe/ansible/maintenance Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 2020 state : present
2121 when : ansible_facts.distribution == 'Ubuntu'
2222
23+ - name : Gather passwd entries
24+ ansible.builtin.getent :
25+ database : passwd
26+ become : true
27+
2328 - name : Ensure service accounts have no expiry options set
2429 # This is to workaround an issue where we set the expiry to 365 days on kayobe
2530 # service accounts in a previous iteration of the CIS benchmark hardening
2631 # defaults. This should restore the defaults and can eventually be removed.
27- ansible.builtin.command : chage -m 0 -M 99999 -W 7 -I -1 {{ item }}
32+ ansible.builtin.user :
33+ name : " {{ item }}"
34+ password_expire_min : 0
35+ password_expire_max : 99999
36+ password_expire_warn : 7
37+ expires : -1
2838 become : true
29- changed_when : false
30- with_items :
39+ loop :
3140 - " {{ kayobe_ansible_user }}"
3241 - " {{ kolla_ansible_user }}"
42+ when : item in ansible_facts.getent_passwd
3343
3444- name : Security hardening
3545 hosts : cis-hardening
Original file line number Diff line number Diff line change 1+ ---
2+ fixes :
3+ - |
4+ CIS hardening playbook skips service accounts that do not exist on the host
5+ (e.g. kolla on non-Kolla/Ceph-only nodes) to avoid errors.
You can’t perform that action at this time.
0 commit comments