dokuwiki: use common nginx role

Also get version from NetBox.
This commit is contained in:
Timotej Lazar 2024-05-28 13:23:40 +02:00
parent 3b246447cf
commit cd8f20852e
5 changed files with 4 additions and 63 deletions

View file

@ -1,11 +0,0 @@
# Handle .well-known for all domains.
server {
listen 80 default_server;
listen [::]:80 default_server;
location /.well-known/ {
alias /srv/http/.well-known/;
}
location / {
return 301 https://$host$request_uri;
}
}

View file

@ -1,10 +1,3 @@
- name: Set dokuwiki version
set_fact:
dokuwiki_version: 2024-02-06a
- name: Set up nginx
import_tasks: nginx.yml
- name: Set up PHP
import_tasks: php.yml
@ -51,6 +44,6 @@
- name: Create nginx site
template:
dest: /etc/nginx/http.d/doku.fri.uni-lj.si.conf
src: doku.fri.uni-lj.si.conf.j2
dest: /etc/nginx/http.d/dokuwiki.conf
src: dokuwiki.conf.j2
notify: reload nginx

View file

@ -1,42 +0,0 @@
- name: Enable community package repo
lineinfile:
path: /etc/apk/repositories
regexp: '^# *(http.*/v[^/]*/community)'
line: '\1'
backrefs: yes
- name: Install packages
package:
name: certbot,nginx
- name: Create HTTP server directories
file:
path: /srv/http/.well-known
recurse: true
state: directory
owner: nginx
group: nginx
- name: Set up default HTTP server
copy:
dest: /etc/nginx/http.d
src: default.conf
- name: Enable nginx service
service:
name: nginx
enabled: true
state: started
- name: Get LE certificate
command:
cmd: certbot certonly --non-interactive --agree-tos --register-unsafely-without-email --webroot --webroot-path /srv/http -d doku.fri.uni-lj.si
creates: '/etc/letsencrypt/renewal/doku.fri.uni-lj.si.conf'
- name: Enable certbot renewal
cron:
name: "certbot renew"
job: "certbot renew --quiet"
user: root
hour: "2,14"
minute: "18"

View file

@ -1,7 +1,7 @@
- hosts: '*'
gather_facts: false
roles:
- facts
gather_facts: false
- hosts: ceph-*
roles:
@ -18,6 +18,7 @@
- hosts: doku
roles:
- alpine
- nginx
- dokuwiki
- hosts: netbox