This module works like fetch. It is used for fetching a base64- encoded blob containing the data in a remote file.
parameter | required | default | choices | comments |
---|---|---|---|---|
src | yes | The file on the remote system to fetch. This must be a file, not a directory. |
ansible host -m slurp -a 'src=/tmp/xx' host | success >> { "content": "aGVsbG8gQW5zaWJsZSB3b3JsZAo=", "encoding": "base64" }
Note
This module returns an ‘in memory’ base64 encoded version of the file, take into account that this will require at least twice the RAM as the original file size.
Note
See also: fetch
For more information on what this means please read Core Modules
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, developing_test_pr and Developing Modules.
© 2012–2016 Michael DeHaan
© 2016 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/slurp_module.html