From a97db40e7363caef7ff253866fe201583b3f0be6 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Wed, 9 Feb 2022 11:37:37 +0000 Subject: [PATCH] Check for firewalld --- roles/fedora/tasks/ssh.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/roles/fedora/tasks/ssh.yml b/roles/fedora/tasks/ssh.yml index 5059737..078019c 100644 --- a/roles/fedora/tasks/ssh.yml +++ b/roles/fedora/tasks/ssh.yml @@ -32,6 +32,10 @@ name: sshd.service state: restarted when: changed_ssh_config.changed == true +- name: Check for firewalld + ansible.builtin.stat: + path: /usr/sbin/firewalld + register: firewalld - name: Allow SSH through firewall become: true ansible.posix.firewalld: @@ -39,3 +43,4 @@ permanent: yes state: enabled immediate: yes + when: firewalld.stat.exists