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� � �z � d dl mZmZmZ eZdZdZdZd dl m Z d dlmZm Z d dlmZ d dlmZ G d � d e� � ZdS )� )�absolute_import�division�print_functionaf name: nested version_added: "1.1" short_description: composes a list with nested elements of other lists description: - Takes the input lists and returns a list with elements that are lists composed of the elements of the input lists options: _raw: description: - a set of lists required: True as - name: give users access to multiple databases community.mysql.mysql_user: name: "{{ item[0] }}" priv: "{{ item[1] }}.*:ALL" append_privs: yes password: "foo" with_nested: - [ 'alice', 'bob' ] - [ 'clientdb', 'employeedb', 'providerdb' ] # As with the case of 'with_items' above, you can use previously defined variables.: - name: here, 'users' contains the above list of employees community.mysql.mysql_user: name: "{{ item[0] }}" priv: "{{ item[1] }}.*:ALL" append_privs: yes password: "foo" with_nested: - "{{ users }}" - [ 'clientdb', 'employeedb', 'providerdb' ] zr _list: description: - A list composed of lists paring the elements of the input lists type: list )�UndefinedError)�AnsibleError�AnsibleUndefinedVariable)� LookupBase)�listify_lookup_plugin_termsc � � e Zd Zd� Zdd�ZdS )�LookupModulec � � g }|D ]T} t || j d�� � }n$# t $ r}t d|z � � �d }~ww xY w|� |� � �U|S )NT)�templar�fail_on_undefinedz<One of the nested variables was undefined. The error was: %s)r �_templarr r �append)�self�terms� variables�results�x�intermediate�es �B/usr/lib/python3.11/site-packages/ansible/plugins/lookup/nested.py�_lookup_variableszLookupModule._lookup_variables; s� � ���� )� )�A� s�:�1�d�m�gk�l�l�l����!� s� s� s�.�/m�pq�/q�r�r�r����� s�����N�N�<�(�(�(�(��s � � A�<�ANc �� � | � ||� � }|d d � }|� � � g }t |� � dk rt d� � �|� � � }t |� � dk r=| � ||� � � � � }|}t |� � dk �=g }|D ]*}|� | � |� � � � �+|S )Nr z<with_nested requires at least one element in the nested list)r �reverse�lenr �pop�_combiner �_flatten) r r r �kwargs�my_list�result�result2� new_resultr s r �runzLookupModule.runE s� � ��&�&�u�i�8�8������(�����������w�<�<�1����]�^�^�^��������'�l�l�Q����m�m�F�G�K�K�M�M�:�:�G��F� �'�l�l�Q��� � �� 0� 0�A����d�m�m�A�.�.�/�/�/�/��� )N)�__name__� __module__�__qualname__r r&