source: darkpeak-services/roles/mediawiki/tasks/main.yml @ eaf3af2b

ansiblekeycloakmatrixpleroma
Last change on this file since eaf3af2b was eaf3af2b, checked in by Mat Booth <mat.booth@…>, 3 years ago

apache: Provide a way to generate SAML2 metadata automatically

  • Property mode set to 100644
File size: 2.6 KB
Line 
1- name: Create data directory
2  file:
3    path: "{{ data_dir }}"
4    state: directory
5    owner: root
6    group: www-data
7    mode: 0751
8
9- name: Configure SAML2 authentication for Mediawiki
10  include: ../../apache2/tasks/configure-apache-saml.yml
11- name: Configure Apache for Mediawiki
12  include: ../../apache2/tasks/configure-apache-site.yml
13
14- name: Add mediawiki postgresql user
15  include: ../../community/geerlingguy.postgresql/tasks/users.yml
16
17- name: Add mediawiki postgresql database
18  include: ../../community/geerlingguy.postgresql/tasks/databases.yml
19
20- name: Install mediawiki and dependencies
21  apt:
22    name: "{{ item }}"
23    state: present
24    update_cache: yes
25    cache_valid_time: 10800   # 3 hours
26  with_items:
27    - imagemagick
28    - mediawiki
29    - php7.0-pgsql
30    - php7.0-ldap
31
32- name: Commission mediawiki
33  command: "php {{ install_path|quote }}/maintenance/install.php
34    --confpath={{ data_dir|quote }}
35    --dbtype={{ db.type|quote }}
36    --dbname={{ db.name|quote }}
37    --dbpass={{ db.password|quote }}
38    --dbuser={{ db.user|quote }}
39    --dbserver={{ db.server|quote }}
40    --lang={{ language|quote }}
41    --pass={{ admin_user.pass|quote }}
42    --scriptpath={{ relative_wiki_path|quote }}
43    {{ site_name|quote }}
44    {{ admin_user.name|quote }}"
45  args:
46    # NOTE: this file is ignored, we use our own LocalSettings.php
47    # in /etc/mediawiki instead. Check for the creation of our own
48    # file rather than the output of this command to prevent this
49    # running after initial commissioning, which makes mediawiki
50    # moan, which makes ansible error out.
51    creates: '/etc/mediawiki/LocalSettings.php'
52
53- name: Add our mediawiki config
54  template:
55    src: "LocalSettings.php.j2"
56    dest: "/etc/mediawiki/LocalSettings.php"
57    owner: root
58    group: www-data
59    mode: 0640
60
61- name: Copy darkpeak logo
62  copy:
63    src: "darkpeak.png"
64    dest: "/var/lib/mediawiki/resources/assets/darkpeak.png"
65
66- name: Install Auth_remoteuser extension
67  unarchive:
68    src: "Auth_remoteuser-REL1_27-380dbbe.tar.gz"
69    dest: "/var/lib/mediawiki/extensions/"
70  notify:
71    - "run update.php"
72
73- name: Add our custom login script
74  copy:
75    src: "login.php"
76    dest: "{{ data_dir }}/login.php"
77    owner: root
78    group: www-data
79    mode: 0640
80
81- name: Fix up file and directory permissions
82  file:
83    path: "{{ data_dir }}/{{ item.path }}"
84    owner: www-data
85    group: www-data
86    mode: "{{ item.mode }}"
87    state: "{{ item.state }}"
88  with_items:
89    # This breaks if {{ web_root }} changes between runs. Delete?
90    # - { path: "LocalSettings.php", mode: "0660", state: "file" }
91    - { path: "locks",             mode: "0700", state: "directory" }
Note: See TracBrowser for help on using the repository browser.