homeserver/roles/mgrote.dokuwiki/tasks/main.yml
Quotengrote 15d783de86
FQCN eingeführt (#70)
* template --> ansible.builtin.template

* apt --> ansible.builtin.apt

* lineinfile --> ansible.builtin.lineinfile

* file --> ansible.builtin.file

* blockinfile --> ansible.builtin.blockinfile

* cron --> ansible.builtin.cron

* timezone --> ansible.builtin.timezone

* get_url --> ansible.builtin.get_url

* group --> ansible.builtin.group

* user --> ansible.builtin.user

* unarchive --> ansible.builtin.unarchive

* service --> ansible.builtin.service

* apache2_module --> ansible.builtin.apache2_module

* package --> ansible.builtin.apt

* template --> ansible.builtin.template 2
2020-11-21 19:41:19 +01:00

91 lines
2.5 KiB
YAML

- name: install packages
become: yes
ansible.builtin.apt:
name:
- php
- php-mbstring
- php-xml
- apache2
- libapache2-mod-php
- php-xml
- php-gd
state: present
# aktiviert das module rewrite = a2enmod rewrite
- name: activate a2enmod rewrite
become: yes
ansible.builtin.apache2_module:
state: present
name: rewrite
- name: Download latest dokuwiki
become: yes
ansible.builtin.get_url:
url: https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
dest: /tmp/dokuwiki-stable.tgz
when: dokuwiki_update # noqa 601 # entspricht when: dokuwiki_update == true; noqa sorgt dafür dass das beispiel nicht "gemeldet" wird
- name: create dokuwiki install path
become: yes
ansible.builtin.file:
path: "{{ dokuwiki_install_path }}"
state: directory
owner: www-data
group: www-data
- name: Unarchive dokuwiki-stable.tgz to {{ dokuwiki_install_path }}
become: yes
ansible.builtin.unarchive:
src: /tmp/dokuwiki-stable.tgz
dest: "{{ dokuwiki_install_path }}"
owner: www-data
remote_src: yes
list_files: yes
extra_opts: [--strip-components=1] # entfernt die erste Ebene des Archives
when: dokuwiki_update
- name: Remove default plugins
become: yes
ansible.builtin.file:
path: '{{ dokuwiki_install_path }}/lib/plugins/{{ item }}'
state: absent
with_items:
- authpdo
- authmysql
- authpgsql
- authad
when: dokuwiki_update
- name: Change file ownership, group and permissions
become: yes
ansible.builtin.file:
path: "{{ dokuwiki_install_path }}"
owner: www-data
group: www-data
- name: copy apache2.conf
become: yes
ansible.builtin.template:
src: "apache2.conf"
dest: "/etc/apache2/apache2.conf"
notify: restart_apache2
- name: copy 000-default.conf
become: yes
ansible.builtin.template:
src: "000-default.conf"
dest: "/etc/apache2/sites-enabled/000-default.conf"
notify: restart_apache2
- name: remove tmp files
become: yes
ansible.builtin.file:
path: /tmp/dokuwiki-stable.tgz
state: absent
- name: remove install.php
become: yes
ansible.builtin.file:
path: '{{ dokuwiki_install_path }}/install.php'
state: absent
when: not dokuwiki_install # noqa 601 # entspricht when: dokuwiki_update == true; noqa sorgt dafür dass das beispiel nicht "gemeldet" wird # entspricht == false