Extracted nginx tasks into separate file and added missing notification of restart nginx handler

This commit is contained in:
2023-08-19 17:27:08 +02:00
parent ef764de3ae
commit 2421f812c1
2 changed files with 18 additions and 12 deletions
+2 -12
View File
@@ -1,16 +1,6 @@
---
- name: Install nginx
ansible.builtin.apt:
name: nginx
update_cache: true
- name: Allow nginx through firewall
community.general.ufw:
name: Nginx Full
rule: allow
- name: Disable server tokens
ansible.builtin.lineinfile:
search_string: "# server_tokens off;"
path: /etc/nginx/nginx.conf
line: "server_tokens off;"
ansible.builtin.import_tasks: nginx.yaml
tags: nginx
- name: Prepare for Let's Encrypt
ansible.builtin.import_tasks: letsencrypt.yaml
+16
View File
@@ -0,0 +1,16 @@
---
- name: Install nginx
ansible.builtin.apt:
name: nginx
update_cache: true
- name: Allow nginx through firewall
community.general.ufw:
name: Nginx Full
rule: allow
- name: Disable server tokens
notify: Restart nginx
ansible.builtin.lineinfile:
backrefs: true
regexp: "(\\s+)# (server_tokens off;)"
path: /etc/nginx/nginx.conf
line: "\\1\\2"