diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2018-02-25 10:16:37 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2018-02-25 10:16:37 +0100 |
commit | ab1d1e236a410e07a8a6109a6f4f26d27e413903 (patch) | |
tree | c0e099a3277bbfb9b9266a8375e2c158134d440e | |
parent | ff8685267b46e18828967790f772f30e19275e7e (diff) | |
download | infra-ab1d1e236a410e07a8a6109a6f4f26d27e413903.tar.gz infra-ab1d1e236a410e07a8a6109a6f4f26d27e413903.tar.bz2 infra-ab1d1e236a410e07a8a6109a6f4f26d27e413903.tar.xz infra-ab1d1e236a410e07a8a6109a6f4f26d27e413903.zip |
wip
-rw-r--r-- | ansible/mw.yml | 1 | ||||
-rw-r--r-- | ansible/roles/mw-backend/files/opt/mediawiki/semantic-media-wiki/composer.json | 6 | ||||
-rw-r--r-- | ansible/roles/mw-backend/tasks/main.yml | 48 | ||||
-rw-r--r-- | ansible/roles/mw-backend/templates/etc/mediawiki/LocalSettings.php.j2 | 9 | ||||
-rw-r--r-- | ansible/roles/timezone/handlers/main.yml | 5 | ||||
-rw-r--r-- | ansible/roles/timezone/tasks/main.yml | 9 |
6 files changed, 60 insertions, 18 deletions
diff --git a/ansible/mw.yml b/ansible/mw.yml index c799529..632d3a3 100644 --- a/ansible/mw.yml +++ b/ansible/mw.yml @@ -4,5 +4,6 @@ vars_files: - secrets.yml roles: + - timezone - mw-backend diff --git a/ansible/roles/mw-backend/files/opt/mediawiki/semantic-media-wiki/composer.json b/ansible/roles/mw-backend/files/opt/mediawiki/semantic-media-wiki/composer.json new file mode 100644 index 0000000..543f77b --- /dev/null +++ b/ansible/roles/mw-backend/files/opt/mediawiki/semantic-media-wiki/composer.json @@ -0,0 +1,6 @@ +{ + "require": { + "mediawiki/semantic-result-formats": "2.5", + "mediawiki/semantic-media-wiki": "~2.5" + } +} diff --git a/ansible/roles/mw-backend/tasks/main.yml b/ansible/roles/mw-backend/tasks/main.yml index e3a0264..69f056d 100644 --- a/ansible/roles/mw-backend/tasks/main.yml +++ b/ansible/roles/mw-backend/tasks/main.yml @@ -68,20 +68,34 @@ template: src: etc/mediawiki/LocalSettings.php.j2 dest: /etc/mediawiki/LocalSettings.php -# - name: directories -# file: -# state: directory -# path: "{{ item }}" -# owner: root -# group: root -# with_items: -# - /opt/mediawiki -# - /opt/mediawiki/images -# - name: www-data owned directories -# file: -# state: directory -# path: "{{ item }}" -# owner: www-data -# group: www-data -# with_items: -# - /opt/mediawiki/images/deleted + +- name: Semantic MediaWiki + tags: + - mw-backend + - smw + block: + - name: packages + apt: + name: "{{ item }}" + install_recommends: no + with_items: + - composer + - php-zip + - name: directories + file: + state: directory + path: "{{ item }}" + owner: root + group: root + with_items: + - /opt/mediawiki + - /opt/mediawiki/semantic-media-wiki + - name: composer config + copy: + src: opt/mediawiki/semantic-media-wiki/composer.json + dest: /opt/mediawiki/semantic-media-wiki/composer.json + - name: run composer + become_user: www-data + composer: + command: install + working_dir: /opt/mediawiki/semantic-media-wiki diff --git a/ansible/roles/mw-backend/templates/etc/mediawiki/LocalSettings.php.j2 b/ansible/roles/mw-backend/templates/etc/mediawiki/LocalSettings.php.j2 index 10e3796..f1984d8 100644 --- a/ansible/roles/mw-backend/templates/etc/mediawiki/LocalSettings.php.j2 +++ b/ansible/roles/mw-backend/templates/etc/mediawiki/LocalSettings.php.j2 @@ -62,7 +62,7 @@ $wgDBport = "5432"; $wgDBmwschema = "public"; ## Shared memory settings -$wgMainCacheType = CACHE_ACCEL; +$wgMainCacheType = CACHE_ANYTHING; $wgMemCachedServers = []; ## To enable image uploads, make sure the 'images' directory @@ -130,6 +130,9 @@ wfLoadSkin( 'Vector' ); wfLoadExtension( 'Cite' ); +require_once "/opt/mediawiki/semantic-media-wiki/vendor/autoload.php"; + + # End of automatically generated settings. # Add more configuration options below. @@ -152,3 +155,7 @@ $wgFooterIcons['poweredby']['debian'] = [ # End Debian specific generated settings # Add more configuration options below. +# https://www.mediawiki.org/wiki/Manual:$wgSMTP +$wgSMTP = array('host' => '10.0.3.1', 'auth' => false); + +enableSemantics( 'trygvis.io' ); diff --git a/ansible/roles/timezone/handlers/main.yml b/ansible/roles/timezone/handlers/main.yml new file mode 100644 index 0000000..0bd7c0d --- /dev/null +++ b/ansible/roles/timezone/handlers/main.yml @@ -0,0 +1,5 @@ +--- +- name: reconfigure tzdata + shell: dpkg-reconfigure -f noninteractive tzdata + + diff --git a/ansible/roles/timezone/tasks/main.yml b/ansible/roles/timezone/tasks/main.yml new file mode 100644 index 0000000..e60de32 --- /dev/null +++ b/ansible/roles/timezone/tasks/main.yml @@ -0,0 +1,9 @@ +--- +- tags: + - timezone + block: + - file: + src: /usr/share/zoneinfo/Europe/Oslo + dest: /etc/localtime + state: link + notify: reconfigure tzdata |