Changeset ea9b2b78 in darkpeak-services


Ignore:
Timestamp:
Dec 11, 2017, 9:54:20 AM (3 years ago)
Author:
Caolan McMahon <caolan.mcmahon@…>
Branches:
ansible, keycloak, master, matrix, pleroma
Children:
913fe7a7
Parents:
c933908e
git-author:
Caolan McMahon <caolan.mcmahon@…> (12/11/17 09:53:54)
git-committer:
Caolan McMahon <caolan.mcmahon@…> (12/11/17 09:54:20)
Message:

Switch to PostgreSQL for mediawiki and fix LDAP login

Files:
1 added
3 edited

Legend:

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

    rc933908e rea9b2b78  
    99    - nginx
    1010    - php-fpm
    11     - php-sqlite3
     11    - php7.0-pgsql
     12    - php7.0-ldap
    1213
    1314- name: Add nginx site config
     
    3738    mode: 0770
    3839
     40- name: Install python psycopg2 module (for postgresql_user step)
     41  apt:
     42    name: python-psycopg2
     43
     44- name: Install postgresql
     45  apt:
     46    name: postgresql
     47
     48- name: Start and enable postgresql
     49  service: name=postgresql state=started enabled=yes
     50
     51- name: Add postgresql user
     52  become_user: postgres
     53  postgresql_user:
     54    name: "{{ db.user }}"
     55    password: "{{ db.password }}"
     56
     57- name: Add postgresql database
     58  become_user: postgres
     59  postgresql_db:
     60    name: "{{ db.name }}"
     61    owner: "{{ db.user }}"
     62
    3963- name: Install medawiki
    4064  apt:
     
    5377  command: "php {{ install_path|quote }}/maintenance/install.php
    5478    --confpath={{ data_dir|quote }}
     79    --dbtype={{ db.type|quote }}
    5580    --dbname={{ db.name|quote }}
    56     --dbpath={{ data_dir|quote }}
    57     --dbtype={{ db.type|quote }}
     81    --dbpass={{ db.password|quote }}
     82    --dbuser={{ db.user|quote }}
     83    --dbserver={{ db.server|quote }}
    5884    --lang={{ language|quote }}
    5985    --pass={{ admin_user.pass|quote }}
     
    84110#     dest: "/var/lib/mediawiki/skins/"
    85111
    86 - name: Install dependencies for LdapAuthentication extension
    87   apt:
    88     name: php7.0-ldap
     112# - name: Install dependencies for LdapAuthentication extension
     113#   apt:
     114#     name: php7.0-ldap
    89115
    90116- name: Turn off cert checking for LDAP with TLS (for self-signed cert)
     
    109135  with_items:
    110136    - { path: "LocalSettings.php", mode: "0660", state: "file" }
    111     - { path: "mediawiki.sqlite",  mode: "0660", state: "file" }
    112     - { path: "wikicache.sqlite",  mode: "0660", state: "file" }
    113137    - { path: "locks",             mode: "0770", state: "directory" }
  • roles/mediawiki/templates/LocalSettings.php.j2

    rc933908e rea9b2b78  
    1212
    1313
     14
     15
     16# TODO: see https://www.mediawiki.org/wiki/Topic:Tvx6bgsxmwktdye9
     17# also: https://www.mediawiki.org/wiki/Topic:Tgdofnhfke1w3w7e
     18
    1419##### DEBUGGING (turn off in production!) #####
    1520
     
    7681$wgDBuser = "{{ db.user }}";
    7782$wgDBpassword = "{{ db.password }}";
    78 
    79 # SQLite-specific settings
    80 $wgSQLiteDataDir = "/srv/mediawiki";
    81 $wgObjectCaches[CACHE_DB] = [
    82         'class' => 'SqlBagOStuff',
    83         'loggroup' => 'SQLBagOStuff',
    84         'server' => [
    85                 'type' => 'sqlite',
    86                 'dbname' => 'wikicache',
    87                 'tablePrefix' => '',
    88                 'flags' => 0
    89         ]
    90 ];
    9183
    9284## Shared memory settings
     
    240232  'id.darkpeak.org' => false
    241233);
     234
     235
     236# Whether cookies are secured (Secure attribute of cookies, see
     237# section 4.1.2.5 in RFC 6265). If configured with the default value,
     238# 'detect', the runtime value is calculated by looking at the protocol
     239# that the request came in under (or as defined in $wgProto if pre
     240# version 1.18). If it is 'https' then this variable is set to true,
     241# otherwise it is false.
     242# $wgCookieSecure = 'detect';
  • roles/mediawiki/vars/main.yml

    rc933908e rea9b2b78  
    1212db:
    1313  name: "{{ service_name }}"
    14   type: SQLite
    15   server: ""
    16   user: ""
    17   password: ""
     14  type: postgres
     15  server: "localhost"
     16  user: "mediawiki"
     17  password: "changeme"
    1818admin_user:
    1919  name: DarkPeaker
Note: See TracChangeset for help on using the changeset viewer.