From 87084c1d9723a5ce24bff187337d1ac4cd4ce8be Mon Sep 17 00:00:00 2001 From: NaeiKinDus Date: Thu, 30 Jan 2025 00:00:00 +0000 Subject: [PATCH] feat(nginx): change default configuration setup --- README.md | 3 --- .../infrastructure/roles/nginx/tasks/nginx-config.yml | 7 +++++++ .../infrastructure/roles/nginx/templates/nginx.conf.j2 | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c2f4f73..43b6389 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,3 @@ Global variables are defined in `inventory/group_vars/all/vars.yml` and are used - inventory: all inventory related files are stored here; - playbooks: top level playbooks, describe the way the infrastructure is laid out; - scripts: various scripts and helpers; - -# TODO / Issues -- gpg setup for HC Vault should be done with current user or root only, not mixed diff --git a/collections/ansible_collections/nullified/infrastructure/roles/nginx/tasks/nginx-config.yml b/collections/ansible_collections/nullified/infrastructure/roles/nginx/tasks/nginx-config.yml index ebec5a5..51e455a 100644 --- a/collections/ansible_collections/nullified/infrastructure/roles/nginx/tasks/nginx-config.yml +++ b/collections/ansible_collections/nullified/infrastructure/roles/nginx/tasks/nginx-config.yml @@ -8,6 +8,7 @@ group: '{{ nginx_service_group }}' mode: '0750' loop: + - conf.d - ssl - ssl/certificates - ssl/keys @@ -16,6 +17,12 @@ - streams-available - streams-enabled +- name: remove default unneeded files + become: true + ansible.builtin.file: + path: '/etc/nginx/conf.d/default.conf' + state: absent + - name: generate dhparams.pem file become: true ansible.builtin.command: diff --git a/collections/ansible_collections/nullified/infrastructure/roles/nginx/templates/nginx.conf.j2 b/collections/ansible_collections/nullified/infrastructure/roles/nginx/templates/nginx.conf.j2 index 28be4b2..121f7da 100644 --- a/collections/ansible_collections/nullified/infrastructure/roles/nginx/templates/nginx.conf.j2 +++ b/collections/ansible_collections/nullified/infrastructure/roles/nginx/templates/nginx.conf.j2 @@ -8,6 +8,8 @@ events { worker_connections 1024; } +include /etc/nginx/conf.d/*.conf; + http { include /etc/nginx/mime.types; default_type application/octet-stream;