Select Git revision
main.yml 55.92 KiB
# Copyright 2019-2024 Chris Croome
#
# This file is part of the Webarchitects PHP Ansible role.
#
# The Webarchitects PHP Ansible role is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
#
# The Webarchitects PHP Ansible role is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with the Webarchitects PHP Ansible role. If not, see <https://www.gnu.org/licenses/>.
---
# The ansible_managed string for lineinfile is set here, ensure it matches
# the values that ansible_managed is set to for idempotency
php_ansible_managed: Ansible managed
php_fpm_pools: []
php_pool_names_not_absent: []
# https://docs.ansible.com/ansible/latest/playbook_guide/complex_data_manipulation.html
phpvarnames: "{{ q('varnames', '^php_') | sort }}"
phphostvars: "{{ dict(phpvarnames | list | zip(q('vars', *phpvarnames))) }}"
php_file_path_separator: '/'
# PHP versions absent
# cat defaults/main.yml | yq -o=json | jp "php_versions[?state=='absent'].version"
php_ver_absent: "{{ php_versions | community.general.json_query('[?state==`absent`].version') | sort }}"
php_ver_absent_regex: "{{ php_versions | community.general.json_query('[?state==`absent`].version') | sort | map('regex_replace', '^', '^php') }}"
php_ver_pkg_remove: []
# PHP versions present
# cat defaults/main.yml | yq -o=json | jp "php_versions[?state=='present'].version"
php_ver_present: "{{ php_versions | community.general.json_query('[?state==`present`].version') | sort }}"
# PHP packages absent
# cat defaults/main.yml | yq -o=json | jp "php_versions[?state=='present'].pkg_absent[]" | sort -u
php_pkg_absent: "{{ php_versions | community.general.json_query('[?state==`present`].pkg_absent[]') | ansible.builtin.unique | sort }}"
# PHP packages present
# cat defaults/main.yml | yq -o=json | jp "php_versions[?state=='present'].pkg_present[]" | sort -u
php_pkg_present: "{{ php_versions | community.general.json_query('[?state==`present`].pkg_present[]') | ansible.builtin.unique | sort }}"
# The php_ver is ued as an internal loop variable
php_ver: null
# PHP config file paths
php_conf_file_paths_jmespath_query: "[?version=='{{ php_ver }}'].files[].path"
# PHP versions configuration absent
# cat defaults/main.yml | yq -o=json | jp "php_config[?state=='absent'].version"
php_conf_ver_absent: "{{ php_config | community.general.json_query('[?state==`absent`].version') | sort }}"
# PHP versions configuration present
# cat defaults/main.yml | yq -o=json | jp "php_config[?state=='present'].version"
php_conf_ver_present: "{{ php_config | community.general.json_query('[?state==`present`].version') | sort }}"
# PHP versions configuration directories absent
php_conf_dirs_absent: "{{ php_config | community.general.json_query('[?state==`absent`].version') | sort | map('regex_replace', '^', '/etc/php/') }}"
# PHP versions configuration directories present
# cat defaults/main.yml | yq -o=json | jp "php_config[?state=='present'].version"
php_conf_dirs_present: "{{ php_config | community.general.json_query('[?state==`present`].version') | sort | map('regex_replace', '^', '/etc/php/') }}"
# PHP versions present files absent
# cat defaults/main.yml | yq -o=json | jp "php_config[?state=='present'].files[]|[?state=='absent'].path"
php_conf_files_absent: "{{ php_config | community.general.json_query('[?state==`present`].files[]|[?state==`absent`].path') | sort }}"
# PHP versions present configuration files edited
# cat defaults/main.yml | yq -o=json | jp "php_config[?state=='present'].files[]|[?state=='edited'].path"
php_conf_files_edited: "{{ php_config | community.general.json_query('[?state==`present`].files[]|[?state==`edited`].path') | sort }}"