2015-07-15 21:26:27 +07:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: TEMPLATE | Deploy PHP upstream to Nginx
|
2017-07-27 17:21:10 +07:00
|
|
|
template:
|
2017-10-26 16:09:21 +07:00
|
|
|
src: "etc/nginx/conf.d/php.conf.j2"
|
2017-07-27 17:21:10 +07:00
|
|
|
dest: "{{ nginx_etc_dir }}/conf.d/php.conf"
|
2017-10-26 15:59:24 +07:00
|
|
|
when: nginx_php | length > 0
|
2015-07-15 21:26:27 +07:00
|
|
|
notify: reload nginx
|
|
|
|
|
2017-12-07 17:09:44 +07:00
|
|
|
- name: FILE | Delete PHP upstream
|
|
|
|
file:
|
|
|
|
path: "{{ nginx_etc_dir }}/conf.d/php.conf"
|
|
|
|
state: absent
|
|
|
|
when: nginx_php | length == 0
|
|
|
|
|
2015-10-08 23:21:40 +07:00
|
|
|
- name: TEMPLATE | Deploy other upstreams
|
2017-07-27 17:21:10 +07:00
|
|
|
template:
|
2017-10-26 16:09:21 +07:00
|
|
|
src: "etc/nginx/conf.d/_upstream.conf.j2"
|
2017-07-27 17:21:10 +07:00
|
|
|
dest: "{{ nginx_etc_dir }}/conf.d/upstream-{{ item.name }}.conf"
|
2016-03-05 17:37:37 +07:00
|
|
|
with_items: "{{ nginx_upstreams }}"
|
2016-05-11 22:21:52 +07:00
|
|
|
when: item.state is not defined or item.state == 'present'
|
|
|
|
notify: reload nginx
|
|
|
|
|
|
|
|
- name: FILE | Delete other upstreams
|
2017-07-27 17:21:10 +07:00
|
|
|
file:
|
|
|
|
path: "{{ nginx_etc_dir }}/conf.d/upstream-{{ item.name }}.conf"
|
|
|
|
state: absent
|
2016-05-11 22:21:52 +07:00
|
|
|
with_items: "{{ nginx_upstreams }}"
|
|
|
|
when: item.state is defined and item.state == 'absent'
|
2015-10-08 23:21:40 +07:00
|
|
|
notify: reload nginx
|