aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/mw-backend
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2018-09-23 10:32:31 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2018-09-23 10:34:27 +0200
commitf7badd1323ed9e53e496c0b7f5b60a69a04d67b4 (patch)
tree1803c0a98200c3568f3e00a105b49f5aaca3a961 /ansible/roles/mw-backend
parent0a6da2506c38681f7138f3787c6f0dd20696ad0d (diff)
downloadinfra-f7badd1323ed9e53e496c0b7f5b60a69a04d67b4.tar.gz
infra-f7badd1323ed9e53e496c0b7f5b60a69a04d67b4.tar.bz2
infra-f7badd1323ed9e53e496c0b7f5b60a69a04d67b4.tar.xz
infra-f7badd1323ed9e53e496c0b7f5b60a69a04d67b4.zip
o Moving semantic mediawiki setup into its own file.
o Fixing some bugs, tested with a clean installation. o Specifying exact version for mediawiki/semantic-media-wiki, 2.5.8.
Diffstat (limited to 'ansible/roles/mw-backend')
-rw-r--r--ansible/roles/mw-backend/files/opt/mediawiki/semantic-media-wiki/composer.json2
-rw-r--r--ansible/roles/mw-backend/tasks/main.yml48
-rw-r--r--ansible/roles/mw-backend/tasks/semantic-mediawiki.yml78
3 files changed, 85 insertions, 43 deletions
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
index 543f77b..f1c00f4 100644
--- 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
@@ -1,6 +1,6 @@
{
"require": {
"mediawiki/semantic-result-formats": "2.5",
- "mediawiki/semantic-media-wiki": "~2.5"
+ "mediawiki/semantic-media-wiki": "2.5.8"
}
}
diff --git a/ansible/roles/mw-backend/tasks/main.yml b/ansible/roles/mw-backend/tasks/main.yml
index 497fad2..a172b9a 100644
--- a/ansible/roles/mw-backend/tasks/main.yml
+++ b/ansible/roles/mw-backend/tasks/main.yml
@@ -46,6 +46,11 @@
- vim-nox
- host
- less
+ - file:
+ dest: /var/www/.ansible
+ state: directory
+ owner: www-data
+ mode: u=rwX,go=
- name: Mediawiki
tags:
@@ -133,45 +138,4 @@
- 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: symlink smw into mw extensions
- file:
- state: link
- dest: "/var/lib/mediawiki/extensions/{{ item }}"
- src: "/opt/mediawiki/semantic-media-wiki/extensions/{{ item }}"
- owner: root
- group: root
- with_items:
- - SemanticMediaWiki
- - SemanticResultFormats
- - name: symlink maintenance into smw
- file:
- state: link
- dest: "/opt/mediawiki/semantic-media-wiki/maintenance"
- src: "/var/lib/mediawiki/maintenance"
- owner: root
- group: root
- - 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
+ - include_tasks: semantic-mediawiki.yml
diff --git a/ansible/roles/mw-backend/tasks/semantic-mediawiki.yml b/ansible/roles/mw-backend/tasks/semantic-mediawiki.yml
new file mode 100644
index 0000000..c035ce3
--- /dev/null
+++ b/ansible/roles/mw-backend/tasks/semantic-mediawiki.yml
@@ -0,0 +1,78 @@
+- name: packages
+ apt:
+ name: "{{ item }}"
+ install_recommends: no
+ with_items:
+ - composer
+ - php-zip
+- name: directories
+ file:
+ state: directory
+ path: /opt/mediawiki
+ owner: root
+ group: root
+- name: directories
+ file:
+ state: directory
+ path: /opt/mediawiki/semantic-media-wiki
+ owner: www-data
+ group: root
+
+- name: composer config
+ copy:
+ src: opt/mediawiki/semantic-media-wiki/composer.json
+ dest: /opt/mediawiki/semantic-media-wiki/composer.json
+
+- tags: composer
+ block:
+ - name: run composer update
+ become: yes
+ become_user: www-data
+ register: run_composer_update
+ composer:
+ command: update
+ working_dir: /opt/mediawiki/semantic-media-wiki
+
+ - name: composer update stdout
+ debug: var=run_composer_update.stdout_lines
+ when: run_composer_update.stdout_lines is defined
+
+ - name: composer update stderr
+ debug: var=run_composer_update.stderr_lines
+ when: run_composer_update.stderr_lines is defined
+
+- tags: composer
+ block:
+ - name: run composer install
+ tags: composer
+ become: yes
+ become_user: www-data
+ register: run_composer_install
+ composer:
+ command: install
+ working_dir: /opt/mediawiki/semantic-media-wiki
+
+ - name: composer install stdout
+ debug: var=run_composer_install.stdout_lines
+ when: run_composer_install.stdout_lines is defined
+
+ - name: composer install stderr
+ debug: var=run_composer_install.stderr_lines
+ when: run_composer_install.stderr_lines is defined
+
+- name: symlink smw into mw extensions
+ file:
+ state: link
+ dest: "/var/lib/mediawiki/extensions/{{ item }}"
+ src: "/opt/mediawiki/semantic-media-wiki/extensions/{{ item }}"
+ with_items:
+ - SemanticMediaWiki
+ - SemanticResultFormats
+
+- name: symlink maintenance into smw
+ file:
+ state: link
+ dest: "/opt/mediawiki/semantic-media-wiki/maintenance"
+ src: "/var/lib/mediawiki/maintenance"
+ owner: root
+ group: root