From 0788b6c84f0feeb3ee0a7b4b537ed497e4d7cd53 Mon Sep 17 00:00:00 2001 From: Emilien Mantel Date: Thu, 7 Dec 2017 11:09:44 +0100 Subject: [PATCH] Delete PHP upstream when nginx_php is empty Closes #31 --- tasks/upstream.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tasks/upstream.yml b/tasks/upstream.yml index 0cdea89..9aecbfd 100644 --- a/tasks/upstream.yml +++ b/tasks/upstream.yml @@ -7,6 +7,12 @@ when: nginx_php | length > 0 notify: reload nginx +- name: FILE | Delete PHP upstream + file: + path: "{{ nginx_etc_dir }}/conf.d/php.conf" + state: absent + when: nginx_php | length == 0 + - name: TEMPLATE | Deploy other upstreams template: src: "etc/nginx/conf.d/_upstream.conf.j2"