flatten the "playbooks" directory for better structure
All checks were successful
/ Ansible Lint (push) Successful in 1m33s
All checks were successful
/ Ansible Lint (push) Successful in 1m33s
Because of how Ansible local relative search paths work, the global "files" and "templates" directories need to be next to the playbooks. However its not intuitive to look into the playbooks directory to find the files and templates for a host. Therefore flatten the playbooks directory to get rid of this confusing structure. Also see: https://docs.ansible.com/ansible/latest/playbook_guide/playbook_pathing.html#resolving-local-relative-paths
This commit is contained in:
parent
fab4942852
commit
abc738c9c2
147 changed files with 0 additions and 0 deletions
49
roles/dokuwiki/README.md
Normal file
49
roles/dokuwiki/README.md
Normal file
|
@ -0,0 +1,49 @@
|
|||
# Role `dokuwiki`
|
||||
|
||||
Makes sure that all required packages for a [DokuWiki](https://www.dokuwiki.org/dokuwiki) powered by php-fpm are installed.
|
||||
|
||||
The DokuWiki tarball has to be unpacked to `/var/www/dokuwiki` (see variable below) manually afterwards.
|
||||
Please download it from https://download.dokuwiki.org.
|
||||
|
||||
## Supported Distributions
|
||||
|
||||
The following distributions are supported:
|
||||
|
||||
- Debian 11
|
||||
|
||||
## Required Arguments
|
||||
|
||||
None.
|
||||
|
||||
## Optional Argument
|
||||
|
||||
- `dokuwiki__installpath`: Where your DokiWiki lives, default `/var/www/dokuwiki`
|
||||
- `dokuwiki__php_version`: Your PHP version, default `7.4`
|
||||
- `dokuwiki__php_user`: User of your php-fpm process, default `www-data`
|
||||
- `dokuwiki__nginx_user`: User of your nginx process, default `nginx`
|
||||
|
||||
## nginx Configuration
|
||||
|
||||
This role does not configure your nginx server.
|
||||
Please take a look at https://www.dokuwiki.org/install:nginx for a starting point.
|
||||
|
||||
This role expects to work with our `nginx` role, which installs nginx from nginx's repo instead of Debian's package.
|
||||
This means, that nginx will not run as the `www-data`, which is used by php-fpm.
|
||||
|
||||
So your `server` directive in the nginx configuration needs to use:
|
||||
```conf
|
||||
root /var/www/dokuwiki;
|
||||
|
||||
[...]
|
||||
|
||||
location ~ \.php$ {
|
||||
[...]
|
||||
fastcgi_pass unix:/var/run/php/php-fpm-dokuwiki.sock;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Updates
|
||||
|
||||
This role doesn't handle updates.
|
||||
Please use the updater from Dokuwiki's admin interface to install updates.
|
5
roles/dokuwiki/defaults/main.yml
Normal file
5
roles/dokuwiki/defaults/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
dokuwiki__installpath: "/var/www/dokuwiki"
|
||||
dokuwiki__php_version: "7.4"
|
||||
dokuwiki__php_user: "www-data"
|
||||
dokuwiki__nginx_user: "nginx"
|
5
roles/dokuwiki/files/mime.local.conf
Normal file
5
roles/dokuwiki/files/mime.local.conf
Normal file
|
@ -0,0 +1,5 @@
|
|||
# See here: https://www.dokuwiki.org/mime
|
||||
|
||||
# Allow stl files.
|
||||
stl !model/stl
|
||||
asc application/pgp-keys
|
5
roles/dokuwiki/handlers/main.yml
Normal file
5
roles/dokuwiki/handlers/main.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
- name: Restart php-fpm
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
name: "php{{ dokuwiki__php_version }}-fpm.service"
|
||||
state: restarted
|
8
roles/dokuwiki/meta/main.yml
Normal file
8
roles/dokuwiki/meta/main.yml
Normal file
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
dependencies:
|
||||
- role: distribution_check
|
||||
vars:
|
||||
distribution_check__distribution_support_spec:
|
||||
- name: Debian
|
||||
versions:
|
||||
- 11
|
44
roles/dokuwiki/tasks/main.yml
Normal file
44
roles/dokuwiki/tasks/main.yml
Normal file
|
@ -0,0 +1,44 @@
|
|||
- name: Install php-fpm
|
||||
become: true
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- php-fpm
|
||||
- php-xml
|
||||
- php-mbstring
|
||||
- php-zip
|
||||
- php-intl
|
||||
- php-gd
|
||||
- php-sqlite3
|
||||
diff: false
|
||||
|
||||
- name: Ensure `php-fpm` is enabled
|
||||
become: true
|
||||
ansible.builtin.systemd:
|
||||
service: "php{{ dokuwiki__php_version }}-fpm.service"
|
||||
enabled: true
|
||||
|
||||
- name: Create custom php-fpm pool
|
||||
become: true
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/php-fpm-dokuwiki.conf"
|
||||
dest: "/etc/php/{{ dokuwiki__php_version }}/fpm/pool.d/dokuwiki.conf"
|
||||
mode: "0755"
|
||||
notify: Restart php-fpm
|
||||
|
||||
- name: Create `/var/www` directory
|
||||
become: true
|
||||
ansible.builtin.file:
|
||||
path: /var/www
|
||||
state: directory
|
||||
owner: "{{ dokuwiki__nginx_user }}"
|
||||
group: "{{ dokuwiki__nginx_user }}"
|
||||
mode: "0755"
|
||||
|
||||
- name: Allow more mime types to be uploaded
|
||||
become: true
|
||||
ansible.builtin.copy:
|
||||
src: mime.local.conf
|
||||
dest: /var/www/dokuwiki/conf/mime.local.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0644"
|
15
roles/dokuwiki/templates/php-fpm-dokuwiki.conf
Normal file
15
roles/dokuwiki/templates/php-fpm-dokuwiki.conf
Normal file
|
@ -0,0 +1,15 @@
|
|||
[dokuwiki]
|
||||
user = {{ dokuwiki__php_user }}
|
||||
group = {{ dokuwiki__php_user }}
|
||||
listen = /var/run/php/php-fpm-dokuwiki.sock
|
||||
listen.owner = {{ dokuwiki__nginx_user }}
|
||||
listen.group = {{ dokuwiki__nginx_user }}
|
||||
php_admin_value[disable_functions] = exec,passthru,shell_exec,system
|
||||
php_admin_flag[allow_url_fopen] = on
|
||||
; Choose how the process manager will control the number of child processes.
|
||||
pm = dynamic
|
||||
pm.max_children = 75
|
||||
pm.start_servers = 10
|
||||
pm.min_spare_servers = 5
|
||||
pm.max_spare_servers = 20
|
||||
pm.process_idle_timeout = 10s
|
Loading…
Add table
Add a link
Reference in a new issue