Changeset 3e818144 in darkpeak-services


Ignore:
Timestamp:
Jun 9, 2018, 1:31:39 PM (20 months ago)
Author:
Caolan McMahon <caolan.mcmahon@…>
Branches:
ansible, keycloak, master, matrix, pleroma
Children:
c9f3ebd0
Parents:
77859d44
Message:

Convert mediawiki from postgres to sqlite

The production wiki is using sqlite, so this should make importing the
production data easier.

Location:
roles/mediawiki
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • roles/mediawiki/defaults/main.yml

    r77859d44 r3e818144  
    55
    66php_open_basedir: "{{ web_root }}:/usr/share/mediawiki:/etc/mediawiki:/usr/share/php:/tmp"
    7 
    8 postgresql_users:
    9   - name: "{{ service_name }}"
    10     password: correcthorsebatterystaple
    11     role_attr_flags: CREATEDB,NOSUPERUSER
    12 
    13 postgresql_databases:
    14   - name: "{{ service_name }}"
    15     owner: "{{ postgresql_users[0].name }}"
    16     lc_collate: en_GB.UTF-8
    17     lc_ctype: en_GB.UTF-8
    187
    198site_name: "Dark Peak"
     
    2413language: en-gb
    2514db:
    26   user: "{{ postgresql_users[0].name }}"
    27   password: "{{ postgresql_users[0].password }}"
    28   name: "{{ postgresql_databases[0].name }}"
    29   type: postgres
    30   server: "localhost"
     15  data_dir: "/srv/{{ service_name }}"
     16  type: sqlite
    3117admin_user:
    3218  name: DarkPeaker
  • roles/mediawiki/tasks/main.yml

    r77859d44 r3e818144  
    55    owner: root
    66    group: www-data
    7     mode: 0751
     7    mode: 0750
     8
     9- name: Create directory to hold sqlite database
     10  file:
     11    path: "{{ db.data_dir }}"
     12    state: directory
     13    owner: www-data
     14    group: www-data
     15    mode: 0750
    816
    917- name: Configure SAML2 authentication for Mediawiki
     
    1119- name: Configure Apache for Mediawiki
    1220  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
    1921
    2022- name: Install mediawiki and dependencies
     
    2729    - imagemagick
    2830    - mediawiki
    29     - php7.0-pgsql
     31    - php7.0-sqlite3
    3032    - php7.0-ldap
    3133
    3234- name: Commission mediawiki
     35  become_user: www-data
    3336  command: "php {{ install_path|quote }}/maintenance/install.php
    3437    --confpath={{ data_dir|quote }}
    3538    --dbtype={{ db.type|quote }}
    36     --dbname={{ db.name|quote }}
    37     --dbpass={{ db.password|quote }}
    38     --dbuser={{ db.user|quote }}
    39     --dbserver={{ db.server|quote }}
     39    --dbpath={{ db.data_dir|quote }}
    4040    --lang={{ language|quote }}
    4141    --pass={{ admin_user.pass|quote }}
  • roles/mediawiki/templates/LocalSettings.php.j2

    r77859d44 r3e818144  
    5151## Database settings
    5252$wgDBtype = "{{ db.type }}";
    53 $wgDBserver = "{{ db.server }}";
    54 $wgDBname = "{{ db.name }}";
    55 $wgDBuser = "{{ db.user }}";
    56 $wgDBpassword = "{{ db.password }}";
     53$wgSQLiteDataDir = "{{ db.data_dir }}";
    5754
    5855## Shared memory settings
Note: See TracChangeset for help on using the changeset viewer.