Commit 0774a08f authored by Chris Croome's avatar Chris Croome

move php checks out of vhost loop

parent 730f2e7e
Pipeline #8473 failed with stage
in 18 seconds
......@@ -217,5 +217,93 @@
when: user.value.users_apache_virtual_hosts is defined
# TODO php checks https://git.coop/webarch/php-fpm/blob/master/tasks/pool_check.yml
# https://www.php.net/manual/en/install.fpm.configuration.php
- name: "Check that PHP-FPM pm is set to static, ondemand or dynamic for {{ user.key }} if defined"
assert:
that:
- user.value.users_phpfpm_pm is regex("^static|ondemand|dynamic$")
when: user.value.users_phpfpm_pm is defined
- name: "Check that PHP-FPM pm.max_children is greater than 1 for {{ user.key }} if defined"
assert:
that:
- user.value.users_phpfpm_pm_max_children | int >= 1
when: user.value.users_phpfpm_pm_max_children is defined
- name: "Check the PHP-FPM pm dynamic pool settings for {{ user.key }} if defined"
block:
- name: "Check PHP-FPM pm.start_servers for {{ user.key }} if defined"
assert:
that:
- user.value.users_phpfpm_pm_start_servers | int >= 1
when: user.value.users_phpfpm_pm_start_servers is defined
- name: "Check the PHP-FPM pm.min_spare_servers for {{ user.key }} if defined"
assert:
that:
- user.value.users_phpfpm_pm_min_spare_servers | int >= 1
when: user.value.users_phpfpm_pm_min_spare_servers is defined
- name: "Check the PHP-FPM pm.max_spare_servers for {{ user.key }} if defined"
assert:
that:
- user.value.users_phpfpm_pm_max_spare_servers | int >= 1
when: user.value.users_phpfpm_pm_max_spare_servers is defined
- name: "Check the PHP-FPM users_phpfpm_pm_max_children for {{ user.key }} if defined"
assert:
that:
- user.value.users_phpfpm_pm_max_children | int >= 1
when: user.value.users_phpfpm_pm_max_children is defined
- name: "Check the PHP-FPM pm.max_children must be greater than or equal to pm.start_servers for {{ user.key }} if defined"
assert:
that:
- user.value.users_phpfpm_pm_max_children | int >= user.value.users_phpfpm_pm_start_servers | int
when:
- user.value.users_phpfpm_pm_max_children is defined
- user.value.users_phpfpm_pm_start_servers is defined
- name: "Check the PHP-FPM pm.max_children must be greater than or equal to pm.min_spare_servers for {{ user.key }} if defined"
assert:
that:
- user.value.users_phpfpm_pm_max_children | int >= user.value.users_phpfpm_pm_min_spare_servers | int
when:
- user.value.users_phpfpm_pm_max_children is defined
- user.value.users_phpfpm_pm_min_spare_servers is defined
- name: "Check the PHP-FPM pm.max_children must be greater than or equal to pm.max_spare_servers for {{ user.key }} if defined"
assert:
that:
- user.value.users_phpfpm_pm_max_children | int >= user.value.users_phpfpm_pm_max_spare_servers | int
when:
- user.value.users_phpfpm_pm_max_children is defined
- user.value.users_phpfpm_pm_max_spare_servers is defined
- name: "Check the PHP-FPM pm.start_servers must be greater than pm.min_spare_servers for {{ user.key }} if defined"
assert:
that:
- user.value.users_phpfpm_pm_start_servers | int >= user.value.users_phpfpm_pm_min_spare_servers | int
when:
- user.value.users_phpfpm_pm_start_servers is defined
- user.value.users_phpfpm_pm_min_spare_servers is defined
- name: "Check the PHP-FPM pm.start_servers must less than or equal to pm.max_spare_servers for {{ user.key }} if defined"
assert:
that:
- user.value.users_phpfpm_pm_start_servers | int <= user.value.users_phpfpm_pm_max_spare_servers | int
when:
- user.value.users_phpfpm_pm_start_servers is defined
- user.value.users_phpfpm_pm_max_spare_servers is defined
- name: "Check the PHP-FPM pm.max_spare_servers must be greater than pm.min_spare_servers for {{ user.key }} if defined"
assert:
that:
- user.value.users_phpfpm_pm_max_spare_servers | int >= user.value.users_phpfpm_pm_min_spare_servers | int
when:
- user.value.users_phpfpm_pm_max_spare_servers is defined
user.value.users_phpfpm_pm_min_spare_servers is defined
when: ( user.value.users_phpfpm_pm is defined ) and ( user.value.users_phpfpm_pm == "dynamic" )
...
......@@ -174,94 +174,4 @@
label: "{{ index }}"
when: vhost.value.users_apache_index is defined
# https://www.php.net/manual/en/install.fpm.configuration.php
- name: "Check that PHP-FPM pm is set to static, ondemand or dynamic for {{ vhost.key }} VirtualHost for {{ user.key }} if defined"
assert:
that:
- vhost.value.users_phpfpm_pm is regex("^static|ondemand|dynamic$")
when: vhost.value.users_phpfpm_pm is defined
- name: "Check that PHP-FPM pm.max_children is greater than 1 for {{ vhost.key }} VirtualHost for {{ user.key }} if defined"
assert:
that:
- vhost.value.users_phpfpm_pm_max_children | int >= 1
when: vhost.value.users_phpfpm_pm_max_children is defined
- name: "Check the PHP-FPM pm dynamic pool settings for {{ vhost.key }} VirtualHost for {{ user.key }} if defined"
block:
- name: "Check PHP-FPM pm.start_servers for {{ vhost.key }} VirtualHost for {{ user.key }} if defined"
assert:
that:
- vhost.value.users_phpfpm_pm_start_servers | int >= 1
when: vhost.value.users_phpfpm_pm_start_servers is defined
- name: "Check the PHP-FPM pm.min_spare_servers for {{ vhost.key }} VirtualHost for {{ user.key }} if defined"
assert:
that:
- vhost.value.users_phpfpm_pm_min_spare_servers | int >= 1
when: vhost.value.users_phpfpm_pm_min_spare_servers is defined
- name: "Check the PHP-FPM pm.max_spare_servers for {{ vhost.key }} VirtualHost for {{ user.key }} if defined"
assert:
that:
- vhost.value.users_phpfpm_pm_max_spare_servers | int >= 1
when: vhost.value.users_phpfpm_pm_max_spare_servers is defined
- name: "Check the PHP-FPM users_phpfpm_pm_max_children for {{ vhost.key }} VirtualHost for {{ user.key }} if defined"
assert:
that:
- vhost.value.users_phpfpm_pm_max_children | int >= 1
when: vhost.value.users_phpfpm_pm_max_children is defined
- name: "Check the PHP-FPM pm.max_children must be greater than or equal to pm.start_servers {{ vhost.key }} VirtualHost for {{ user.key }} if defined"
assert:
that:
- vhost.value.users_phpfpm_pm_max_children | int >= vhost.value.users_phpfpm_pm_start_servers | int
when:
- vhost.value.users_phpfpm_pm_max_children is defined
- vhost.value.users_phpfpm_pm_start_servers is defined
- name: "Check the PHP-FPM pm.max_children must be greater than or equal to pm.min_spare_servers for {{ vhost.key }} VirtualHost for {{ user.key }} if defined"
assert:
that:
- vhost.value.users_phpfpm_pm_max_children | int >= vhost.value.users_phpfpm_pm_min_spare_servers | int
when:
- vhost.value.users_phpfpm_pm_max_children is defined
- vhost.value.users_phpfpm_pm_min_spare_servers is defined
- name: "Check the PHP-FPM pm.max_children must be greater than or equal to pm.max_spare_servers for {{ vhost.key }} VirtualHost for {{ user.key }} if defined"
assert:
that:
- vhost.value.users_phpfpm_pm_max_children | int >= vhost.value.users_phpfpm_pm_max_spare_servers | int
when:
- vhost.value.users_phpfpm_pm_max_children is defined
- vhost.value.users_phpfpm_pm_max_spare_servers is defined
- name: "Check the PHP-FPM pm.start_servers must be greater than pm.min_spare_servers for {{ vhost.key }} VirtualHost for {{ user.key }} if defined"
assert:
that:
- vhost.value.users_phpfpm_pm_start_servers | int >= vhost.value.users_phpfpm_pm_min_spare_servers | int
when:
- vhost.value.users_phpfpm_pm_start_servers is defined
- vhost.value.users_phpfpm_pm_min_spare_servers is defined
- name: "Check the PHP-FPM pm.start_servers must less than or equal to pm.max_spare_servers for {{ vhost.key }} VirtualHost for {{ user.key }} if defined"
assert:
that:
- vhost.value.users_phpfpm_pm_start_servers | int <= vhost.value.users_phpfpm_pm_max_spare_servers | int
when:
- vhost.value.users_phpfpm_pm_start_servers is defined
- vhost.value.users_phpfpm_pm_max_spare_servers is defined
- name: "Check the PHP-FPM pm.max_spare_servers must be greater than pm.min_spare_servers for {{ vhost.key }} VirtualHost for {{ user.key }} if defined"
assert:
that:
- vhost.value.users_phpfpm_pm_max_spare_servers | int >= vhost.value.users_phpfpm_pm_min_spare_servers | int
when:
- vhost.value.users_phpfpm_pm_max_spare_servers is defined
vhost.value.users_phpfpm_pm_min_spare_servers is defined
when: ( vhost.value.users_phpfpm_pm is defined ) and ( vhost.value.users_phpfpm_pm == "dynamic" )
...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment