diff options
Diffstat (limited to 'ansible/roles')
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 |