ansible / ansible.builtin / v2.4.6.0-1 / lookup / file read file contents | "added in version" 0.9 of ansible.builtin" Authors: Daniel Hokka Zakrisson <daniel@hozac.com>ansible.builtin.file (v2.4.6.0-1) — lookup
pip
Install with pip install ansible==2.4.6.0.post1
This lookup returns the contents from a file on the Ansible controller's file system.
- debug: msg="the value of foo.txt is {{lookup('file', '/etc/foo.txt') }}"
- name: display multiple file contents debug: var=item with_file: - "/path/to/foo.txt" - "bar.txt" # will be looked in files/ dir relative to play or in role - "/path/to/biz.txt"
_terms: description: path(s) of files to read required: true
_raw: description: - content of file(s)