forked from evolix/ansible-roles
nginx: fix multiple fails in check mode
This commit is contained in:
parent
41897f4c62
commit
0a590b6679
|
@ -80,6 +80,8 @@ The **patch** part changes is incremented if multiple releases happen the same m
|
|||
* webapps/nextcloud: fix Add Ceph volume to fstab : missing UUID= in src
|
||||
* webapps/nextcloud: fix misplaced gid attribute
|
||||
* webapps/nextcloud: fix missing gid
|
||||
* nginx: fix mistake between "check_mode: no" and "when: not ansible_check_mode" (fail in check mode)
|
||||
* nginx: add "when: not ansible_check_mode" in various tasks to prevent fail in check mode
|
||||
|
||||
### Removed
|
||||
|
||||
|
|
|
@ -3,13 +3,16 @@
|
|||
ansible.builtin.service:
|
||||
name: nginx
|
||||
state: restarted
|
||||
when: not ansible_check_mode
|
||||
|
||||
- name: reload nginx
|
||||
ansible.builtin.service:
|
||||
name: nginx
|
||||
state: reloaded
|
||||
when: not ansible_check_mode
|
||||
|
||||
- name: restart munin
|
||||
ansible.builtin.service:
|
||||
name: munin-node
|
||||
state: restarted
|
||||
when: not ansible_check_mode
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
line: "allow {{ item }};"
|
||||
state: present
|
||||
loop: "{{ nginx_ipaddr_whitelist_present }}"
|
||||
when: not ansible_check_mode
|
||||
notify: reload nginx
|
||||
tags:
|
||||
- nginx
|
||||
|
@ -17,6 +18,7 @@
|
|||
line: "allow {{ item }};"
|
||||
state: absent
|
||||
loop: "{{ nginx_ipaddr_whitelist_absent }}"
|
||||
when: not ansible_check_mode
|
||||
notify: reload nginx
|
||||
tags:
|
||||
- nginx
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
line: '\1worker_connections 1024;'
|
||||
insertafter: 'events \{'
|
||||
backrefs: yes
|
||||
when: not ansible_check_mode
|
||||
tags:
|
||||
- nginx
|
||||
|
||||
|
@ -34,6 +35,7 @@
|
|||
line: '\1use epoll;'
|
||||
insertafter: 'events \{'
|
||||
backrefs: yes
|
||||
when: not ansible_check_mode
|
||||
tags:
|
||||
- nginx
|
||||
|
||||
|
@ -145,6 +147,7 @@
|
|||
name: nginx
|
||||
enabled: yes
|
||||
state: started
|
||||
when: not ansible_check_mode
|
||||
tags:
|
||||
- nginx
|
||||
|
||||
|
|
|
@ -37,3 +37,4 @@
|
|||
daemon_reload: yes
|
||||
enabled: yes
|
||||
state: started
|
||||
when: not ansible_check_mode
|
||||
|
|
|
@ -26,13 +26,15 @@
|
|||
ansible.builtin.command:
|
||||
cmd: "tail -n 1 {{ nginx_serverstatus_suffix_file }}"
|
||||
changed_when: False
|
||||
check_mode: no
|
||||
when: not ansible_check_mode
|
||||
register: new_nginx_serverstatus_suffix
|
||||
|
||||
- name: overwrite nginx_serverstatus_suffix
|
||||
ansible.builtin.set_fact:
|
||||
nginx_serverstatus_suffix: "{{ new_nginx_serverstatus_suffix.stdout }}"
|
||||
when: not ansible_check_mode
|
||||
|
||||
- ansible.builtin.debug:
|
||||
var: nginx_serverstatus_suffix
|
||||
verbosity: 1
|
||||
when: not ansible_check_mode
|
||||
|
|
|
@ -17,4 +17,5 @@
|
|||
dest: /etc/nginx/sites-available/evolinux-default.conf
|
||||
regexp: 'location /server-status-? {'
|
||||
replace: 'location /server-status-{{ nginx_serverstatus_suffix }} {'
|
||||
when: not ansible_check_mode
|
||||
notify: reload nginx
|
||||
|
|
Loading…
Reference in a new issue