Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.11/site-packages/ansible/plugins/lookup/__pycache__/ |
Upload File : |
� ���c> � �~ � d dl mZmZmZ eZdZdZdZd dl Z d dl mZ d dlm Z d dlmZ d d lmZ G 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 � � e Zd Zdd�ZdS )�LookupModuleNc � � |�t d� � �| � ||�� � g }t |� � � � � }|D ]�}t |t � � s"t d|�dt |� � ��� � � t j |� � }n4# t $ r'}t d|�dt |� � ��� � �d }~ww xY w|D ],} |� | � � r|� | � � �-��|S )Nz No variables available to search)�var_options�directzInvalid setting identifier, "z" is not a string, it is a zUnable to use "z" as a search parameter: ) r �set_options�list�keys� isinstancer �type�re�compile� Exceptionr �search�append) �self�terms� variables�kwargs�ret�variable_names�term�name�e�varnames �D/usr/lib/python3.11/site-packages/ansible/plugins/lookup/varnames.py�runzLookupModule.run8 s> � ����A�B�B�B����Y�v��>�>�>����i�n�n�.�.�/�/��� (� (�D��d�L�1�1� x�"�l�ei�ei�ei�ko�pt�ku�ku�ku�#v�w�w�w� j��z�$�'�'����� j� j� j�"�l�UY�UY�UY�[d�ef�[g�[g�[g�#h�i�i�i����� j���� *� (� (���;�;�w�'�'� (��J�J�w�'�'�'�� (� � s �B� C�'"C � C)N)�__name__� __module__�__qualname__r$ � � r# r r 6 s( � � � � � �� � � � � r) r )� __future__r r r r � __metaclass__� DOCUMENTATION�EXAMPLES�RETURNr �ansible.errorsr �ansible.module_utils._textr �ansible.module_utils.sixr �ansible.plugins.lookupr r r( r) r# �<module>r3 s� �� C� B� B� B� B� B� B� B� B� B�� �� ���( �� � � � � '� '� '� '� '� '� 0� 0� 0� 0� 0� 0� 1� 1� 1� 1� 1� 1� -� -� -� -� -� -�� � � � �:� � � � � r)