
    Vh                    p    d dl mZ dZdZdZd dlmZ d dlmZ d dl	m
Z
 d dlmZ  e       Z G d	 d
e      Zy)    )annotationsa+  
    name: unvault
    author: Ansible Core Team
    version_added: "2.10"
    short_description: read vaulted file(s) contents
    description:
        - This lookup returns the contents from vaulted (or not) file(s) on the Ansible controller's file system.
    options:
      _terms:
        description: path(s) of files to read
        required: True
    notes:
      - This lookup does not understand 'globbing' nor shell environment variables.
    seealso:
      - ref: playbook_task_paths
        description: Search paths used for relative files.
z
- ansible.builtin.debug: msg="the value of foo.txt is {{ lookup('ansible.builtin.unvault', '/etc/foo.txt') | string | trim }}"
z_
  _raw:
    description:
      - content of file(s) as bytes
    type: list
    elements: raw
)AnsibleParserError)
LookupBase)to_text)Displayc                      e Zd ZddZy)LookupModuleNc                   g }| j                  ||       |D ]  }t        j                  d|z         | j                  |d|      }t        j	                  d|z         |r]| j
                  j                  |d      }t        |d      5 }|j                         }	d d d        |j                  t        	             t        d|z         |S # 1 sw Y   5xY w)	N)var_optionsdirectzUnvault lookup term: %sfileszUnvault lookup found %sT)decryptrbz"Unable to find file matching "%s" )set_optionsdisplaydebugfind_file_in_search_pathvvvv_loaderget_real_fileopenreadappendr   r   )
selfterms	variableskwargsretterm
lookupfileactual_filef
b_contentss
             N/home/dcms/DCMS/lib/python3.12/site-packages/ansible/plugins/lookup/unvault.pyrunzLookupModule.run-   s    Yv> 	VDMM3d:; 66y'4PJLL3j@A"ll88T8R+t, *!"J*

7:./()MPT)TUU	V 
* *s   	CC	)N)__name__
__module____qualname__r%        r$   r	   r	   +   s    r*   r	   N)
__future__r   DOCUMENTATIONEXAMPLESRETURNansible.errorsr   ansible.plugins.lookupr   +ansible.module_utils.common.text.convertersr   ansible.utils.displayr   r   r	   r)   r*   r$   <module>r3      s@    #$
 . - ? )
): r*   