file-fetched

Example:

# Transfer a file from the target machine to the controller.
- file-fetched:
    src: /tmp/service-backup.zip
    dest: /tmp/service-backup-from-target.zip

Description

This is still under development. For now, it won't create the local parent folder of the fetched file, and it'll always use the current (local) user as owner.

Resources

Variables

Name Type Default Description

src

string --

The source file on the remote host. Required

become

boolean False

Whether to use elevated privileges to read the remote file. Avoid if possible.

dest

string ~/Downloads/

The destination file on this host.

flat

boolean True

Allows you to override the default behavior of appending hostname/path/to/file to the destination. If dest ends with '/', it will use the basename of the source file, similar to the copy module. Obviously this is only handy if the filenames are unique.

Examples

Example 1

Transfer a file from the target machine to the controller.

Code
- file-fetched:
    src: /tmp/service-backup.zip
    dest: /tmp/service-backup-from-target.zip
Description

Transfer file '/tmp/service-backup.zip' from the target machine (which can be the same as the controller machine) to '/tmp/service-backup-from-target.zip' on the controller machine.

Command-line

frecklecute file-fetched --help

Usage: frecklecute file-fetched [OPTIONS]

  This is still under development. For now, it won't create the local parent
  folder of the fetched file, and it'll always use the current (local) user
  as owner.

Options:
  --src SRC               The source file on the remote host.  [required]
  --become / --no-become  Whether to use elevated privileges to read the
                          remote file. Avoid if possible.
  --dest DEST             The destination file on this host.
  --flat / --no-flat      Whether to auto-rename the file after retrieval.
  --help                  Show this message and exit.