ansible / ansible.windows / 2.3.0 / module / slurp Slurps a file from remote nodes Authors: Ansible Core Teamansible.windows.slurp (2.3.0) — module
Install with ansible-galaxy collection install ansible.windows:==2.3.0
collections: - name: ansible.windows version: 2.3.0
This module works like M(ansible.builtin.fetch). It is used for fetching a base64- encoded blob containing the data in a remote file.
- name: Retrieve remote ini file on a Windows host ansible.builtin.slurp: src: C:\Program Files\Program\program.ini register: program_conf
- name: Print returned information ansible.builtin.debug: msg: "{{ program_conf['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: C:\Program Files\Program\program.ini type: str