Skip to content

Commit 3f9c6f7

Browse files
committed
Fix CIS play skipping kolla user on non-Kolla hosts
Signed-off-by: Bartosz Bezak <bartosz@stackhpc.com>
1 parent 390f2d8 commit 3f9c6f7

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

etc/kayobe/ansible/maintenance/cis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,17 @@
2424
# This is to workaround an issue where we set the expiry to 365 days on kayobe
2525
# service accounts in a previous iteration of the CIS benchmark hardening
2626
# defaults. This should restore the defaults and can eventually be removed.
27+
vars:
28+
hosts_in_kolla_inventory: >-
29+
{{ kolla_overcloud_inventory_top_level_group_map.values() |
30+
map(attribute='groups') | flatten | unique | union(['seed']) | join(':') }}
2731
ansible.builtin.command: chage -m 0 -M 99999 -W 7 -I -1 {{ item }}
2832
become: true
2933
changed_when: false
3034
with_items:
3135
- "{{ kayobe_ansible_user }}"
3236
- "{{ kolla_ansible_user }}"
37+
when: item == kayobe_ansible_user or inventory_hostname in query('inventory_hostnames', hosts_in_kolla_inventory)
3338

3439
- name: Security hardening
3540
hosts: cis-hardening
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
fixes:
3+
- |
4+
CIS hardening playbook skips the kolla user on hosts not in the Kolla
5+
inventory (e.g. Ceph-only) to avoid errors.

0 commit comments

Comments
 (0)