2024-09/07/install_dokuwiki.yml

59 lines
1.2 KiB
YAML
Raw Normal View History

2024-09-18 07:00:52 +00:00
---
- hosts: all
tasks:
- name: Sanity check
assert:
that:
- ansible_os_family == "Debian"
- ansible_distribution_major_version == "12"
- name: Install packages
package:
name:
- apache2
- php-fpm
- dokuwiki
notify: Restart Apache2
- name: Fix Dokuwiki config for Apache
lineinfile:
dest: /etc/apache2/conf-available/dokuwiki.conf
regex: " Allow from localhost"
line: " Allow from all"
backup: yes
notify: Restart Apache2
- name: Enable Apache configurations
file:
state: link
src: "../conf-available/{{ item }}"
dest: "/etc/apache2/conf-enabled/{{ item }}"
loop:
- dokuwiki.conf
- php8.2-fpm.conf
notify: Restart Apache2
- name: Enable Apache2 modules
apache2_module:
name: "{{ item }}"
state: present
loop:
- proxy
- proxy_fcgi
notify: Restart Apache2
handlers:
- name: Stop Apache2
service:
name: apache2
state: stopped
listen: Restart Apache2
- name: Start Apache2
service:
name: apache2
state: started
listen: Restart Apache2