From d1b27304f3a41a888fbce031ddab59ba7102f882 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Sat, 2 Nov 2019 17:25:46 +0100 Subject: [PATCH] Fix some boolean conditionals. --- library/centos/roles/firewalld/tasks/disable_firewalld.yml | 2 +- library/centos/roles/firewalld/tasks/firewalld_rules.yml | 2 +- library/centos/roles/firewalld/tasks/main.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/library/centos/roles/firewalld/tasks/disable_firewalld.yml b/library/centos/roles/firewalld/tasks/disable_firewalld.yml index d0f507c..24b4d9e 100644 --- a/library/centos/roles/firewalld/tasks/disable_firewalld.yml +++ b/library/centos/roles/firewalld/tasks/disable_firewalld.yml @@ -1,5 +1,5 @@ --- - name: Ensure that the firewalld service is stopped and disabled if we do not want it service: name=firewalld state=stopped enabled=no - when: not firewalld_enabled + when: not firewalld_enabled | bool tags: [ 'iptables', 'firewall', 'firewalld' ] diff --git a/library/centos/roles/firewalld/tasks/firewalld_rules.yml b/library/centos/roles/firewalld/tasks/firewalld_rules.yml index 6e0ba7d..b8c7b1c 100644 --- a/library/centos/roles/firewalld/tasks/firewalld_rules.yml +++ b/library/centos/roles/firewalld/tasks/firewalld_rules.yml @@ -6,7 +6,7 @@ - name: Open the ssh service to the world. We rely on fail2ban to stop unauthorized accesses firewalld: service=ssh zone={{ firewalld_default_zone }} permanent=True state=enabled immediate=True - when: firewalld_ssh_enabled_on_default_zone + when: firewalld_ssh_enabled_on_default_zone | bool - name: Set the firewalld default zone. command: firewall-cmd --set-default-zone={{ firewalld_default_zone }} diff --git a/library/centos/roles/firewalld/tasks/main.yml b/library/centos/roles/firewalld/tasks/main.yml index 5630ce9..9bef238 100644 --- a/library/centos/roles/firewalld/tasks/main.yml +++ b/library/centos/roles/firewalld/tasks/main.yml @@ -1,7 +1,7 @@ --- - import_tasks: firewalld_rules.yml - when: firewalld_enabled + when: firewalld_enabled | bool - import_tasks: disable_firewalld.yml - when: not firewalld_enabled + when: not firewalld_enabled | bool