From 8a9ec68b589612a7e236a180d68ece7632ab8ad0 Mon Sep 17 00:00:00 2001 From: Christian Iuga Date: Mon, 6 Nov 2023 15:09:14 +0100 Subject: [PATCH] remove old extensions (if any) Will fix issue #30 : Old extension are never cleaned --- tasks/config.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tasks/config.yml b/tasks/config.yml index 5b872e4..f6a0778 100644 --- a/tasks/config.yml +++ b/tasks/config.yml @@ -133,6 +133,21 @@ become: true when: guacamole_openid_auth +- name: config | list previous extensions version + ansible.builtin.find: + paths: "/etc/guacamole/extensions/" + excludes: '*{{ guacamole_version }}*' + file_type: file + register: guacamole_previous_extensions + +- name: config | Delete previous extensions version + ansible.builtin.file: + path: "{{ guacamole_extensions.path }}" + state: absent + loop: "{{ guacamole_previous_extensions.files }}" + loop_control: + loop_var: guacamole_extensions + - name: config | Creating Guacamole DB community.mysql.mysql_db: name: "{{ guacamole_mysql_db['name'] }}"