refactored playbooks, tracking and implemented multi domain for mybb

This commit is contained in:
2023-12-06 16:29:34 +01:00
parent 4a540e21b3
commit 994b61dd1a
8 changed files with 208 additions and 174 deletions

View File

@@ -1,16 +1,13 @@
---
- name: recieve {{domain}} certificate
command: certbot certonly --agree-tos --email {{administrator_email}} --non-interactive --webroot -w /var/lib/letsencrypt/ -d {{domain}}
- name: "include tasks nginx-docker-proxy-domain.yml"
include_tasks: nginx-docker-proxy-domain.yml
loop: "{{ domains }}"
loop_control:
loop_var: domain
- name: configure {{domain}}.conf
template:
src: "roles/nginx-docker-reverse-proxy/templates/domain.conf.j2"
dest: "/etc/nginx/conf.d/{{domain}}.conf"
notify: restart nginx
- name: "create {{conf_d_docker_directory}} and parent directories"
- name: "create {{conf_d_server_directory}} and parent directories"
file:
path: "{{conf_d_docker_directory}}"
path: "{{conf_d_server_directory}}"
state: directory
mode: 0755
recurse: yes

View File

@@ -9,11 +9,6 @@
state: directory
mode: 0755
- name: Activate NGINX matomo tracking
include_role:
name: nginx-matomo-tracking
when: nginx_matomo_tracking_active and domain is defined
- name: create nginx config file
template: src=nginx.conf.j2 dest=/etc/nginx/nginx.conf
notify: restart nginx