diff --git a/tasks/apache/purge.yml b/tasks/apache/purge.yml new file mode 100644 index 0000000..e3e7a1c --- /dev/null +++ b/tasks/apache/purge.yml @@ -0,0 +1,11 @@ +--- +- name: Purge Apache + apt: + name: apache2 + state: absent + purge: true + +- name: Delete Apache configuration + file: + state: absent + path: '{{ common__apache__conf_dir }}' diff --git a/tasks/main.yml b/tasks/main.yml index b92e592..c9997b3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -5,6 +5,8 @@ - include_tasks: iptables.yml - include_tasks: certbot.yml +- include_tasks: apache/purge.yml + when: common__apache__state == 'purge' - include_tasks: apache/install.yml when: common__apache__state == 'install' - meta: flush_handlers