403Webshell
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/inventory/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib/python3.11/site-packages/ansible/inventory/__pycache__/manager.cpython-311.pyc
�

���c2s���ddlmZmZmZeZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZddlmZddlmZmZmZddlmZddlmZdd	lmZmZdd
lmZddl m!Z!ddl"m#Z#dd
l$m%Z%ddl&m'Z'ddl(m)Z)ddl*m+Z+e'��Z,gd�Z-d�ej.D��Z/d�ej0D��Z1e	j2d�3e-e/ze1z����Z4e	j2de	j5��Z6d�Z7d�Z8Gd�de9��Z:dS)�)�absolute_import�division�print_functionN)�
attrgetter)�shuffle)�	constants)�AnsibleError�AnsibleOptionsError�AnsibleParserError)�
InventoryData)�string_types)�to_bytes�to_text)�
parse_address)�inventory_loader)�deduplicate_list)�unfrackpath)�Display)�combine_vars)�get_vars_from_inventory_sources)s^\.s^host_vars$s^group_vars$s^vars_plugins$c�,�g|]}t|����S�)r��.0�xs  �>/usr/lib/python3.11/site-packages/ansible/inventory/manager.py�
<listcomp>r0s��E�E�E�A�H�Q�K�K�E�E�E�c�V�g|]&}dttj|����z��'S)s%s$)r�re�escapers  rrr1s-��Q�Q�Q�A���"�)�A�,�,�/�/�/�Q�Q�Qr�|a>^
        (.+)                    # A pattern expression ending with...
        \[(?:                   # A [subscript] expression comprising:
            (-?[0-9]+)|         # A single positive or negative number
            ([0-9]+)([:-])      # Or an x:y or x: range.
            ([0-9]*)
        )\]
        $
    c���g}g}g}|D]^}|s�|ddkr|�|���'|ddkr|�|���I|�|���_|gkrdg}||z|zS)zS takes a list of patterns and reorders them by modifier to apply them consistently r�!�&�all)�append)�patterns�pattern_regular�pattern_intersection�pattern_exclude�ps     r�order_patternsr-Bs����O����O�
�	&�	&���	���Q�4�3�;�;��"�"�1�%�%�%�%�
�q�T�S�[�[� �'�'��*�*�*�*��"�"�1�%�%�%�%��"��� �'���1�1�O�C�Crc���t|t��r8d�|D��}ttj�|����St|t
��st
|d���}d|vr|�d��}nV	t|d���\}}|g}n=#t$r0tjt
d��|tj��}YnwxYwd�|D��S)	a�
    Takes a string containing host patterns separated by commas (or a list
    thereof) and returns a list of single patterns (which may not contain
    commas). Whitespace is ignored.

    Also accepts ':' as a separator for backwards compatibility, but it is
    not recommended due to the conflict with IPv6 addresses and host ranges.

    Example: 'a,b[1], c[2:3] , d' -> ['a', 'b[1]', 'c[2:3]', 'd']
    c3�4K�|]}t|��V��dS�N)�split_host_pattern�rr,s  r�	<genexpr>z%split_host_pattern.<locals>.<genexpr>ks+����:�:�Q�%�a�(�(�:�:�:�:�:�:r�surrogate_or_strict��errors�,T)�allow_rangesaJ(?:     # We want to match something comprising:
                        [^\s:\[\]]  # (anything other than whitespace or ':[]'
                        |           # ...or...
                        \[[^\]]*\]  # a single complete bracketed expression)
                    )+              # occurring once or more
                c�^�g|]*}|����|�����+Sr)�stripr2s  rrz&split_host_pattern.<locals>.<listcomp>�s-��5�5�5�!�1�7�7�9�9�5�A�G�G�I�I�5�5�5r)
�
isinstance�list�	itertools�chain�
from_iterabler
r�splitr�	Exceptionr �findall�X)�pattern�resultsr(�base�ports     rr1r1^s���'�4� � �A�:�:�'�:�:�:���I�O�1�1�'�:�:�;�;�;�
���
.�
.�A��'�*?�@�@�@���w����=�=��&�&���
	�(��t�D�D�D�L�T�4��y�H�H���	�	�	��z�����
�r�t�
��H�H�H�		����6�5�x�5�5�5�5s�B'�'7C!� C!c��eZdZdZd#d�Zed���Zed���Zed���Zd$d�Z	d	�Z
d
�Zd�Zd�Z
d
�Zd%d�Zd%d�Zd�Zd�Zd�Zd&d�Zd�Zd�Zd�Zd�Zd�Zd'd�Zd�Zd�Zd�Zd�Zd �Zd!�Z d"�Z!dS)(�InventoryManagerz Creates and manages inventory NTc��||_t��|_d|_d|_i|_i|_|�g|_n%t|t��r	|g|_n||_|r|�
|���g|_g|_dS)N��cache)
�_loaderr�
_inventory�_restriction�_subset�_hosts_patterns_cache�_pattern_cache�_sourcesr;r
�
parse_sources�_cached_dynamic_hosts�_cached_dynamic_grouping)�self�loader�sources�parserLs     r�__init__zInventoryManager.__init__�s������'�/�/���!������&(��"� ����?��D�M�M�
���
.�
.�	$�$�I�D�M�M�#�D�M��	,����U��+�+�+�%'��"�(*��%�%�%rc�6�|j�d��S)N�	localhost�rN�get_host�rWs rr]zInventoryManager.localhost�s����'�'��4�4�4rc��|jjSr0)rN�groupsr`s rrbzInventoryManager.groups�s
����%�%rc��|jjSr0)rN�hostsr`s rrdzInventoryManager.hosts�s
����$�$rc�:�|j�|||��Sr0)rN�add_host)rW�host�grouprGs    rrfzInventoryManager.add_host�s����'�'��e�T�:�:�:rc�6�|j�|��Sr0)rN�	add_group)rWrhs  rrjzInventoryManager.add_group�s����(�(��/�/�/rc�4�|j���Sr0)rN�get_groups_dictr`s rrlz InventoryManager.get_groups_dict�s����.�.�0�0�0rc�\�|���|j���Sr0)�clear_cachesrN�reconcile_inventoryr`s rroz$InventoryManager.reconcile_inventory�s(����������2�2�4�4�4rc�6�|j�|��Sr0r^)rW�hostnames  rr_zInventoryManager.get_host�s����'�'��1�1�1rc��t�d��g}tjD]K}t	j|��}|r|�|���.t�d|z���L|std���|S)z, sets up loaded inventory plugins for usage zsetting up inventory pluginsz,Failed to load inventory plugin, skipping %sz^No inventory plugins available to generate inventory, make sure you have at least one enabled.)	�display�vvvv�C�INVENTORY_ENABLEDr�getr'�warningr	)rW�plugins�name�plugins    r�_fetch_inventory_pluginsz)InventoryManager._fetch_inventory_plugins�s���	���3�4�4�4����'�	W�	W�D�%�)�$�/�/�F��
W����v�&�&�&�&���� N�QU� U�V�V�V�V��	A���A�A�
A��rFc
��d}|jD]6}|r2d|vrt|d���}|�||���}|r|sd}�7|r|j���nAt
jrtd���t
jrt�
d��|j���D]7}t|jt|j|j|gd����|_�8|j���D]7}t|jt|j|j|gd����|_�8d	S)
zA iterate over inventory sources and parse each one to populate itFr7)�followrKTzENo inventory was parsed, please check your configuration and options.z=No inventory was parsed, only implicit localhost is available�	inventoryN)rSr�parse_sourcerNroru�INVENTORY_UNPARSED_IS_FAILEDr	�INVENTORY_UNPARSED_WARNINGrsrxrb�valuesr�varsrrMrd)rWrL�parsed�sourcerZrhrgs       rrTzInventoryManager.parse_sources�s������m�	"�	"�F��
"��f�$�$�(���>�>�>�F��)�)�&��)�>�>���"��"�!�F���	a��O�/�/�1�1�1�1��-�
a�"�#j�k�k�k��-�
a���� _�`�`�`��[�'�'�)�)�	F�	F�E�%�e�j�2Q�RV�R^�`d�`m�pu�ov�yD�3E�3E�F�F�E�J�J��J�%�%�'�'�	C�	C�D�$�T�Y�0O�PT�P\�^b�^k�nr�ms�vA�1B�1B�C�C�D�I�I�	C�	Crc�z	�d}g}t�d|z��t|��}tj�|��r�t�d|z��t
tj|����D]�}t�d|z��t�	|��r�:ttj�||��d���}|�||���}t�d|�d	|����|s|}���ng||j
_|���D�]E}	tt!|	d
t!|	dd������}
t�d
|
�d|	j�d���	t%|	�|����}n#t($rd}YnwxYw|�r�	|	�|j
|j||���	|	���n#t0$rYnwxYwd}t�d|�d|
�d����nH#t4$r�}t�|�d|
����d�t7jt;j��d����}
|�||
||
d���Yd}~���d}~wt($r�}t�|
�d|����d�t7jt;j��d����}
|�||
tA|��|
d���Yd}~��d}~wwxYwt�|
�d|�d�����G|r*|j
j!�|j
j��n�|dkstj�"|��r�|r�|D]�}t�#dt|d���d|d�d t|d!������d"|vr-t�t|d"������tHj%rtAd#|z���t�#d$|z��d|j
_|S)%z6 Generate or update inventory for the source provided Fz'Examining possible inventory source: %sz.Searching for inventory files in directory: %szConsidering %sr4r5rKzparsed z as �
_load_name�_original_path�zAttempting to use plugin z (�)TzParsed z inventory source with z pluginz was not parsable by �)�srcr{�exc�tbNz" failed while attempting to parse z declined parsing z, as it did not pass its verify_file() methodz/etc/ansible/hostsz
* Failed to parse r�z with r{z	 plugin: r�r�z.Completely failed to parse inventory source %sz)Unable to parse %s as an inventory source)&rs�debugr�os�path�isdir�sorted�listdir�IGNORED�searchr�joinr�rN�current_sourcer|�getattrr��bool�verify_filerArZrM�update_cache_if_changed�AttributeError�vvvr�	traceback�	format_tb�sys�exc_infor'r	�processed_sources�existsrxru� INVENTORY_ANY_UNPARSED_IS_FAILED)rWr�rLr��failures�b_source�i�fullpath�parsed_this_oner{�plugin_name�plugin_wants�er��fails               rr�zInventoryManager.parse_source�s+�������
�
�@�6�I�J�J�J��F�#�#���7�=�=��"�"�6	~��M�M�K�f�T�U�U�U��B�J�x�0�0�1�1�
-�
-���
�
�/�!�3�4�4�4��>�>�!�$�$���#�2�7�<�<��!�#<�#<�EZ�[�[�[��"&�"3�"3�H�E�"3�"J�"J���
�
�
�H�H�H�o�o�N�O�O�O��-�,�F��
-�".4�D�O�*��7�7�9�9� 
~� 
~��%�g�f�l�G�F�Td�fh�Di�Di�&j�&j�k�k���
�
�
�[�[�[�RX�Rg�Rg�Rg�h�i�i�i�)�#'��(:�(:�6�(B�(B�#C�#C�L�L�� �)�)�)�#(�L�L�L�)���� �~�r����T�_�d�l�F�RW��X�X�X�!�"�:�:�<�<�<�<��-�!�!�!� �D�!����"&������SY�SY�SY�[f�[f�[f�$g�h�h�h����-�d�d�d��
�
�V�V�V�[�[�&Y�Z�Z�Z��W�W�Y�%8������9J�%K�%K�L�L�� ����+�VW�_a�(b�(b�c�c�c�c�c�c�c�c�����$�r�r�r��
�
�R]�R]�R]�_e�_e�&f�g�g�g��W�W�Y�%8������9J�%K�%K�L�L�� ����+�Vb�cd�Ve�Ve�mo�(p�(p�q�q�q�q�q�q�q�q�����r����
�K�K�hs�hs�hs�u{�u{�u{� |�}�}�}�}��	Z��O�-�4�4�T�_�5S�T�T�T�T��-�-�-������1G�1G�-��=� (�=�=������X_�`d�ej�`k�Xl�Xl�Xl�Xl�nr�s{�n|�n|�n|�F�GK�LQ�GR�S�S�S�)T�U�U�U��4�<�<�#�K�K���T�
�(;�(;�<�<�<���5�Z�&�'X�\b�'c�d�d�d��O�O�$O�RX�$X�Y�Y�Y�*.���&��
s\�,"G�G�G�%#I�	H�I�
H+�(I�*H+�+&I�
M7�A7K�
M7�(BM2�2M7c�"�i|_i|_dS)z clear all caches N)rQrRr`s rrnzInventoryManager.clear_cachesRs��%'��"� ����rc��|���t��|_|�d���|jD]}|�|ddi���|jD] \}}d|d<|�||���!dS)z recalculate inventory FrK�refreshTN)rnrrNrTrU�add_dynamic_hostrV�add_dynamic_group)rWrg�results   r�refresh_inventoryz"InventoryManager.refresh_inventoryWs���	
������'�/�/��������'�'�'��.�	;�	;�D��!�!�$��D�(9�:�:�:�:� �9�	1�	1�L�D�&� $�F�9���"�"�4��0�0�0�0�	1�	1rc�J�	|ddks'tjtj|����}ntj|dd���}n #t$rtd|z���wxYwg}|D],}|�|��r|�|���-|S)Nr�~�zInvalid host list pattern: %s)r �compile�fnmatch�	translaterAr	�matchr')rW�items�pattern_strrDrE�items      r�_match_listzInventoryManager._match_listcs���	N��q�>�S�(�(��*�W�%6�{�%C�%C�D�D����*�[����_�5�5�����	N�	N�	N��>��L�M�M�M�	N�������	%�	%�D��}�}�T�"�"�
%����t�$�$�$���s�AA�A/r&c�|��	�g}t|t��r|dd�}n|g}|�r�|s!�jr|��j��|s!�jr|��j��t|��}|�jvr�t|��}��|��}|sF�jr?td����j��D�����	�	fd�|D��}|s�jr�fd�|D��}t|���j|<|dvr7t�j|dd�td��|dk���}n^|d	kr�j|ddd
�}nA�j|dd�}|dkrt|��n|dvrtd
|z���|S)z�
        Takes a pattern or list of patterns and returns a list of matching
        inventory host names, taking into account any active restrictions
        or applied subsets
        Nc3�$K�|]}|jV��dSr0��_uuid)r�ss  rr3z-InventoryManager.get_hosts.<locals>.<genexpr>�s$����&^�&^�1�q�w�&^�&^�&^�&^�&^�&^rc�&��g|]
}|j�v�|��Srr�)r�h�subset_uuidss  �rrz.InventoryManager.get_hosts.<locals>.<listcomp>�s%���I�I�I�1���L�1H�1H�Q�1H�1H�1Hrc�0��g|]}|j�jv�|��Sr)rzrO)rr�rWs  �rrz.InventoryManager.get_hosts.<locals>.<listcomp>�s(���M�M�M�1���4�;L�1L�1L�Q�1L�1L�1Lr)r��reverse_sortedrzr�)�key�reverse�reverse_inventory���r)Nrz1Invalid 'order' specified for inventory hosts: %s)r;r<rP�extendrO�tuplerQr1�_evaluate_patterns�setrr�rrr
)
rWrD�
ignore_limits�ignore_restrictions�orderrd�pattern_list�pattern_hashr(r�s
`        @r�	get_hostszInventoryManager.get_hoststs:�������g�t�$�$�	%�"�1�1�1�:�L�L�#�9�L��&	k� �
2�T�\�
2��#�#�D�L�1�1�1�&�
7�4�+<�
7��#�#�D�$5�6�6�6�!��.�.�L��4�#=�=�=�-�g�6�6���/�/��9�9��%�J���J�#&�&^�&^��8O�8O�PT�P\�8]�8]�&^�&^�&^�#^�#^�L�I�I�I�I��I�I�I�E�*�N�t�/@�N�M�M�M�M��M�M�M�E�;K�E�;R�;R��*�<�8��4�4�4��t�9�,�G����J�PZ�[a�Pb�Pb�mr�wG�nG�I�I�I����-�-�-��2�<�@���2��F����2�<�@����C���I�%�%��E�N�N�N�N��"5�5�5�-�.a�di�.i�j�j�j��rc�����t|��}g}|D]�}||jjvr.|�|j�|�����>|�|���|ddkrt
�����fd�|D��}�}|ddkrt
�����fd�|D��}��t
d�|D�����|��fd��D������|S)z�
        Takes a list of patterns and returns a list of matching host names,
        taking into account any negative and intersection patterns.
        rr$c���g|]}|�v�|��	Srr�rr��thats  �rrz7InventoryManager._evaluate_patterns.<locals>.<listcomp>�s���?�?�?�1��$���Q���rr%c���g|]}|�v�|��	Srrr�s  �rrz7InventoryManager._evaluate_patterns.<locals>.<listcomp>�s���;�;�;�1��d���Q���rc3�$K�|]}|jV��dSr0�rz)r�ys  rr3z6InventoryManager._evaluate_patterns.<locals>.<genexpr>�s$����(?�(?�A���(?�(?�(?�(?�(?�(?rc�&��g|]
}|j�v�|��Srr�)rr��existing_hostss  �rrz7InventoryManager._evaluate_patterns.<locals>.<listcomp>�s%���!R�!R�!R��Q�V�>�5Q�5Q�!�5Q�5Q�5Qr)r-rNrdr'r_�_match_one_patternr�r�)rWr(rdr,r�r�s    @@rr�z#InventoryManager._evaluate_patterns�s"����"�(�+�+�����	T�	T�A��D�O�)�)�)����T�_�5�5�a�8�8�9�9�9�9��.�.�q�1�1���Q�4�3�;�;��t�9�9�D�?�?�?�?��?�?�?�E�E��q�T�S�[�[��t�9�9�D�;�;�;�;��;�;�;�E�E�%(�(?�(?��(?�(?�(?�%?�%?�N��L�L�!R�!R�!R�!R�T�!R�!R�!R�S�S�S�S��rc�4�|ddvr
|dd�}||jvro|�|��\}}|�|��}	|�||��}n #t$rtd|z���wxYw||j|<|j|S)a�
        Takes a single pattern and returns a list of matching host names.
        Ignores intersection (&) and exclusion (!) specifiers.

        The pattern may be:

            1. A regex starting with ~, e.g. '~[abc]*'
            2. A shell glob pattern with ?/*/[chars]/[!chars], e.g. 'foo*'
            3. An ordinary word that matches itself only, e.g. 'foo'

        The pattern is matched using the following rules:

            1. If it's 'all', it matches all hosts in all groups.
            2. Otherwise, for each known group name:
                (a) if it matches the group name, the results include all hosts
                    in the group or any of its children.
                (b) otherwise, if it matches any hosts in the group, the results
                    include the matching hosts.

        This means that 'foo*' may match one or more groups (thus including all
        hosts therein) but also hosts in other groups.

        The built-in groups 'all' and 'ungrouped' are special. No pattern can
        match these group names (though 'all' behaves as though it matches, as
        described above). The word 'ungrouped' can match a host of that name,
        and patterns like 'ungr*' and 'al*' can match either hosts or groups
        other than all and ungrouped.

        If the pattern matches one or more group names according to these rules,
        it may have an optional range suffix to select a subset of the results.
        This is allowed only if the pattern is not a regex, i.e. '~foo[1]' does
        not work (the [1] is interpreted as part of the regex), but 'foo*[1]'
        would work if 'foo*' matched the name of one or more groups.

        Duplicate matches are always eliminated from the results.
        r)r%r$r�Nz-No hosts matched the subscripted pattern '%s')rR�_split_subscript�_enumerate_matches�_apply_subscript�
IndexErrorr	)rWrD�expr�slicerds     rr�z#InventoryManager._match_one_pattern�s���L�1�:��#�#��a�b�b�k�G��$�-�-�-� �1�1�'�:�:�M�T�5��+�+�D�1�1�E�
^��-�-�e�U�;�;�����
^�
^�
^�"�#R�U\�#\�]�]�]�
^����+0�D���(��"�7�+�+s�A#�#Bc�F�|ddkr|dfSd}t�|��}|rp|���\}}}}}|rt|��df}nB|sd}t|��t|��f}|dkrt�d��||fS)aa
        Takes a pattern, checks if it has a subscript, and returns the pattern
        without the subscript and a (start,end) tuple representing the given
        subscript (or None if there is no subscript).

        Validates that the subscript is in the right syntax, but doesn't make
        sure the actual indices make sense in context.
        rr�Nr��-zFUse [x:y] inclusive subscripts instead of [x-y] which has been removed)�PATTERN_WITH_SUBSCRIPTr�rb�intrsrx)rWrD�	subscript�m�idx�start�sep�ends        rr�z!InventoryManager._split_subscript�s����1�:�����T�?�"��	�"�(�(��1�1���		n�./�h�h�j�j�+�W�c�5�#�s��
n� ��X�X�t�,�	�	����C� ��Z�Z��S���2�	��#�:�:��O�O�$l�m�m�m���#�#rc�x�|r|s|S|\}}|r%|dkrt|��dz
}|||dz�S||gS)z�
        Takes a list of hosts and a (start,end) tuple and returns the subset of
        hosts based on the subscript (which may be None to return all hosts).
        r�r�)�len)rWrdr�r�r�s     rr�z!InventoryManager._apply_subscripts`���	�I�	��L� �����	"��b�y�y��%�j�j�1�n����s�Q�w��'�'��%�L�>�!rc���g}|�|jj���}|r<|D]9}|�|jj|������:|r'�ddkst�fd�dD����rL|�|jj���}|r*|D]'}|�|jj|���(|s?�tj	vr1|j�
���}|r|�|��|sq|so�dkrid�z}t�|��tj
dkrt�|��ntj
dkrt|���|S)	z�
        Returns a list of host names matching the given pattern according to the
        rules explained above in _match_one_pattern.
        rr�c3� �K�|]}|�vV��	dSr0r)r�specialrDs  �rr3z6InventoryManager._enumerate_matches.<locals>.<genexpr><s)�����:r�:r�RY�7�g�;M�:r�:r�:r�:r�:r�:rr)�.�?�*�[r&z3Could not match supplied host pattern, ignoring: %srx�error)r�rNrbr�r��anyrdr'ru�	LOCALHOSTr_rsr��HOST_PATTERN_MISMATCHrxr	)	rWrDrE�matching_groups�	groupname�matching_hostsrq�implicit�msgs	 `       rr�z#InventoryManager._enumerate_matches.s�������*�*�4�?�+A�7�K�K���	N�,�
N�
N�	����t��5�i�@�J�J�L�L�M�M�M�M��	D�'�!�*��"3�"3�s�:r�:r�:r�:r�]q�:r�:r�:r�7r�7r�"3�!�-�-�d�o�.C�W�M�M�N��
D� .�D�D�H��N�N�4�?�#8��#B�C�C�C�C��	)�7�a�k�1�1���/�/��8�8�H��
)����x�(�(�(��	(��	(�7�e�3C�3C�G�'�Q�C��M�M�#�����&�)�3�3�����$�$�$�$��(�G�3�3�"�3�'�'�'��rc�x�|�|��}t|��dkr|tjvr|g}|S)z* return a list of hostnames for a pattern r)r�r�rur)rWrDr�s   r�
list_hostszInventoryManager.list_hostsUs@������(�(���v�;�;�!����1�;� 6� 6��Y�F��
rc�X�t|jj�����Sr0)r�rNrb�keysr`s r�list_groupszInventoryManager.list_groups`s!���d�o�,�1�1�3�3�4�4�4rc�z�|�dSt|t��s|g}td�|D����|_dS)z�
        Restrict list operations to the hosts given in restriction.  This is used
        to batch serial operations in main playbook code, don't use this for other
        reasons.
        Nc3�>K�|]}t|j��V��dSr0)rrz)rr�s  rr3z5InventoryManager.restrict_to_hosts.<locals>.<genexpr>ns*����E�E�A������E�E�E�E�E�Er)r;r<r�rO)rW�restrictions  r�restrict_to_hostsz"InventoryManager.restrict_to_hostsdsM�����F��K��.�.�	(�&�-�K��E�E��E�E�E�E�E����rc��|�	d|_dSt|��}g}|D�]}|s�|ddkr�t|dd���}tj�|��st
d|z���tj�|��st
d|z���t|��5}|�	d�|�
���d��D����ddd��n#1swxYwY��|�t|������||_dS)	a0
        Limits inventory results to a subset of inventory that matches a given
        pattern, such as to select a given geographic of numeric slice amongst
        a previous 'hosts' selection that only select roles, or vice versa.
        Corresponds to --limit parameter to ansible-playbook
        Nr�@r�zUnable to find limit file %sz;Limit starting with "@" must be a file, not a directory: %sc�P�g|]#}t|�������$Sr)rr:)r�ls  rrz+InventoryManager.subset.<locals>.<listcomp>�s(��'Z�'Z�'Z�q�����	�	�(:�(:�'Z�'Z�'Zr�
)rPr1rr�r�r�r	�isfile�openr��readr@r'r)rW�subset_pattern�subset_patternsrEr�b_limit_file�fds       r�subsetzInventoryManager.subsetps����!��D�L�L�L�0��@�@�O��G�$�

/�

/������Q�4�3�;�;�#+�A�a�b�b�E�?�?�L��7�>�>�,�7�7�[�*�+J�\�+Y�Z�Z�Z��7�>�>�,�7�7�z�*�+i�lx�+x�y�y�y��l�+�+�\�r����'Z�'Z�B�G�G�I�I�O�O�TX�DY�DY�'Z�'Z�'Z�[�[�[�\�\�\�\�\�\�\�\�\�\�\����\�\�\�\���N�N�7�1�:�:�.�.�.�.�"�D�L�L�Ls�9AD
�
D	�D	c��d|_dS)z! Do not restrict list operations N)rOr`s r�remove_restrictionz#InventoryManager.remove_restriction�s�� ����rc��i|_dSr0)rRr`s r�clear_pattern_cachez$InventoryManager.clear_pattern_cache�s�� ����rc���d}|�d��s|j�|��|�r/|�d��}||jvr|�|d��d}|j�|��}|���}t
||�dt������}||kr	||_d}|�dg��}|D]V}	|	|j	vr|j
�|	��}	d}|j	|	}
|
�|j|��rd}�W|r|���||d<d	Sd	S)
zX
        Helper function to add a new host to inventory based on a task result.
        Fr��	host_namer&T�	host_varsrb�changedN)
rwrUr'rdrf�get_varsr�dictr�rbrNrjro)rW�	host_info�result_itemr%r#�new_host�
new_host_vars�new_host_combined_vars�
new_groups�
group_name�	new_groups           rr�z!InventoryManager.add_dynamic_host�s���
�����y�)�)�	9��&�-�-�i�8�8�8��	-�!�
�
�k�2�2�I���
�*�*��
�
�i��/�/�/����z�~�~�i�0�0�H�%�-�-�/�/�M�%1�-����{�\`�\b�\b�Ac�Ac�%d�%d�"�� 6�6�6� 6��
���"���x��4�4�J�(�
#�
#�
��T�[�0�0�!%��!:�!:�:�!F�!F�J�"�G� �K�
�3�	��%�%�d�j��&;�<�<�#�"�G���
+��(�(�*�*�*�%,�K�	�"�"�"�;	-�	-rc��d}|�d��s|j�||f��|j�|j��}|�K|j|jjkr|j}n.|�d��st
d|jz���dS|�d��}|�dg��}||jvr|�|��}|D]"}||jvr|�|��d}�#|j	j|}|D]*}	|j|	}
|
�
|��}|r|sd}�+||���vr|�|��}||�
��vr|�|��}|r|���||d<dS)	z�
        Helper function to add a group (if it does not exist), and to assign the
        specified host to that group.
        Fr�Nz!%s cannot be matched in inventoryrj�
parent_groupsTr%)rwrVr'rdrzr]r	rbrjrN�add_child_groupr�rf�
get_groupsro)rWrgr)r%�	real_hostr.�parent_group_namesrzrh�parent_group_name�parent_group�news            rr�z"InventoryManager.add_dynamic_group�s��������y�)�)�	F��)�0�0�$��1D�E�E�E�
�J�N�N�4�9�-�-�	����y�D�N�/�/�/� �N�	�	� �_�_�Y�/�/�
�"�#F���#R�S�S�S��� �_�_�[�1�1�
�(�_�_�_�b�A�A���T�[�(�(����
�3�3�J�&�	�	�D��4�;�&�&����t�$�$�$������&�z�2��!3�	�	���;�'8�9�L��.�.�u�5�5�C��
�7�
�����E�O�O�-�-�-�-��n�n�Y�/�/�G��	�,�,�.�.�.�.��)�)�%�0�0�G��	'��$�$�&�&�&�!(��I���r)NTT)NN)F)r&FFN)r&)"�__name__�
__module__�__qualname__�__doc__r[�propertyr]rbrdrfrjrlror_r|rTr�rnr�r�r�r�r�r�r�r�r	rrrrr!r�r�rrrrIrI�s ������)�)�+�+�+�+�:�5�5��X�5��&�&��X�&��%�%��X�%�;�;�;�;�0�0�0�1�1�1�5�5�5�2�2�2����$C�C�C�C�8Z�Z�Z�Z�x!�!�!�

1�
1�
1����"7�7�7�7�r���42,�2,�2,�h$�$�$�B"�"�"�$%�%�%�N	�	�	�	�5�5�5�
F�
F�
F�#�#�#�:!�!�!�!�!�!�&-�&-�&-�P4)�4)�4)�4)�4)rrI);�
__future__rrr�type�
__metaclass__r�r�r�r r=r��operatorr�randomr�ansiblerru�ansible.errorsr	r
r�ansible.inventory.datar�ansible.module_utils.sixr
�ansible.module_utils._textrr�ansible.parsing.utils.addressesr�ansible.plugins.loaderr�ansible.utils.helpersr�ansible.utils.pathr�ansible.utils.displayr�ansible.utils.varsr�ansible.vars.pluginsrrs�IGNORED_ALWAYS�INVENTORY_IGNORE_PATTERNS�IGNORED_PATTERNS�INVENTORY_IGNORE_EXTS�IGNORED_EXTSr�r�r�rCr�r-r1�objectrIrrr�<module>rUs`��&C�B�B�B�B�B�B�B�B�B��
�����	�	�	�	�
�
�
�
�	�	�	�	���������������������"�"�"�"�"�"�P�P�P�P�P�P�P�P�P�P�0�0�0�0�0�0�1�1�1�1�1�1�8�8�8�8�8�8�8�8�9�9�9�9�9�9�3�3�3�3�3�3�2�2�2�2�2�2�*�*�*�*�*�*�)�)�)�)�)�)�+�+�+�+�+�+�@�@�@�@�@�@�
�'�)�)��N�N�N��E�E��)D�E�E�E��Q�Q��9P�Q�Q�Q��
�"�*�T�Y�Y�~�0@�@�<�O�P�P�
Q�
Q��#����
��
�
��D�D�D�8+6�+6�+6�\d	)�d	)�d	)�d	)�d	)�v�d	)�d	)�d	)�d	)�d	)r

Youez - 2016 - github.com/yon3zu
LinuXploit