From 75f09eaf59fcb3c07e51a491e4932374197cb7e5 Mon Sep 17 00:00:00 2001 From: Emilien M Date: Fri, 19 Apr 2019 14:36:35 +0200 Subject: [PATCH] Delete default pool if necessary (#10) (when default pool 'www' not in pool list) --- tasks/fpm.yml | 7 +++++++ tests/test.yml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tasks/fpm.yml b/tasks/fpm.yml index c4b2b87..509dd07 100644 --- a/tasks/fpm.yml +++ b/tasks/fpm.yml @@ -27,3 +27,10 @@ dest: '{{ php_fpm_pool_dir }}/{{ item.pool_name }}.conf' loop: "{{ php_fpm_poold }}" notify: restart php-fpm + +- name: FILE | Delete default pool if necessary + file: + path: "{{ php_fpm_pool_dir }}/www.conf" + state: absent + when: '"www" not in (php_fpm_poold | map(attribute="pool_name") | list)' + notify: restart php-fpm diff --git a/tests/test.yml b/tests/test.yml index 7821172..c1ce974 100644 --- a/tests/test.yml +++ b/tests/test.yml @@ -11,7 +11,7 @@ php_ini_cli: error_reporting: 'E_ALL' php_fpm_poold: - - pool_name: 'www' + - pool_name: 'test_ansible' listen: '{{ php_default_fpm_sock }}' pm: 'dynamic' pm_max_children: 250