mg
e9f78f93eb
Bugfix: acng ansible.builtin.apt --> ansible.builtin.package Co-authored-by: Michael Grote <38253905+quotengrote@users.noreply.github.com> Reviewed-on: mg/ansible#20 Co-Authored-By: mg <michael.grote@posteo.de> Co-Committed-By: mg <michael.grote@posteo.de>
91 lines
2.5 KiB
YAML
91 lines
2.5 KiB
YAML
- name: install packages
|
|
become: yes
|
|
ansible.builtin.package:
|
|
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
|