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

Verify tasks in seperate file

parent 610bc075
No related branches found
No related tags found
1 merge request!1Merge Sury
Pipeline #27094 passed
......@@ -258,6 +258,10 @@ argument_specs:
elements: str
required: false
description: A generated list of PHP versions which should be present.
php_verify:
type: bool
required: false
description: Varify all variables starting with php_ using the argument spec.
php_versions:
type: list
elements: dict
......
......@@ -11,20 +11,13 @@
- name: PHP
block:
- name: Debug the hostvars variable names that start with php_
ansible.builtin.debug:
var: phpvarnames
verbosity: "{% if ansible_check_mode | bool %}3{% else %}4{% endif %}"
- name: Debug the hostvars variable names that start with php_
ansible.builtin.debug:
var: phphostvars
verbosity: "{% if ansible_check_mode | bool %}3{% else %}4{% endif %}"
- 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 PHP verify variables tasks
ansible.builtin.include_tasks: verify.yml
when:
- php_verify is defined
- php_verify | bool
tags:
- php_verify
- name: Include apt role local fact tasks
ansible.builtin.include_role:
......
# Copyright 2019-2023 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/>.
---
- name: Verify PHP variables
block:
- name: Debug the hostvars variable names that start with php_
ansible.builtin.debug:
var: phpvarnames
verbosity: "{% if ansible_check_mode | bool %}3{% else %}4{% endif %}"
- name: Debug the hostvars variable names that start with php_
ansible.builtin.debug:
var: phphostvars
verbosity: "{% if ansible_check_mode | bool %}3{% else %}4{% endif %}"
- 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 }}"
when:
- php_verify is defined
- php_verify | bool
tags:
- php
- pgp_verify
...
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