�
�Udac @` s� d d l m Z m Z m Z e Z d Z d d l Z d d l m Z
d d l m Z d d l
m Z m Z m Z d d l m Z d d l m Z d d l m Z d d
l m Z i Z d e f d � � YZ d S(
i ( t absolute_importt divisiont print_functions�
vars: host_group_vars
version_added: "2.4"
short_description: In charge of loading group_vars and host_vars
description:
- Loads YAML vars into corresponding groups/hosts in group_vars/ and host_vars/ directories.
- Files are restricted by extension to one of .yaml, .json, .yml or no extension.
- Hidden (starting with '.') and backup (ending with '~') files and directories are ignored.
- Only applies to inventory sources that are existing paths.
options:
_valid_extensions:
default: [".yml", ".yaml", ".json"]
description:
- "Check all of these extensions when looking for 'variable' files which should be YAML or JSON or vaulted versions of these."
- 'This affects vars_files, include_vars, inventory and vars plugins among others.'
env:
- name: ANSIBLE_YAML_FILENAME_EXT
ini:
- section: yaml_valid_extensions
key: defaults
type: list
N( t constants( t AnsibleParserError( t to_bytest to_nativet to_text( t BaseVarsPlugin( t Host( t Group( t combine_varst
VarsModulec B` s e Z e d � Z RS( c C` s t | t � s | g } n t t | � j | | | � i } x�| D]�} t | t � rb d } n. t | t � rz d } n t d t | � � � | j j
t j j
� sD y-g } t j j t t j j | j | � � � } t | � }
d | j |
f } | r| t k rt | } nw t j j | � r�t j j | � rs| j j d |
� | j |
| j � } | t | <q�| j j d | |
f � n xA | D]9 } | j | d t d t �}
|
r�t | |
� } q�q�WWq t k
r�} t t | � � � q XqD qD W| S( s parses the inventory file t host_varst
group_varss5 Supplied entity must be Host or Group, got %s insteads %s.%ss processing dir %ss. Found %s that is not a directory, skipping: %st cachet unsafe( t
isinstancet listt superR t get_varsR R
R t typet namet
startswitht ost patht sept realpathR t joint _basedirR t FOUNDt existst isdirt _displayt debugt find_vars_filest warningt load_from_filet TrueR t ExceptionR ( t selft loaderR t entitiesR t datat entityt subdirt found_filest b_opatht opatht keyt foundt new_datat e( ( sH /usr/lib/python2.7/site-packages/ansible/plugins/vars/host_group_vars.pyR : s>