From 79e5a81c2a773dbf300d1f508359be6cdab82804 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 21 Dec 2018 17:17:37 +0100 Subject: [PATCH] joomla: Manage the installation of multiple instances on the same host. --- joomla-org/defaults/main.yml | 4 ++-- joomla-org/tasks/main.yml | 25 +++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/joomla-org/defaults/main.yml b/joomla-org/defaults/main.yml index 713076cc..ad6d5bf5 100644 --- a/joomla-org/defaults/main.yml +++ b/joomla-org/defaults/main.yml @@ -1,8 +1,8 @@ --- joomla_dist_name: Joomla joomla_major: 3 -joomla_minor: 8 -joomla_fix: 5 +joomla_minor: 9 +joomla_fix: 1 joomla_dist_version: '{{ joomla_major }}.{{ joomla_minor }}.{{ joomla_fix }}' joomla_dist_file: '{{ joomla_dist_name }}_{{ joomla_dist_version }}-Stable-Full_Package.zip' joomla_download_version: '{{ joomla_major }}-{{ joomla_minor }}-{{ joomla_fix }}' diff --git a/joomla-org/tasks/main.yml b/joomla-org/tasks/main.yml index adbec9b5..58540cc9 100644 --- a/joomla-org/tasks/main.yml +++ b/joomla-org/tasks/main.yml @@ -33,13 +33,34 @@ args: creates: '{{ joomla_install_dir }}/index.php' with_items: '{{ phpfpm_pools }}' - when: joomla_download is changed + when: + - joomla_download is changed + - item.joomla_install_dir is not defined register: unpack_joomla - name: Set the correct ownership of the joomla files file: dest={{ joomla_install_dir }} owner={{ item.user }} group={{ item.group }} recurse=yes state=directory with_items: '{{ phpfpm_pools }}' - when: unpack_joomla is changed + when: + - unpack_joomla is changed + - item.joomla_install_dir is not defined + + - name: Move the joomla files to the right place, multiple instances + shell: cp -a {{ joomla_download_dir }}/joomla-unpacked/* {{ item.joomla_install_dir }}/ + args: + creates: '{{ item.joomla_install_dir }}/index.php' + with_items: '{{ phpfpm_pools }}' + when: + - joomla_download is changed + - item.joomla_install_dir is defined + register: unpack_joomla + + - name: Set the correct ownership of the joomla files + file: dest={{ item.joomla_install_dir }} owner={{ item.user }} group={{ item.group }} recurse=yes state=directory + with_items: '{{ phpfpm_pools }}' + when: + - unpack_joomla is changed + - item.joomla_install_dir is defined - name: Remove the original joomla unpacked distribution command: rm -fr {{ joomla_download_dir }}/{{ joomla_dist_name }}