Skip to content

Commit 56be8d5

Browse files
Merge pull request #213 from jLemmings/main
Add partition check for /usr/local
2 parents 457b145 + 361f9f5 commit 56be8d5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tasks/cis.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@
1313
comment: etcd user
1414
state: present
1515

16+
- name: Check if separate partition
17+
ansible.builtin.command: grep '/usr/local ' /proc/mounts
18+
changed_when: false
19+
register: partition_result
20+
1621
- name: Copy systemctl config file for kernel hardening
1722
ansible.builtin.copy:
18-
src: "{{ '/usr/local/share/rke2/rke2-cis-sysctl.conf' if usr_local.stat.writeable == True else '/opt/rke2/share/rke2/rke2-cis-sysctl.conf' }}"
23+
src: "{{ '/usr/local/share/rke2/rke2-cis-sysctl.conf' if (usr_local.stat.writeable) and (partition_result.rc == 1) else '/opt/rke2/share/rke2/rke2-cis-sysctl.conf' }}"
1924
dest: /etc/sysctl.d/60-rke2-cis.conf
2025
mode: 0600
2126
remote_src: true

0 commit comments

Comments
 (0)