Skip to content
Snippets Groups Projects
Verified Commit 4e9366c0 authored by Chris Croome's avatar Chris Croome
Browse files

Add ansible.builtin.validate_argument_spec check

parent 944392ff
No related branches found
No related tags found
1 merge request!1Merge Sury
Pipeline #26605 passed
......@@ -11,6 +11,21 @@
- name: PHP
block:
- name: Debug the hostvars variable names that start with php_
ansible.builtin.debug:
var: phpvarnames
verbosity: 3
- name: Debug the hostvars variable names that start with php_
ansible.builtin.debug:
var: phphostvars
verbosity: 2
- name: Check php_ variables using meta/argument_specs.yml
ansible.builtin.validate_argument_spec:
argument_spec: "{{ (lookup('ansible.builtin.file', 'meta/argument_specs.yml') | from_yaml )['argument_specs']['main']['options'] }}"
provided_arguments: "{{ phphostvars }}"
- name: Include apt role local fact tasks
ansible.builtin.include_role:
name: apt
......
......@@ -8,6 +8,10 @@
#
# 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/>.
---
# https://docs.ansible.com/ansible/latest/playbook_guide/complex_data_manipulation.html
phpvarnames: "{{ q('varnames', '^php_') }}"
phphostvars: "{{ dict(phpvarnames | list | zip(q('vars', *phpvarnames))) }}"
php_file_path_separator: '/'
# PHP versions absent
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment