refactored wordpress role

This commit is contained in:
Kevin Veen-Birkenbach 2023-12-06 14:40:18 +01:00
parent 15090dd75d
commit 68a2bd4421
4 changed files with 32 additions and 22 deletions

View File

@ -74,16 +74,12 @@
- name: setup wordpress hosts
hosts: wordpress
become: true
tasks:
- name: Include docker-wordpress role for each domain
include_role:
name: docker-wordpress
vars:
domain: "{{ item }}"
http_port: 8003
loop: "{{ wordpress_domains }}"
loop_control:
loop_var: item
roles:
- role: docker-wordpress
vars:
domain: "{{ item }}"
http_port: 8003
- name: setup mediawiki hosts
hosts: mediawiki
become: true

View File

@ -0,0 +1,10 @@
- name: Activate NGINX matomo tracking for {{domain}}
include_role:
name: nginx-matomo-tracking
when: nginx_matomo_tracking_active
- name: configure wordpress nginx configurations
vars:
client_max_body_size: "{{wordpress_max_upload_size}}"
template: src=roles/nginx-docker-reverse-proxy/templates/domain.conf.j2 dest=/etc/nginx/conf.d/{{ domain }}.conf
notify: restart nginx

View File

@ -1,17 +1,19 @@
---
- name: recieve wordpress certificates for {{domain}}
command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{domain}}
- name: Activate NGINX matomo tracking for {{domain}}
include_role:
name: nginx-matomo-tracking
when: nginx_matomo_tracking_active
- name: configure wordpress nginx configurations
- name: "include task receive certbot certificate"
include_tasks: recieve-certbot-certificate.yml
vars:
client_max_body_size: "{{wordpress_max_upload_size}}"
template: src=roles/nginx-docker-reverse-proxy/templates/domain.conf.j2 dest=/etc/nginx/conf.d/{{ domain }}.conf
notify: restart nginx
domain: "{{ item }}"
loop: "{{ wordpress_domains }}"
loop_control:
loop_var: item
- name: "include task create wordpress nginx"
include_tasks: create-wordpress-nginx.yml
vars:
domain: "{{ item }}"
loop: "{{ wordpress_domains }}"
loop_control:
loop_var: item
- name: "create {{docker_compose_instance_directory}}"
file:

View File

@ -0,0 +1,2 @@
- name: recieve certbot certificate for {{domain}}
command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{domain}}