From 370ab6161b06ae3cc37bbdc351573ddbdfa3ab33 Mon Sep 17 00:00:00 2001 From: Thilo Solbrig Date: Mon, 14 Oct 2024 17:04:02 +0200 Subject: [PATCH] Force bool type for conditionals --- changelogs/fragments/motd.yml | 4 ++++ roles/common/tasks/RedHat.yml | 8 ++++---- roles/common/tasks/Suse.yml | 2 +- roles/common/tasks/main.yml | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 changelogs/fragments/motd.yml diff --git a/changelogs/fragments/motd.yml b/changelogs/fragments/motd.yml new file mode 100644 index 000000000..ac7677314 --- /dev/null +++ b/changelogs/fragments/motd.yml @@ -0,0 +1,4 @@ +--- +bugfixes: + - "common: Exclude alias interfaces when templating motd.j2 (oravirt#486)" + - "common: force bool type in certain conditionals" diff --git a/roles/common/tasks/RedHat.yml b/roles/common/tasks/RedHat.yml index a9ba1afd0..3dc24125d 100644 --- a/roles/common/tasks/RedHat.yml +++ b/roles/common/tasks/RedHat.yml @@ -1,7 +1,7 @@ --- - name: Install EPEL Repo when: - - configure_epel_repo + - configure_epel_repo | bool tags: - epelrepo block: @@ -22,7 +22,7 @@ path: /usr/bin/ol_yum_configure.sh register: olyumconfigfile when: - - configure_public_yum_repo + - configure_public_yum_repo | bool - ansible_distribution == 'OracleLinux' tags: - olrepo @@ -36,7 +36,7 @@ mode: 0644 when: - not olyumconfigfile.stat.exists | default(false) - - configure_public_yum_repo + - configure_public_yum_repo | bool - ansible_distribution == 'OracleLinux' - ansible_distribution_major_version is version('7', '=') tags: @@ -47,7 +47,7 @@ name: "{{ common_packages }}" state: installed when: - - install_os_packages + - install_os_packages | bool tags: - commonpackages notify: Reboot concerning package updates diff --git a/roles/common/tasks/Suse.yml b/roles/common/tasks/Suse.yml index b0ae0b502..587af0702 100644 --- a/roles/common/tasks/Suse.yml +++ b/roles/common/tasks/Suse.yml @@ -4,7 +4,7 @@ name: "{{ common_packages_sles }}" state: installed when: - - install_os_packages + - install_os_packages | bool tags: - commonpackages notify: Reboot concerning package updates diff --git a/roles/common/tasks/main.yml b/roles/common/tasks/main.yml index 9ab687c59..ef41856ac 100644 --- a/roles/common/tasks/main.yml +++ b/roles/common/tasks/main.yml @@ -13,7 +13,7 @@ name: "{{ ntp_type }}d" state: started enabled: true - when: configure_ntp + when: configure_ntp | bool - name: Add motd ansible.builtin.template: @@ -21,4 +21,4 @@ dest: /etc/motd mode: 0644 tags: motd - when: configure_motd + when: configure_motd | bool