35 lines
574 B
YAML
35 lines
574 B
YAML
---
|
|
- name: "Remove Apache via apt"
|
|
apt:
|
|
update_cache: yes
|
|
state: absent
|
|
purge: true
|
|
name:
|
|
- apache2
|
|
|
|
- name: "Install Nginx via apt"
|
|
apt:
|
|
update_cache: yes
|
|
state: present
|
|
name:
|
|
- nginx
|
|
|
|
- name: Upload site config to destination
|
|
copy:
|
|
src: nginx.conf
|
|
dest: /etc/nginx/nginx.conf
|
|
mode: 644
|
|
owner: root
|
|
group: root
|
|
|
|
- name: Enable and restart nginx daemon
|
|
service:
|
|
name: nginx
|
|
state: restarted
|
|
enabled: yes
|
|
|
|
- name: Allow https port via ufw
|
|
community.general.ufw:
|
|
rule: allow
|
|
port: https
|