ansible-roles/library/roles/mediawiki/tasks/main.yml

38 lines
1.2 KiB
YAML

---
- name: Ensure that the download and install dirs exist
file: path={{ item }} state=directory
with_items:
- '{{ mw_download_dir }}'
- '{{ mw_install_dir }}'
tags: mediawiki
- name: Download the mediawiki tar file
get_url: url={{ mw_download_url }} dest={{ mw_download_dir }}
when:
- not mw_install_from_package
- mw_install_from_tar
tags: mediawiki
- name: Unpack the mediawiki tar file
unarchive: copy=no src={{ mw_download_dir }}/mediawiki-{{ mw_version }}.{{ mw_minor_minor }}.tar.gz dest={{ mw_download_dir }}
args:
creates: '{{ mw_download_dir }}/mediawiki-{{ mw_version }}.{{ mw_minor_minor }}/INSTALL'
when: mw_install_from_tar
tags: mediawiki
- name: Move the mediawiki files to the right place
command: cp -a {{ mw_download_dir }}/mediawiki-{{ mw_version }}.{{ mw_minor_minor }} {{ mw_doc_root }}
args:
creates: '{{ mw_doc_root }}/index.php'
when: mw_install_from_tar
tags: mediawiki
- name: Set the correct ownership of the mediawiki files
file: dest={{ mw_doc_root }} owner={{ item.user }} group={{ item.group }} recurse=yes state=directory
with_items: '{{ phpfpm_pools }}'
tags: mediawiki
- name: Create the mediawiki conf dir
file: path={{ mw_conf_dir }} state=directory
tags: mediawiki