o nnh@sbddlmZdZdZdZddlmZddlmZddl m Z ddl m Z e Z Gd d d eZd S) ) 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@seZdZdddZdS) LookupModuleNc Ksg}|j||d|D]G}td|||d|}td||rM|jj|dd}t|d }|} Wdn1s@wY| t | q t d||S) N) var_optionsdirectzUnvault lookup term: %sfileszUnvault lookup found %sT)decryptrbz"Unable to find file matching "%s" ) set_optionsdisplaydebugfind_file_in_search_pathvvvv_loader get_real_fileopenreadappendrr) selfterms variableskwargsretterm lookupfile actual_filef b_contentsr!I/usr/local/lib/python3.10/dist-packages/ansible/plugins/lookup/unvault.pyrun-s   zLookupModule.run)N)__name__ __module__ __qualname__r#r!r!r!r"r+srN) __future__r DOCUMENTATIONEXAMPLESRETURNansible.errorsransible.plugins.lookupr+ansible.module_utils.common.text.convertersransible.utils.displayrrrr!r!r!r"s