Unify nginx configuration

This creates a simple base configuration skeleton, that other configuration can be easily loaded into.
This commit is contained in:
Jake Howard
2023-12-16 17:47:04 +00:00
parent 943c141d59
commit 92052a3d0a
16 changed files with 160 additions and 216 deletions

View File

@ -1,26 +1,14 @@
- name: Install nginx
package:
name: nginx
become: true
- name: Nginx config
template:
src: files/nginx.conf
dest: /etc/nginx/nginx.conf
validate: nginx -t -c %s
dest: /etc/nginx/stream.d/gateway.conf
mode: "0644"
become: true
register: nginx_config
- name: Enable Nginx
- name: Reload Nginx
service:
name: nginx
enabled: true
become: true
- name: Restart Nginx
service:
name: nginx
state: restarted
state: reloaded
become: true
when: nginx_config.changed