--- - name: apt setup tags: - mw-backend - packages block: - file: dest: /etc/apt/apt.conf.d/99force-ipv4 state: absent - 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 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 http://httpredir.debian.org/debian/ stretch-backports main contrib non-free - meta: flush_handlers # TODO: Remove, use unix-machine instead - 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 - file: dest: /var/www/.ansible state: directory owner: www-data mode: u=rwX,go= - 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 - composer - php-zip - mediawiki # TODO: this should be replaced with composer - 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: Mediawiki extensions tags: mw-extensions block: - name: directories file: state: directory path: /opt/mediawiki/extensions owner: www-data group: root - name: run composer install scribunto with_items: "{{ mediawiki_extensions }}" become: yes become_user: www-data composer: command: require arguments: "{{ item.package }} {{ item.version }}" working_dir: /opt/mediawiki/extensions - name: symlink extensions into mediawiki with_items: "{{ mediawiki_extensions }}" file: state: link dest: "/var/lib/mediawiki/extensions/{{ item.extension }}" src: "/opt/mediawiki/extensions/extensions/{{ item.extension }}" - name: symlink maintenance into smw file: state: link dest: "/opt/mediawiki/extensions/maintenance" src: "/var/lib/mediawiki/maintenance" owner: root group: root - name: Mediawiki Backup tags: - mw-backend - mediawiki-backup block: - name: packages apt: name: "{{ item }}" install_recommends: no with_items: - borgbackup - name: mkdir file: state: directory path: "/opt/mediawiki/backup" - name: borgbackup init shell: borgbackup init -e none /opt/mediawiki/borg args: creates: /opt/mediawiki/borg - copy: src: "{{ item }}" dest: "/{{ item }}" mode: a+rx with_items: - bin/mw-dump-backup - bin/mw-dump-db - bin/mw-make-backup