From 18bb3f9c445d7c389477e3ee8c731ca1b77f8ade Mon Sep 17 00:00:00 2001 From: firesoft-de <34716031+firesoft-de@users.noreply.github.com> Date: Mon, 12 Apr 2021 12:30:52 +0200 Subject: [PATCH] Added condition to only configure fail2ban if it is installed --- tasks/fail2ban.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tasks/fail2ban.yml b/tasks/fail2ban.yml index 640b754..cdc03ab 100644 --- a/tasks/fail2ban.yml +++ b/tasks/fail2ban.yml @@ -8,6 +8,7 @@ group: root mode: 0444 notify: systemctl restart fail2ban + when: 'fail2ban' in ansible_facts.packages - name: Install fail2ban jail become: true @@ -18,3 +19,4 @@ group: root mode: 0444 notify: systemctl restart fail2ban + when: 'fail2ban' in ansible_facts.packages