fix: defaulting to nginx vars

This commit is contained in:
Clément Désiles 2025-12-21 22:26:24 +01:00
parent 10f4eb5817
commit 1349ce9c19
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View File

@ -55,7 +55,7 @@
- name: Deploy nginx vhost configurations
ansible.builtin.template:
src: nginx-vhost.conf.j2
dest: "{{ nginx_conf_dir }}/{{ item.key }}.conf"
dest: "{{ nginx_conf_dir | default('/etc/nginx/conf.d') }}/{{ item.key }}.conf"
owner: root
group: root
mode: "0644"

View File

@ -28,8 +28,8 @@ server {
ssl_certificate_key /etc/letsencrypt/live/{{ hostname }}/privkey.pem;
# SSL configuration
ssl_protocols {{ nginx_ssl_protocols }};
ssl_prefer_server_ciphers {{ 'on' if nginx_ssl_prefer_server_ciphers else 'off' }};
ssl_protocols {{ nginx_ssl_protocols | default('TLSv1.3') }};
ssl_prefer_server_ciphers on;
{% endif %}
# Document root
@ -51,7 +51,7 @@ server {
{% endif %}
# Logging
{% if nginx_log_backend == 'journald' %}
{% if nginx_log_backend | default('journald') == 'journald' %}
access_log syslog:server=unix:/dev/log,nohostname,tag=nginx_{{ hostname | replace('.', '_') | replace('-', '_') }};
error_log syslog:server=unix:/dev/log,nohostname,tag=nginx_{{ hostname | replace('.', '_') | replace('-', '_') }};
{% else %}