3 Commits

Author SHA1 Message Date
Emilien M
f6652efe77 Merge pull request #21 from HanXHX/improvements/misc
Many improvements
2023-05-30 13:22:51 +02:00
Klaus Zerwes
746b05ca4a fix pool.conf template in case some VARs are not defined (#20)
vars not defined in defaults should be processed only if they are defined (avoid AnsibleUndefinedVariable errors)

Co-authored-by: Klaus Zerwes <Klaus.Zerwes@rosalux.org>
2022-11-07 17:22:57 +01:00
Klaus Zerwes
b4afb45dd4 honor php_install_fpm in case it is set to 'false' (#19)
Co-authored-by: Klaus Zerwes <Klaus.Zerwes@rosalux.org>
2022-11-07 11:03:58 +01:00
2 changed files with 11 additions and 1 deletions

View File

@@ -22,6 +22,7 @@
group: root group: root
mode: 0644 mode: 0644
loop: "{{ php_ini | combine(php_ini_fpm) | dict2items }}" loop: "{{ php_ini | combine(php_ini_fpm) | dict2items }}"
when: php_install_fpm | bool
notify: Restart php-fpm notify: Restart php-fpm
- name: TEMPLATE | Deploy pool configuration - name: TEMPLATE | Deploy pool configuration
@@ -32,11 +33,14 @@
group: root group: root
mode: 0644 mode: 0644
loop: "{{ ansible_local.hanxhx_php.fpm_pool }}" loop: "{{ ansible_local.hanxhx_php.fpm_pool }}"
when: php_install_fpm | bool
notify: Restart php-fpm notify: Restart php-fpm
- name: FILE | Delete default pool if necessary - name: FILE | Delete default pool if necessary
ansible.builtin.file: ansible.builtin.file:
path: "{{ php_fpm_pool_dir }}/www.conf" path: "{{ php_fpm_pool_dir }}/www.conf"
state: absent state: absent
when: '"www" not in (ansible_local.hanxhx_php.fpm_pool | map(attribute="name") | list) and php_autoremove_default_pool' when:
- '"www" not in (ansible_local.hanxhx_php.fpm_pool | map(attribute="name") | list) and php_autoremove_default_pool'
- php_install_fpm | bool
notify: Restart php-fpm notify: Restart php-fpm

View File

@@ -421,13 +421,19 @@ catch_workers_output = {{ item.catch_workers_output | default('no') }}
;php_admin_value[error_log] = /var/log/fpm-php.www.log ;php_admin_value[error_log] = /var/log/fpm-php.www.log
;php_admin_flag[log_errors] = on ;php_admin_flag[log_errors] = on
;php_admin_value[memory_limit] = 32M ;php_admin_value[memory_limit] = 32M
{% if item.php_env is defined %}
{% for k, v in item.php_env.items() | list %} {% for k, v in item.php_env.items() | list %}
env[{{ k }}] = {{ v }} env[{{ k }}] = {{ v }}
{% endfor %} {% endfor %}
{% endif %}
{% if item.php_value is defined %}
{% for k, v in item.php_value.items() | list %} {% for k, v in item.php_value.items() | list %}
php_value[{{ k }}] = {{ v }} php_value[{{ k }}] = {{ v }}
{% endfor %} {% endfor %}
{% endif %}
{% if item.php_admin_value is defined %}
{% for k, v in item.php_admin_value.items() | list %} {% for k, v in item.php_admin_value.items() | list %}
php_admin_value[{{ k }}] = {{ v }} php_admin_value[{{ k }}] = {{ v }}
{% endfor %} {% endfor %}
{% endif %}
; vim:filetype=dosini ; vim:filetype=dosini