Skip to content

Commit 70a54ee

Browse files
k8s-ci-robotsl1pm4t
authored andcommitted
Merge pull request #1843 from drew-viles/bool-fix
fix: adding defaults and type check to some bool checks and making a few 'and' statements into lists
1 parent 2cf6617 commit 70a54ee

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

images/capi/ansible/roles/node/tasks/main.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,12 @@
8989

9090
- name: Configure auditd rules for containerd
9191
ansible.builtin.copy:
92-
src: etc/audit/rules.d/containerd.rules
92+
src: "etc/audit/rules.d/containerd.rules{{ '-flatcar' if ansible_os_family == 'Flatcar' else '' }}"
9393
dest: /etc/audit/rules.d/containerd.rules
9494
owner: root
9595
group: root
9696
mode: "0644"
97-
when: ansible_os_family != "Flatcar" and enable_containerd_audit
98-
99-
- name: Configure auditd rules for containerd (Flatcar)
100-
ansible.builtin.copy:
101-
src: etc/audit/rules.d/containerd.rules-flatcar
102-
dest: /etc/audit/rules.d/containerd.rules
103-
owner: root
104-
group: root
105-
mode: "0644"
106-
when: ansible_os_family == "Flatcar" and enable_containerd_audit
97+
when: enable_containerd_audit|default(false)|bool
10798

10899
- name: Ensure reverse packet filtering is set as strict
109100
ansible.posix.sysctl:

images/capi/ansible/roles/sysprep/tasks/debian.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
path: /etc/apt/sources.list.d/{{ item | basename }}
3131
state: absent
3232
loop: "{{ extra_repos.split() }}"
33-
when: remove_extra_repos and extra_repos != ""
33+
when:
34+
- remove_extra_repos|default(false)|bool
35+
- extra_repos != ""
3436

3537
- name: Find disabled repo files
3638
ansible.builtin.find:

images/capi/ansible/roles/sysprep/tasks/main.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
ansible.builtin.file:
3838
path: /etc/pip.conf
3939
state: absent
40-
when: remove_extra_repos and pip_conf_file != ""
40+
when:
41+
- remove_extra_repos|default(false)|bool
42+
- pip_conf_file != ""
4143

4244
- name: Truncate machine id
4345
ansible.builtin.file:

images/capi/ansible/roles/sysprep/tasks/rpm_repos.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
path: /etc/yum.repos.d/{{ item | basename }}
1818
state: absent
1919
loop: "{{ extra_repos.split() }}"
20-
when: remove_extra_repos and extra_repos != ""
20+
when:
21+
- remove_extra_repos|default(false)|bool
22+
- extra_repos != ""
2123

2224
- name: Find disabled repo files
2325
ansible.builtin.find:

0 commit comments

Comments
 (0)