2024-11-12 20:14:17 +00:00
|
|
|
- name: Install Nginx
|
|
|
|
zypper:
|
|
|
|
name: nginx
|
|
|
|
state: present
|
2024-11-24 16:44:14 +00:00
|
|
|
notify:
|
|
|
|
- Restart Nginx
|
2024-11-12 20:14:17 +00:00
|
|
|
|
|
|
|
- name: Ensure Nginx is enabled and started
|
|
|
|
systemd:
|
|
|
|
name: nginx
|
|
|
|
enabled: yes
|
|
|
|
state: started
|
2024-11-24 16:44:14 +00:00
|
|
|
notify:
|
|
|
|
- Restart Nginx
|
2024-11-12 20:14:17 +00:00
|
|
|
|
2024-11-17 15:46:24 +00:00
|
|
|
- name: Create directory for error pages
|
|
|
|
file:
|
|
|
|
path: /var/www/errors
|
|
|
|
state: directory
|
|
|
|
owner: nginx
|
|
|
|
group: nginx
|
|
|
|
mode: '0755'
|
2024-11-24 16:44:14 +00:00
|
|
|
notify:
|
|
|
|
- Restart Nginx
|
2024-11-17 15:46:24 +00:00
|
|
|
|
|
|
|
- name: Deploy custom error page
|
|
|
|
template:
|
|
|
|
src: site_down.html.j2
|
|
|
|
dest: /var/www/errors/site_down.html
|
|
|
|
mode: '0644'
|
2024-11-24 16:44:14 +00:00
|
|
|
notify:
|
|
|
|
- Restart Nginx
|
2024-11-17 15:46:24 +00:00
|
|
|
|
2024-11-12 20:14:17 +00:00
|
|
|
- name: Deploy Proxy Configuration
|
|
|
|
template:
|
|
|
|
src: proxy.conf.j2
|
|
|
|
dest: /etc/nginx/conf.d/proxy.conf
|
2024-11-24 16:44:14 +00:00
|
|
|
notify:
|
|
|
|
- Restart Nginx
|
2024-11-12 20:14:17 +00:00
|
|
|
|
2024-11-24 16:44:14 +00:00
|
|
|
- name: Deploy Main Nginx Configuration
|
|
|
|
template:
|
|
|
|
src: nginx.conf.j2
|
|
|
|
dest: /etc/nginx/nginx.conf
|
|
|
|
mode: '0644'
|
|
|
|
notify:
|
|
|
|
- Restart Nginx
|