From d4aea014d8ccd88e5a6a5e2fa642eb3883ed0abb Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Mon, 10 Feb 2020 10:38:01 +0500 Subject: [PATCH] Conditionally install iptables and certbot --- defaults/main.yml | 3 +++ tasks/main.yml | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 14601f2..6c96480 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,6 +1,9 @@ --- common__basics__additional_packages: [] +common__iptables__state: install + +common__certbot__state: install common__certbot__run: true common__certbot__email: 'user@example.com' common__certbot__cert_name: 'example.com' diff --git a/tasks/main.yml b/tasks/main.yml index d750416..0e00100 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,8 +2,14 @@ - include_tasks: basics.yml - include_tasks: usability.yml - include_tasks: ssh.yml +- meta: flush_handlers + - include_tasks: iptables.yml + when: common__iptables__state == 'install' +- meta: flush_handlers + - include_tasks: certbot.yml + when: common__certbot__state == 'install' - meta: flush_handlers - include_tasks: apache/purge.yml