--- - name: misc setup tags: - mw-backend - misc block: - name: /etc/hosts copy: dest: /etc/hosts content: | 127.0.0.1 localhost 127.0.1.1 mw.trygvis.io mw # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback ff02::1 ip6-allnodes ff02::2 ip6-allrouters - name: apt setup tags: - mw-backend - packages block: - copy: dest: /etc/apt/apt.conf.d/99force-ipv4 content: 'Acquire::ForceIPv4 "true";' notify: update apt cache - name: configure debian repositories notify: update apt cache copy: dest: /etc/apt/sources.list content: | deb http://httpredir.debian.org/debian/ stretch main contrib non-free deb-src http://httpredir.debian.org/debian/ stretch main contrib non-free deb http://security.debian.org/debian-security stretch/updates main contrib non-free deb-src http://security.debian.org/debian-security stretch/updates main contrib non-free deb http://httpredir.debian.org/debian/ stretch-updates main contrib non-free deb-src http://httpredir.debian.org/debian/ stretch-updates main contrib non-free - meta: flush_handlers - name: packages apt: name: "{{ item }}" install_recommends: no with_items: - git - etckeeper - name: system setup tags: - mw-backend - packages block: - name: misc packages apt: name: "{{ item }}" install_recommends: no with_items: - iputils-ping - vim-nox - host - less - name: Mediawiki tags: - mw-backend - mediawiki block: - name: packages notify: reload apache apt: name: "{{ item }}" install_recommends: no with_items: - git - php-pgsql - php-intl - php-gd - php-apcu - mediawiki - name: /var/www/mw.trygvis.io tags: apache-config file: state: directory path: "/var/www/mw.trygvis.io" owner: root group: root - name: apache config notify: reload apache tags: apache-config copy: src: etc/apache2/sites-enabled/000-default.conf dest: /etc/apache2/sites-enabled/000-default.conf - name: mediawiki config template: src: etc/mediawiki/LocalSettings.php.j2 dest: /etc/mediawiki/LocalSettings.php - name: mediawiki job systemd service notify: systemd daemon-reload copy: src: etc/systemd/system/mw-jobqueue.service dest: /etc/systemd/system/mw-jobqueue.service - name: mediawiki job systemd timer notify: systemd daemon-reload copy: src: etc/systemd/system/mw-jobqueue.timer dest: /etc/systemd/system/mw-jobqueue.timer - systemd: enabled: true state: started name: mw-jobqueue.timer - 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: 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