mirror of
https://github.com/2martens/cloud-configuration.git
synced 2026-10-19 09:26:51 +02:00
Extracted nginx tasks into separate file and added missing notification of restart nginx handler
This commit is contained in:
@@ -1,16 +1,6 @@
|
|||||||
---
|
---
|
||||||
- name: Install nginx
|
- name: Install nginx
|
||||||
ansible.builtin.apt:
|
ansible.builtin.import_tasks: nginx.yaml
|
||||||
name: nginx
|
tags: 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;"
|
|
||||||
- name: Prepare for Let's Encrypt
|
- name: Prepare for Let's Encrypt
|
||||||
ansible.builtin.import_tasks: letsencrypt.yaml
|
ansible.builtin.import_tasks: letsencrypt.yaml
|
||||||
|
|||||||
@@ -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"
|
||||||
Reference in New Issue
Block a user