ansible-nginx/tasks/upstream.yml

30 lines
908 B
YAML
Raw Normal View History

2015-07-15 21:26:27 +07:00
---
- name: SET_FACT | Backward compatibility with old version of this role
2017-07-27 17:21:10 +07:00
set_fact:
nginx_php56: true
when: nginx_php is defined and nginx_php
2015-07-15 21:26:27 +07:00
- name: TEMPLATE | Deploy PHP upstream to Nginx
2017-07-27 17:21:10 +07:00
template:
src: "etc/nginx/upstream/php.conf.j2"
dest: "{{ nginx_etc_dir }}/conf.d/php.conf"
2016-08-11 16:30:26 +07:00
when: nginx_php56 or nginx_php70
2015-07-15 21:26:27 +07:00
notify: reload nginx
2015-10-08 23:21:40 +07:00
- name: TEMPLATE | Deploy other upstreams
2017-07-27 17:21:10 +07:00
template:
src: "etc/nginx/upstream/upstream.conf.j2"
dest: "{{ nginx_etc_dir }}/conf.d/upstream-{{ item.name }}.conf"
2016-03-05 17:37:37 +07:00
with_items: "{{ nginx_upstreams }}"
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
with_items: "{{ nginx_upstreams }}"
when: item.state is defined and item.state == 'absent'
2015-10-08 23:21:40 +07:00
notify: reload nginx