PATH:
usr
/
lib
/
python3.9
/
site-packages
/
ansible
/
modules
# -*- coding: utf-8 -*- # Copyright 2021 Red Hat # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = r''' --- module: validate_argument_spec short_description: Validate role argument specs. description: - This module validates role arguments with a defined argument specification. version_added: "2.11" options: argument_spec: description: - A dictionary like AnsibleModule argument_spec required: true provided_arguments: description: - A dictionary of the arguments that will be validated according to argument_spec author: - Ansible Core Team extends_documentation_fragment: - action_common_attributes - action_common_attributes.conn - action_common_attributes.flow attributes: action: support: full async: support: none become: support: none bypass_host_loop: support: none connection: support: none check_mode: support: full delegation: support: none diff_mode: support: none platform: platforms: all ''' EXAMPLES = r''' - name: verify vars needed for this task file are present when included ansible.builtin.validate_argument_spec: argument_spec: '{{required_data}}' vars: required_data: # unlike spec file, just put the options in directly stuff: description: stuff type: str choices: ['who', 'knows', 'what'] default: what but: description: i guess we need one type: str required: true - name: verify vars needed for this task file are present when included, with spec from a spec file ansible.builtin.validate_argument_spec: argument_spec: "{{lookup('ansible.builtin.file', 'myargspec.yml')['specname']['options']}}" - name: verify vars needed for next include and not from inside it, also with params i'll only define there block: - ansible.builtin.validate_argument_spec: argument_spec: "{{lookup('ansible.builtin.file', 'nakedoptions.yml'}}" provided_arguments: but: "that i can define on the include itself, like in it's `vars:` keyword" - name: the include itself vars: stuff: knows but: nobuts! ''' RETURN = r''' argument_errors: description: A list of arg validation errors. returned: failure type: list elements: str sample: - "error message 1" - "error message 2" argument_spec_data: description: A dict of the data from the 'argument_spec' arg. returned: failure type: dict sample: some_arg: type: "str" some_other_arg: type: "int" required: true validate_args_context: description: A dict of info about where validate_args_spec was used type: dict returned: always sample: name: my_role type: role path: /home/user/roles/my_role/ argument_spec_name: main '''
[-] getent.py
[edit]
[-] pause.py
[edit]
[-] iptables.py
[edit]
[+]
__pycache__
[-] import_playbook.py
[edit]
[-] stat.py
[edit]
[-] copy.py
[edit]
[-] slurp.py
[edit]
[-] service_facts.py
[edit]
[-] fetch.py
[edit]
[-] tempfile.py
[edit]
[-] pip.py
[edit]
[-] yum_repository.py
[edit]
[-] _include.py
[edit]
[-] assemble.py
[edit]
[-] user.py
[edit]
[-] sysvinit.py
[edit]
[-] lineinfile.py
[edit]
[-] find.py
[edit]
[-] replace.py
[edit]
[-] blockinfile.py
[edit]
[-] meta.py
[edit]
[-] hostname.py
[edit]
[-] reboot.py
[edit]
[-] shell.py
[edit]
[-] uri.py
[edit]
[-] script.py
[edit]
[-] async_status.py
[edit]
[-] include_vars.py
[edit]
[-] apt_repository.py
[edit]
[-] ping.py
[edit]
[-] expect.py
[edit]
[-] import_tasks.py
[edit]
[-] known_hosts.py
[edit]
[-] include_role.py
[edit]
[-] apt_key.py
[edit]
[-] apt.py
[edit]
[-] command.py
[edit]
[-] assert.py
[edit]
[-] subversion.py
[edit]
[-] cron.py
[edit]
[-] validate_argument_spec.py
[edit]
[-] wait_for.py
[edit]
[-] wait_for_connection.py
[edit]
[-] package.py
[edit]
[-] systemd.py
[edit]
[-] get_url.py
[edit]
[-] import_role.py
[edit]
[-] set_fact.py
[edit]
[-] group_by.py
[edit]
[-] yum.py
[edit]
[-] set_stats.py
[edit]
[-] dpkg_selections.py
[edit]
[-] add_host.py
[edit]
[-] fail.py
[edit]
[-] debug.py
[edit]
[-] debconf.py
[edit]
[-] setup.py
[edit]
[-] rpm_key.py
[edit]
[-] service.py
[edit]
[-] gather_facts.py
[edit]
[-] git.py
[edit]
[-] unarchive.py
[edit]
[-] include_tasks.py
[edit]
[+]
..
[-] async_wrapper.py
[edit]
[-] systemd_service.py
[edit]
[-] template.py
[edit]
[-] package_facts.py
[edit]
[-] raw.py
[edit]
[-] group.py
[edit]
[-] dnf.py
[edit]
[-] __init__.py
[edit]
[-] file.py
[edit]