Skip to content

Commit

Permalink
Delete default pool if necessary (#10)
Browse files Browse the repository at this point in the history
(when default pool 'www' not in pool list)
  • Loading branch information
HanXHX authored Apr 19, 2019
1 parent 5abe995 commit 75f09ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions tasks/fpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tests/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 75f09ea

Please sign in to comment.