fix bugs
This commit is contained in:
@ -5,14 +5,6 @@
|
||||
notify:
|
||||
- Restart Nginx
|
||||
|
||||
- name: Ensure Nginx is enabled and started
|
||||
systemd:
|
||||
name: nginx
|
||||
enabled: yes
|
||||
state: started
|
||||
notify:
|
||||
- Restart Nginx
|
||||
|
||||
- name: Create directory for error pages
|
||||
file:
|
||||
path: /var/www/errors
|
||||
@ -43,5 +35,23 @@
|
||||
src: nginx.conf.j2
|
||||
dest: /etc/nginx/nginx.conf
|
||||
mode: '0644'
|
||||
notify:
|
||||
- Restart Nginx
|
||||
|
||||
- name: Test Nginx Configuration
|
||||
command: nginx -t
|
||||
register: nginx_test
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Fail if Nginx Configuration Test Failed
|
||||
fail:
|
||||
msg: "Nginx configuration test failed. Check the configuration files."
|
||||
when: nginx_test.rc != 0
|
||||
|
||||
- name: Ensure Nginx is enabled and started
|
||||
systemd:
|
||||
name: nginx
|
||||
enabled: yes
|
||||
state: started
|
||||
notify:
|
||||
- Restart Nginx
|
Reference in New Issue
Block a user