From d7e6fd84459703e7d0ebd236a64e84434c33ac4d Mon Sep 17 00:00:00 2001 From: Niclas Thobaben Date: Mon, 27 Dec 2021 21:47:11 +0100 Subject: [PATCH] added 06-cleanup.yml --- tasks/06-cleanup.yml | 11 +++++++++++ tasks/main.yml | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 tasks/06-cleanup.yml diff --git a/tasks/06-cleanup.yml b/tasks/06-cleanup.yml new file mode 100644 index 0000000..8706ad8 --- /dev/null +++ b/tasks/06-cleanup.yml @@ -0,0 +1,11 @@ +# Cleanup backed up files if all tests finished sucessfully + +- name: Delete /etc/named.conf.local.bak + become: true + file: + path: /etc/bind/named.conf.local.bak + state: absent + +- name: Delete all backed up zone files + become: true + shell: "rm {{bind9_zone_dir}}/*.bak" \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml index dd74f5d..92c16dc 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -11,6 +11,8 @@ loop_control: loop_var: zone + - import_tasks: 06-cleanup.yml + rescue: - import_tasks: 05-rollback.yml when: not bind9_initial_setup