From 5e57eb386246b67eb86c91493376144643bde1c9 Mon Sep 17 00:00:00 2001 From: Joshua Hemmings Date: Wed, 27 Nov 2024 16:32:59 +0100 Subject: [PATCH] Fix not writeable case --- tasks/cis.yml | 2 +- tasks/rke2.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/cis.yml b/tasks/cis.yml index 8dbc591..13c210a 100644 --- a/tasks/cis.yml +++ b/tasks/cis.yml @@ -14,7 +14,7 @@ - name: Copy systemctl config file for kernel hardening ansible.builtin.copy: - src: "{{ '/usr/local/share/rke2/rke2-cis-sysctl.conf' if (usr_local.stat.writeable) or (partition_result.rc == 1) else '/opt/rke2/share/rke2/rke2-cis-sysctl.conf' }}" + src: "{{ '/usr/local/share/rke2/rke2-cis-sysctl.conf' if (not usr_local.stat.writeable) or (partition_result.rc == 1) else '/opt/rke2/share/rke2/rke2-cis-sysctl.conf' }}" dest: /etc/sysctl.d/60-rke2-cis.conf mode: 0600 remote_src: true diff --git a/tasks/rke2.yml b/tasks/rke2.yml index 1ea197f..5ce0c93 100644 --- a/tasks/rke2.yml +++ b/tasks/rke2.yml @@ -165,7 +165,7 @@ - name: Set RKE2 bin path ansible.builtin.set_fact: - rke2_bin_path: "{{ '/usr/local/bin/rke2' if (usr_local.stat.writeable) or (partition_result.rc == 1) else '/opt/rke2/bin/rke2' }}" + rke2_bin_path: "{{ '/usr/local/bin/rke2' if (not usr_local.stat.writeable) or (partition_result.rc == 1) else '/opt/rke2/bin/rke2' }}" - name: Check RKE2 version ansible.builtin.shell: |