This repository has been archived on 2023-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
homeserver-ansible/roles/services/wiki/tasks/main.yml

109 lines
2.5 KiB
YAML
Raw Permalink Normal View History

2022-02-27 16:05:34 -05:00
- name: Install wiki packages
community.general.pacman:
name:
- mediawiki
- php-fpm
- php-intl
- php-sqlite
- imagemagick
state: present
- name: Set wiki root
set_fact:
wiki_root: "{{ webroot }}/{{ server_blocks.wiki.domain }}{{ nginx_services.wiki.path }}"
- name: Create wiki web root
file:
path: "{{ wiki_root }}"
state: directory
- name: Symlink wikis into wiki web root
2022-02-27 16:05:34 -05:00
file:
src: /usr/share/webapps/mediawiki
dest: "{{ wiki_root }}/{{ item }}"
2022-02-27 16:05:34 -05:00
state: link
with_items: "{{ wiki_names }}"
- name: Deploy wiki-farm main configuration file
template:
2022-03-01 17:43:44 -05:00
src: LocalSettings.php.j2
dest: "{{ wiki_root }}/{{ wiki_names[0] }}/LocalSettings.php"
2022-05-10 22:11:16 -04:00
mode: u=rwx,g=r,o=r
2022-02-27 16:05:34 -05:00
- name: Deploy configuration files for individual wikis
template:
2022-03-01 17:43:44 -05:00
src: "LocalSettings_{{ item.1 }}.php.j2"
dest: "{{ wiki_root }}/{{ wiki_names[0] }}/LocalSettings_{{ item.1 }}.php"
2022-02-27 16:05:34 -05:00
with_indexed_items: "{{ wiki_names }}"
2022-05-10 22:11:16 -04:00
- name: Ensure correct permissions on data
file:
path: "{{ dataroot }}/mediawiki/"
group: http
owner: http
2022-02-27 16:05:34 -05:00
- name: Copy wiki logo files
copy:
src: "{{ item }}"
dest: "{{ wiki_root }}/{{ wiki_names[0] }}/resources/assets/"
2022-02-27 16:05:34 -05:00
with_fileglob:
2022-03-01 17:43:44 -05:00
- logos/*.png
2022-02-27 16:05:34 -05:00
- name: Enable iconv extension
lineinfile:
dest: /etc/php/php.ini
regexp: "^;extension=iconv"
line: "extension=iconv"
register: php_config
- name: Enable intl extension
lineinfile:
dest: /etc/php/php.ini
regexp: "^;extension=intl"
line: "extension=intl"
register: php_config
- name: Enable sqlite3 extension
lineinfile:
dest: /etc/php/php.ini
regexp: "^;extension=sqlite3"
line: "extension=sqlite3"
register: php_config
- name: Enable pd_sqlite extension
lineinfile:
dest: /etc/php/php.ini
regexp: "^;extension=pdo_sqlite"
line: "extension=pdo_sqlite"
register: php_config
- name: Create systemd override dir
file:
path: /etc/systemd/system/php-fpm.service.d/
state: directory
owner: root
group: root
mode: 0755
- name: Deploy systemd override conf
template:
src: php-fpm.service.j2
dest: /etc/systemd/system/php-fpm.service.d/override.conf
owner: root
group: root
mode: 0644
2022-02-27 16:05:34 -05:00
register: php_config
- name: Enable php service
service:
name: php-fpm
enabled: yes
state: restarted
when: php_config.changed
2022-03-12 15:12:07 -05:00
- name: Deploy wiki-farm update maintenance script
template:
src: wiki_update.sh.j2
dest: "/home/{{ ansible_user }}/.local/bin/wiki_update.sh"