2020-08-18 11:57:53 +02:00
- name : install packages
become : yes
2021-01-02 10:30:54 +01:00
ansible.builtin.package :
2020-08-18 11:57:53 +02:00
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
2020-11-21 19:41:19 +01:00
ansible.builtin.apache2_module :
2020-08-18 11:57:53 +02:00
state : present
name : rewrite
- name : Download latest dokuwiki
become : yes
2020-11-21 19:41:19 +01:00
ansible.builtin.get_url :
2020-08-18 11:57:53 +02:00
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
2020-11-21 19:41:19 +01:00
ansible.builtin.file :
2020-08-18 11:57:53 +02:00
path : "{{ dokuwiki_install_path }}"
state : directory
owner : www-data
group : www-data
- name : Unarchive dokuwiki-stable.tgz to {{ dokuwiki_install_path }}
become : yes
2020-11-21 19:41:19 +01:00
ansible.builtin.unarchive :
2020-08-18 11:57:53 +02:00
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
2020-11-21 19:41:19 +01:00
ansible.builtin.file :
2020-08-18 11:57:53 +02:00
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
2020-11-21 19:41:19 +01:00
ansible.builtin.file :
2020-08-18 11:57:53 +02:00
path : "{{ dokuwiki_install_path }}"
owner : www-data
group : www-data
- name : copy apache2.conf
become : yes
2020-11-21 19:41:19 +01:00
ansible.builtin.template :
2020-08-18 11:57:53 +02:00
src : "apache2.conf"
dest : "/etc/apache2/apache2.conf"
notify : restart_apache2
- name : copy 000-default.conf
become : yes
2020-11-21 19:41:19 +01:00
ansible.builtin.template :
2020-08-18 11:57:53 +02:00
src : "000-default.conf"
dest : "/etc/apache2/sites-enabled/000-default.conf"
notify : restart_apache2
- name : remove tmp files
become : yes
2020-11-21 19:41:19 +01:00
ansible.builtin.file :
2020-08-18 11:57:53 +02:00
path : /tmp/dokuwiki-stable.tgz
state : absent
- name : remove install.php
become : yes
2020-11-21 19:41:19 +01:00
ansible.builtin.file :
2020-08-18 11:57:53 +02:00
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