mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-02-24 09:03:29 +07:00
New feature: upstream state (remove upstream if needed)
This commit is contained in:
@@ -12,4 +12,13 @@
|
||||
src=etc/nginx/upstream/upstream.conf.j2
|
||||
dest={{ nginx_etc_dir }}/conf.d/upstream-{{ item.name }}.conf
|
||||
with_items: "{{ nginx_upstreams }}"
|
||||
when: item.state is not defined or item.state == 'present'
|
||||
notify: reload nginx
|
||||
|
||||
- name: FILE | Delete other upstreams
|
||||
file: >
|
||||
path={{ nginx_etc_dir }}/conf.d/upstream-{{ item.name }}.conf
|
||||
state=absent
|
||||
with_items: "{{ nginx_upstreams }}"
|
||||
when: item.state is defined and item.state == 'absent'
|
||||
notify: reload nginx
|
||||
|
||||
Reference in New Issue
Block a user