62 lines
1.3 KiB
YAML
62 lines
1.3 KiB
YAML
|
---
|
||
|
- hosts: all
|
||
|
|
||
|
tasks:
|
||
|
- debug:
|
||
|
var: ansible_os_family
|
||
|
|
||
|
- 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.3-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
|
||
|
|