From c6571386d258f01e1165fdf8f41a9d2c937073c3 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 2 Mar 2021 18:00:12 +0100 Subject: [PATCH] Update to 2021-03-02 18:00 --- roles/glpi/defaults/main.yml | 1 + roles/glpi/tasks/install.yml | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/roles/glpi/defaults/main.yml b/roles/glpi/defaults/main.yml index 998955d..3118bb3 100644 --- a/roles/glpi/defaults/main.yml +++ b/roles/glpi/defaults/main.yml @@ -82,6 +82,7 @@ glpi_plugins: version: 1.0.2 sha1: c98a504f18c9914b57deda0340c19dbfad08440f url: https://forge.glpi-project.org/attachments/download/2323/glpi-dashboard-1.0.2.zip + rename_from: glpi-dashboard-1.0.2 glpi_plugins_to_install: [] diff --git a/roles/glpi/tasks/install.yml b/roles/glpi/tasks/install.yml index f7f9c5e..b87b67b 100644 --- a/roles/glpi/tasks/install.yml +++ b/roles/glpi/tasks/install.yml @@ -76,6 +76,17 @@ with_items: "{{ glpi_plugins_to_install }}" tags: glpi +# Some plugins have the directory name not matching the plugin name +# Eg, glpi-dashboard-1.0.2 instead of GLPI. So it's removed as if it was an unmanaged plugin +# If the prop name_from is defined for the plugin, rename the dir +- name: Rename plugin dir + command: mv {{ glpi_root_dir }}/web/plugins/{{ glpi_plugins[item].rename_from }} {{ glpi_root_dir }}/web/plugins/{{ item }} + args: + creates: "{{ glpi_root_dir }}/web/plugins/{{ item }}" + when: glpi_plugins[item].rename_from is defined + loop: "{{ glpi_plugins_to_install }}" + tags: glpi + - name: Build a list of installed plugins shell: find {{ glpi_root_dir }}/web/plugins -maxdepth 1 -mindepth 1 -type d -exec basename "{}" \; register: glpi_installed_plugins