17 lines
381 B
YAML
17 lines
381 B
YAML
---
|
|
- name: "Install Nginx"
|
|
ansible.builtin.apt:
|
|
name: nginx
|
|
state: present
|
|
|
|
- name: "Ensure Nginx is enabled and started"
|
|
ansible.builtin.service:
|
|
name: nginx
|
|
state: started
|
|
enabled: yes
|
|
|
|
- name: "Remove the default Nginx site to prevent conflicts"
|
|
ansible.builtin.file:
|
|
path: /etc/nginx/sites-enabled/default
|
|
state: absent
|
|
notify: Reload Nginx |