Server IP : 85.193.89.191 / Your IP : 3.139.240.125 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 Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z m Z d d l m Z d d l m Z d e e f d � � YZ d S( i ( t absolute_importt divisiont print_functions� name: constructed plugin_type: inventory version_added: "2.4" short_description: Uses Jinja2 to construct vars and groups based on existing inventory. description: - Uses a YAML configuration file with a valid YAML or C(.config) extension to define var expressions and group conditionals - The Jinja2 conditionals that qualify a host for membership. - The JInja2 exprpessions are calculated and assigned to the variables - Only variables already available from previous inventories or the fact cache can be used for templating. - When I(strict) is False, failed expressions will be ignored (assumes vars were missing). options: plugin: description: token that ensures this is a source file for the 'constructed' plugin. required: True choices: ['constructed'] extends_documentation_fragment: - constructed s! # inventory.config file in YAML format plugin: constructed strict: False compose: var_sum: var1 + var2 # this variable will only be set if I have a persistent fact cache enabled (and have non expired facts) # `strict: False` will skip this instead of producing an error if it is missing facts. server_type: "ansible_hostname | regex_replace ('(.{6})(.{2}).*', '\\2')" groups: # simple name matching webservers: inventory_hostname.startswith('web') # using ec2 'tags' (assumes aws inventory) development: "'devel' in (ec2_tags|list)" # using other host properties populated in inventory private_only: not (public_dns_name is defined or ip_address is defined) # complex group membership multi_group: (group_names|intersection(['alpha', 'beta', 'omega']))|length >= 2 keyed_groups: # this creates a group per distro (distro_CentOS, distro_Debian) and assigns the hosts that have matching values to it, # using the default separator "_" - prefix: distro key: ansible_distribution # this creates a group per ec2 architecture and assign hosts to the matching ones (arch_x86_64, arch_sparc, etc) - prefix: arch key: ec2_architecture N( t constants( t AnsibleParserError( t get_group_vars( t FactCache( t BaseInventoryPlugint Constructable( t to_native( t combine_varst InventoryModulec B` s2 e Z d Z d Z d � Z d � Z e d � Z RS( s>