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
d14b109c
Verified
Commit
d14b109c
authored
1 year ago
by
Chris Croome
Browse files
Options
Downloads
Patches
Plain Diff
update for ini_file version in community.general 8
parent
733404a7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#32756
passed
1 year ago
Stage: bookworm
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tasks/file_section_edited.yml
+23
-20
23 additions, 20 deletions
tasks/file_section_edited.yml
with
23 additions
and
20 deletions
tasks/file_section_edited.yml
+
23
−
20
View file @
d14b109c
...
...
@@ -18,7 +18,7 @@
-
"
Section:
{{
php_conf_section.key
}}"
-
"
Existing
{{
php_conf_variable_pair.key
}}:
'{{
php_conf_file_existing_vars
|
community.general.json_query(php_conf_variable_json_query)
}}'"
-
"
Proposed
{{
php_conf_variable_pair.key
}}:
'{{
php_conf_variable_pair.value
}};"
verbosity
:
"
{%
if
ansible_check_mode
|
bool
%}0{%
else
%}1{%
endif
%}"
verbosity
:
"
{%
if
ansible_check_mode
|
bool
or
ansible_diff_mode
|
bool
%}0{%
else
%}1{%
endif
%}"
when
:
php_conf_variable_pair.value != php_conf_file_existing_vars | community.general.json_query(php_conf_variable_json_query)
vars
:
php_conf_variable_json_query
:
'
"{{
php_conf_section.key
}}"."{{
php_conf_variable_pair.key
}}"'
...
...
@@ -27,24 +27,25 @@
loop_var
:
php_conf_variable_pair
# This is to ensure that variables are written to the same place as existing commented values
-
name
:
Uncomment commented variables in the PHP configuration file that are to be edited
ansible.builtin.lineinfile
:
path
:
"
{{
php_conf_file
}}"
line
:
"
{{
php_conf_variable_pair.key
}}
=
{{
php_conf_variable_pair.value
}}"
regex
:
"
{{
php_conf_variable_regex
}}"
state
:
present
backrefs
:
true
mode
:
"
0644"
owner
:
root
group
:
root
when
:
php_conf_variable_pair.value != php_conf_file_existing_vars | community.general.json_query(php_conf_variable_json_query)
vars
:
php_conf_variable_json_query
:
'
"{{
php_conf_section.key
}}"."{{
php_conf_variable_pair.key
}}"'
php_conf_variable_regex
:
"
^[;]{{
php_conf_variable_pair.key
}}[
=]"
loop
:
"
{{
php_conf_section.value
|
ansible.builtin.dict2items
}}"
loop_control
:
loop_var
:
php_conf_variable_pair
register
:
php_conf_file_comments_edited
# No longer necessary due to the modify_inactive_option for community.general.ini_file
# - name: Uncomment commented variables in the PHP configuration file that are to be edited
# ansible.builtin.lineinfile:
# path: "{{ php_conf_file }}"
# line: "{{ php_conf_variable_pair.key }} = {{ php_conf_variable_pair.value }}"
# regex: "{{ php_conf_variable_regex }}"
# state: present
# backrefs: true
# mode: "0644"
# owner: root
# group: root
# when: php_conf_variable_pair.value != php_conf_file_existing_vars | community.general.json_query(php_conf_variable_json_query)
# vars:
# php_conf_variable_json_query: '"{{ php_conf_section.key }}"."{{ php_conf_variable_pair.key }}"'
# php_conf_variable_regex: "^[;]{{ php_conf_variable_pair.key }}[ =]"
# loop: "{{ php_conf_section.value | ansible.builtin.dict2items }}"
# loop_control:
# loop_var: php_conf_variable_pair
# register: php_conf_file_comments_edited
-
name
:
PHP configuration file edited
community.general.ini_file
:
...
...
@@ -52,6 +53,7 @@
section
:
"
{{
php_conf_section.key
}}"
option
:
"
{{
php_conf_variable_pair.key
}}"
value
:
"
{{
php_conf_variable_pair.value
}}"
modify_inactive_option
:
true
no_extra_spaces
:
false
mode
:
"
0644"
owner
:
root
...
...
@@ -67,7 +69,8 @@
-
name
:
Set a fact to indicate that the file has changed
# noqa: no-handler
ansible.builtin.set_fact
:
php_conf_file_changed
:
true
when
:
(php_conf_file_comments_edited.changed ) or ( php_conf_file_edited.changed | bool )
# when: (php_conf_file_comments_edited.changed ) or ( php_conf_file_edited.changed | bool )
when
:
php_conf_file_edited.changed | bool
tags
:
-
php
...
...
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