1
0

enable nginx dev

This commit is contained in:
= 2025-04-05 02:38:17 -04:00
parent f843c7eaa3
commit 230d830612
3 changed files with 19 additions and 9 deletions

View File

@ -0,0 +1,9 @@
# code: language=ansible
nginx_sites:
- name: repo.balsillie.house
type: site
autoindex: 'on'
root: /var/www/aur
nginx_user: "http"

View File

@ -5,5 +5,6 @@
become: true
gather_facts: true
roles:
- certbot
# - certbot
- nginx
# - aur_repo_host

View File

@ -69,6 +69,7 @@
notify: Restart nginx
- name: Template out nginx reverse proxy configs
when: item.type == "proxy"
ansible.builtin.template:
src: nginx-proxy.conf.j2
dest: /etc/nginx/sites-available/{{ item.name }}.conf
@ -76,10 +77,10 @@
group: root
mode: "0644"
loop: "{{ nginx_sites }}"
when: item.type == "proxy"
notify: Restart nginx
- name: Template out nginx site configs
when: item.type == "site"
ansible.builtin.template:
src: nginx-site.conf.j2
dest: /etc/nginx/sites-available/{{ item.name }}.conf
@ -87,7 +88,6 @@
group: root
mode: "0644"
loop: "{{ nginx_sites }}"
when: item.type == "site"
notify: Restart nginx
- name: Enable site configs
@ -98,12 +98,12 @@
loop: "{{ nginx_sites }}"
notify: Restart nginx
- name: Run certbot role to install certificates
ansible.builtin.include_role:
name: certbot
vars:
certbot_domains: "{{ nginx_sites | map(attribute='name') }}"
certbot_notify: "Restart nginx"
# - name: Run certbot role to install certificates
# ansible.builtin.include_role:
# name: certbot
# vars:
# certbot_domains: "{{ nginx_sites | map(attribute='name') }}"
# certbot_notify: "Restart nginx"
- name: Start and enable nginx
ansible.builtin.service: