library/roles/mediawiki: Now it is possible to install more than one instance on a single server.

d4science-gcube: Install two mediawiki instances.
This commit is contained in:
Andrea Dell'Amico 2015-06-19 15:47:32 +02:00
parent bd10cfef79
commit 0f8143c8c7
2 changed files with 18 additions and 4 deletions

View File

@ -21,3 +21,4 @@ mw_php_prereq:
# This choice is not recommended. The package has a poor list of dependencies. We do not want to deal with those # This choice is not recommended. The package has a poor list of dependencies. We do not want to deal with those
mw_package: mw_package:
- mediawiki - mediawiki

View File

@ -18,13 +18,26 @@
tags: mediawiki tags: mediawiki
- name: Unpack the mediawiki tar file - name: Unpack the mediawiki tar file
unarchive: copy=no src={{ mw_download_dir }}/mediawiki-{{ mw_version }}.{{ mw_minor_minor }}.tar.gz dest={{ mw_install_dir }} unarchive: copy=no src={{ mw_download_dir }}/mediawiki-{{ mw_version }}.{{ mw_minor_minor }}.tar.gz dest={{ mw_download_dir }}
when: ( mw_download | changed ) when: ( mw_download | changed )
tags: mediawiki tags: mediawiki
- name: Rename the mediawiki directory - name: Move the mediawiki files to the right place
command: mv {{ mw_install_dir }}/mediawiki-{{ mw_version }}.{{ mw_minor_minor }} {{ mw_install_dir }}/mediawiki command: cp -a {{ mw_download_dir }}/mediawiki-{{ mw_version }}.{{ mw_minor_minor }} {{ mw_install_dir }}/{{ item.virthost }}
when: ( mw_download | changed ) args:
creates: '{{ mw_install_dir }}/{{ item.virthost }}/index.php'
with_items: phpfpm_pools
register: unpack_mediawiki
tags: mediawiki
- name: Set the correct ownership of the mediawiki files
file: dest={{ mw_install_dir }}/{{ item.virthost }} owner={{ item.user }} group={{ item.group }} recurse=yes state=directory
with_items: phpfpm_pools
tags: mediawiki
- name: Remove the original mediawiki unpacked distribution
command: rm -fr {{ mw_download_dir }}/mediawiki-{{ mw_version }}.{{ mw_minor_minor }}
when: ( unpack_mediawiki | changed )
tags: mediawiki tags: mediawiki
- name: Create the mediawiki conf dir - name: Create the mediawiki conf dir