Improve template with check and correct error

This commit is contained in:
Dryusdan 2021-02-12 19:27:05 +01:00
parent c3f9ffd6a2
commit 96fa945288
2 changed files with 4 additions and 3 deletions

View File

@ -2,9 +2,10 @@
- include_tasks: configure.yml
- name: Add pool
template:
ansible.builtin.template:
src: pool.j2
dest: "/etc/php/{{ php_version }}/fpm/pool.d/{{ item.name }}.conf"
validate: "/usr/sbin/php-fpm{{ php_version }} -t -y %s"
notify:
- reload php
loop: "{{ php_pool }}"

View File

@ -1,12 +1,12 @@
[{{ item.name }}]
listen = {{ item.listen | default('/run/php/'item.name'.sock')}}
listen = {{ item.listen | default("/run/php/{{item.name}}.sock")}}
listen.owner = {{ item.user }}
listen.group = {{ item.group }}
listen.mode = 0660
pm = dynamic
pm.max_children = {{ item.max_children | default('4') }}
pm.max_children = {{ item.max_children | efault('4') }}
pm.start_servers = {{ item.start_servers | default('1') }}
pm.min_spare_servers = {{ item.min_spare_servers | default('1') }}
pm.max_spare_servers = {{ item.max_spare_servers | default('1') }}