a )g@snddlmZmZmZeZdZdZdZddl m Z ddl m Z ddl mZddlmZeZGd d d e Zd S) )absolute_importdivisionprint_functiona 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. 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@seZdZdddZdS) LookupModuleNc Ksg}|j||d|D]}td|||d|}td||r|jj|dd}t|d}|} Wdn1s0Y| t | qt d|q|S) N)Z var_optionsZdirectzUnvault lookup term: %sfileszUnvault lookup found %sT)Zdecryptrbz"Unable to find file matching "%s" ) Z set_optionsdisplaydebugZfind_file_in_search_pathZvvvvZ_loaderZ get_real_fileopenreadappendrr) selfZtermsZ variableskwargsretZtermZ lookupfileZ actual_filefZ b_contentsrB/usr/lib/python3.9/site-packages/ansible/plugins/lookup/unvault.pyrun+s &zLookupModule.run)N)__name__ __module__ __qualname__rrrrrr )sr N)Z __future__rrrtypeZ __metaclass__Z DOCUMENTATIONZEXAMPLESZRETURNZansible.errorsrZansible.plugins.lookuprZansible.module_utils._textrZansible.utils.displayrr r rrrrs