From ee187d6fde3c7c610f5958d07687d8b815762b8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian-Samuel=20Geb=C3=BChr?= Date: Mon, 5 Jun 2023 17:33:51 +0200 Subject: [PATCH] Add clean cache role --- .../tasks/clean_cache.yml | 4 ++++ .../matrix-bot-matrix-registration-bot/tasks/main.yml | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100644 roles/custom/matrix-bot-matrix-registration-bot/tasks/clean_cache.yml diff --git a/roles/custom/matrix-bot-matrix-registration-bot/tasks/clean_cache.yml b/roles/custom/matrix-bot-matrix-registration-bot/tasks/clean_cache.yml new file mode 100644 index 000000000..9dac72e14 --- /dev/null +++ b/roles/custom/matrix-bot-matrix-registration-bot/tasks/clean_cache.yml @@ -0,0 +1,4 @@ +--- + +- name: Delete cache files + ansible.builtin.shell: "rm -rf {{ matrix_bot_matrix_registration_bot_data_path }}/*" \ No newline at end of file diff --git a/roles/custom/matrix-bot-matrix-registration-bot/tasks/main.yml b/roles/custom/matrix-bot-matrix-registration-bot/tasks/main.yml index 83291fb6d..cd11c1d5d 100644 --- a/roles/custom/matrix-bot-matrix-registration-bot/tasks/main.yml +++ b/roles/custom/matrix-bot-matrix-registration-bot/tasks/main.yml @@ -18,3 +18,9 @@ block: - when: not matrix_bot_matrix_registration_bot_enabled | bool ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_uninstall.yml" + +- tags: + - bot-matrix-registration-bot-clean-cache + block: + - when: matrix_bot_matrix_registration_bot_enabled | bool + ansible.builtin.include_tasks: "{{ role_path }}/tasks/clean_cache.yml"