Server IP : 85.193.89.191 / Your IP : 3.145.57.19 Web Server : Apache System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64 User : bitrix ( 600) PHP Version : 8.1.27 Disable Function : NONE MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /lib/python2.7/site-packages/ansible/plugins/inventory/ |
Upload File : |
� � �\c @` s� d d l m Z m Z m Z e Z d Z d d l Z d d l Z d d l m Z d d l m Z m Z d d l m Z d d l m Z d d l m Z m Z d d l m Z m Z d e e f d � � YZ d S( i ( t absolute_importt divisiont print_functions inventory: script version_added: "2.4" short_description: Executes an inventory script that returns JSON options: cache: description: Toggle the usage of the configured Cache plugin. default: False type: boolean ini: - section: inventory_plugin_script key: cache env: - name: ANSIBLE_INVENTORY_PLUGIN_SCRIPT_CACHE always_show_stderr: description: Toggle display of stderr even when script was successful version_added: "2.5.1" default: True type: boolean ini: - section: inventory_plugin_script key: always_show_stderr env: - name: ANSIBLE_INVENTORY_PLUGIN_SCRIPT_STDERR description: - The source provided must be an executable that returns Ansible inventory JSON - The source must accept C(--list) and C(--host <hostname>) as arguments. C(--host) will only be used if no C(_meta) key is present. This is a performance optimization as the script would be called per host otherwise. notes: - It takes the place of the previously hardcoded script inventory. - In order to function, it requires being whitelisted in configuration, which is true by default. N( t Mapping( t AnsibleErrort AnsibleParserError( t json_dict_bytes_to_unicode( t iteritems( t to_nativet to_text( t BaseInventoryPlugint Cacheablet InventoryModulec B` sD e Z d Z d Z d � Z d � Z d d � Z d � Z d � Z RS( sE Host inventory parser for ansible using external inventory scripts. t scriptc C` s# t t | � j � t � | _ d S( N( t superR t __init__t sett _hosts( t self( ( sD /usr/lib/python2.7/site-packages/ansible/plugins/inventory/script.pyR : s c C` s� t t | � j | � } | r� t } yC t | d � �. } | j d � } | j d � r` t } n Wd QXWn t k rz n Xt j | t j � r� | r� t } q� n | S( sP Verify if file is usable by this plugin, base does minimal accessibility check t rbi s #!N( R R t verify_filet Falset opent readt startswitht Truet Exceptiont ost accesst X_OK( R t patht validt shebang_presentt inv_filet initial_chars( ( sD /usr/lib/python2.7/site-packages/ansible/plugins/inventory/script.pyR @ s c C` s� t t | � j | | | � | j � | d k rD | j d � } n | d g } y| j | � } | sx | | j k r%y% t j | d t j d t j �} Wn8 t k r� } t d d j | � t | � f � � n X| j � \ } } t | � } t | pd � } | r+| j d � r+| d 7} n | j d k rSt d | | f � � n y t | d d �} Wn1 t k r�} t d j | t | � � � � n Xy | j j | � | j | <Wn4 t k r�} t d j | t | � | � � � n X| r%| j d � r%| j j d t | � � q%n | j | } t | t � s\t d j | | � � � n d } d } xR | j � D]D \ } } | d k r�d | k r�| d } q�qu| j | | � quWx� | j D]� } i } | d k r�| j | | � } nH y | j | i � } Wn/ t! k r;} t d | t | � f � � n X| j"