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