Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
php
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
webarch
php
Commits
07f4f8a5
Verified
Commit
07f4f8a5
authored
5 months ago
by
Chris Croome
Browse files
Options
Downloads
Patches
Plain Diff
check opcache.jit_buffer_size is 0 or >= 40960
parent
935e0c76
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#35152
passed
5 months ago
Stage: bookworm
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
defaults/main.yml
+4
-4
4 additions, 4 deletions
defaults/main.yml
meta/argument_specs.yml
+17
-0
17 additions, 0 deletions
meta/argument_specs.yml
tasks/check_vars.yml
+22
-0
22 additions, 0 deletions
tasks/check_vars.yml
vars/main.yml
+6
-0
6 additions, 0 deletions
vars/main.yml
with
49 additions
and
4 deletions
defaults/main.yml
+
4
−
4
View file @
07f4f8a5
...
...
@@ -78,7 +78,7 @@ php_config:
"
opcache.enable"
:
"
1"
"
opcache.interned_strings_buffer"
:
"
64"
# "opcache.jit": "tracing"
# "opcache.jit_buffer_size": "
256"
# "opcache.jit_buffer_size": "
40961" # minimum size is 40961 bytes
"
opcache.jit"
:
"
0"
"
opcache.jit_buffer_size"
:
"
0"
"
opcache.max_accelerated_files"
:
"
100000"
...
...
@@ -188,7 +188,7 @@ php_config:
"
opcache.enable"
:
"
1"
"
opcache.interned_strings_buffer"
:
"
64"
# "opcache.jit": "tracing"
# "opcache.jit_buffer_size": "
256"
# "opcache.jit_buffer_size": "
40961" # minimum size is 40961 bytes
"
opcache.jit"
:
"
0"
"
opcache.jit_buffer_size"
:
"
0"
"
opcache.max_accelerated_files"
:
"
100000"
...
...
@@ -298,7 +298,7 @@ php_config:
"
opcache.enable"
:
"
1"
"
opcache.interned_strings_buffer"
:
"
64"
# "opcache.jit": "tracing"
# "opcache.jit_buffer_size": "
256"
# "opcache.jit_buffer_size": "
40961" # minimum size is 40961 bytes
"
opcache.jit"
:
"
0"
"
opcache.jit_buffer_size"
:
"
0"
"
opcache.max_accelerated_files"
:
"
100000"
...
...
@@ -408,7 +408,7 @@ php_config:
"
opcache.enable"
:
"
1"
"
opcache.interned_strings_buffer"
:
"
64"
# "opcache.jit": "tracing"
# "opcache.jit_buffer_size": "
256"
# "opcache.jit_buffer_size": "
40961" # minimum size is 40961 bytes
"
opcache.jit"
:
"
0"
"
opcache.jit_buffer_size"
:
"
0"
"
opcache.max_accelerated_files"
:
"
100000"
...
...
This diff is collapsed.
Click to expand it.
meta/argument_specs.yml
+
17
−
0
View file @
07f4f8a5
...
...
@@ -66,6 +66,23 @@ argument_specs:
elements
:
str
required
:
false
description
:
A generated list of php configuration that is not absent.
php_conf_opcache_jit_buffer_sizes
:
type
:
list
elements
:
str
required
:
false
description
:
A generated list of the opcache.jit_buffer_sizes.
php_conf_opcache_jit_buffer_sizes_jmespath_query
:
type
:
str
required
:
true
description
:
A JMESPath query for the opcache.jit_buffer_sizes.
# php_conf_opcache_jit_buffer_sizes_jmespath_query1:
# type: str
# required: true
# description: A JMESPath query for the opcache.jit_buffer_sizes.
# php_conf_opcache_jit_buffer_sizes_jmespath_query2:
# type: str
# required: true
# description: A JMESPath query for the opcache.jit_buffer_sizes.
php_conf_pool_files_not_absent
:
type
:
list
elements
:
str
...
...
This diff is collapsed.
Click to expand it.
tasks/check_vars.yml
+
22
−
0
View file @
07f4f8a5
...
...
@@ -170,6 +170,28 @@
fail_msg
:
"
Non
unique
PHP-FPM
pool
names:{%
for
php_pool_name
in
php_pool_names_not_absent
%}
{{
php_pool_name
}}{%
endfor
%},
please
run
the
role
once
with
--extra-vars='php_fpm_pool_check_fail=false'
to
fix
this"
when
:
php_fpm_pool_check_fail | bool
-
name
:
Debug php_conf_opcache_jit_buffer_sizes_jmespath_query
ansible.builtin.debug
:
var
:
php_conf_opcache_jit_buffer_sizes_jmespath_query
verbosity
:
"
{%
if
ansible_check_mode
|
bool
or
ansible_diff_mode
|
bool
%}1{%
else
%}2{%
endif
%}"
-
name
:
Debug php_conf_opcache_jit_buffer_sizes
ansible.builtin.debug
:
var
:
php_conf_opcache_jit_buffer_sizes
verbosity
:
"
{%
if
ansible_check_mode
|
bool
or
ansible_diff_mode
|
bool
%}1{%
else
%}2{%
endif
%}"
# https://github.com/composer/composer/issues/12153#issuecomment-2419452358
-
name
:
Check that the opcache.jit_buffer_size is set to 0 or is >=
40961
ansible.builtin.assert
:
that
:
-
php_conf_opcache_jit_buffer_size is ansible.builtin.regex('^[0-9]{1,20}$')
-
( php_conf_opcache_jit_buffer_size == "0" ) or ( php_conf_opcache_jit_buffer_size >= "40961" )
quiet
:
"
{%
if
ansible_verbosity
==
0
%}true{%
else
%}false{%
endif
%}"
loop
:
"
{{
php_conf_opcache_jit_buffer_sizes
}}"
loop_control
:
loop_var
:
php_conf_opcache_jit_buffer_size
when
:
php_conf_opcache_jit_buffer_sizes != []
# TODO sapis are required when php_modules are set to be present
tags
:
...
...
This diff is collapsed.
Click to expand it.
vars/main.yml
+
6
−
0
View file @
07f4f8a5
...
...
@@ -96,6 +96,12 @@ php_conf_pool_files_not_absent: "{{ php_config | community.general.json_query('s
# cat defaults/main.yml | yq -o=json | jp "php_config[?state=='present'].files[]|[?state!='absent']"
php_conf_not_absent
:
"
{{
php_config
|
community.general.json_query('[?state==`present`].files[]|[?state!=`absent`]')
}}"
# PHP opcache jit buffer sizes
# cat defaults/main.yml | yq -o=json | \
# jp "php_config[?state=='present'].files[]|[?state!='absent'].conf.opcache.[\"opcache.jit_buffer_size\"]|[]"
php_conf_opcache_jit_buffer_sizes_jmespath_query
:
'
[?state==`present`].files[]|[?state!=`absent`].conf.opcache.["opcache.jit_buffer_size"]|[]'
php_conf_opcache_jit_buffer_sizes
:
"
{{
php_config
|
community.general.json_query(php_conf_opcache_jit_buffer_sizes_jmespath_query)
}}"
# PHP modules configuration absent
# cat defaults/main.yml | yq -o=json | jp "sort(php_modules[?state=='absent'].version)"
php_mods_ver_absent
:
"
{{
php_modules
|
community.general.json_query('sort([?state==`absent`].version)')
}}"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment