2022-01-01 19:24:52 +01:00
|
|
|
---
|
2022-04-14 23:52:27 +02:00
|
|
|
- name: "Install Nginx via apt"
|
|
|
|
apt:
|
|
|
|
update_cache: yes
|
|
|
|
state: present
|
|
|
|
name:
|
|
|
|
- nginx
|
|
|
|
|
2022-04-16 14:21:53 +02:00
|
|
|
- name: Enable and restart nginx daemon
|
|
|
|
service:
|
|
|
|
name: nginx
|
|
|
|
state: restarted
|
|
|
|
enabled: yes
|
|
|
|
|
2022-04-16 18:04:52 +02:00
|
|
|
- name: "Generate nginx configuration"
|
|
|
|
ansible.builtin.template:
|
2022-04-14 23:52:27 +02:00
|
|
|
src: nginx.conf
|
|
|
|
dest: /etc/nginx/nginx.conf
|
2022-01-01 19:24:52 +01:00
|
|
|
owner: root
|
2022-04-14 23:52:27 +02:00
|
|
|
group: root
|
2022-04-16 18:04:52 +02:00
|
|
|
mode: '0644'
|
2022-01-01 19:24:52 +01:00
|
|
|
|
2022-04-16 14:21:53 +02:00
|
|
|
- name: Reload nginx daemon
|
2022-01-01 19:24:52 +01:00
|
|
|
service:
|
2022-04-14 23:52:27 +02:00
|
|
|
name: nginx
|
2022-04-16 14:21:53 +02:00
|
|
|
state: reloaded
|
2022-02-05 20:00:55 +01:00
|
|
|
|
|
|
|
- name: Allow https port via ufw
|
|
|
|
community.general.ufw:
|
|
|
|
rule: allow
|
|
|
|
port: https
|