ansible / ansible.builtin / v2.15.2 / module / slurp Slurps a file from remote nodes | "added in version" historical of ansible.builtin" Authors: Ansible Core Team, Michael DeHaan (@mpdehaan)ansible.builtin.slurp (v2.15.2) — module
pip
Install with pip install ansible-core==2.15.2
This module works like M(ansible.builtin.fetch). It is used for fetching a base64- encoded blob containing the data in a remote file.
This module is also supported for Windows targets.
- name: Find out what the remote machine's mounts are ansible.builtin.slurp: src: /proc/mounts register: mounts
- name: Print returned information ansible.builtin.debug: msg: "{{ mounts['content'] | b64decode }}"
src: aliases: - path description: - The file on the remote system to fetch. This I(must) be a file, not a directory. required: true type: path
content: description: Encoded file content returned: success sample: MjE3OQo= type: str encoding: description: Type of encoding used for file returned: success sample: base64 type: str source: description: Actual path of file slurped returned: success sample: /var/run/sshd.pid type: str