file-downloaded

Example:

# Download a file into /tmp
- file-downloaded:
    url: https://frkl.io/images/frkl-logo-black.svg
    dest: /tmp/logo.svg

Description

Download a file, create intermediate destination directories and a user/group if necessary.

If no 'dest' option is provided, the file will be downloaded into '~/Downloads'.

This uses the Ansible get_url module, check it's help for more details.

Resources

Variables

Name Type Default Description

url

string --

The url to download. Required

dest

string ~/Downloads/

The destination file (or directory).

force

boolean False

Whether to force download/overwrite the target.

group

string --

The group of the target file.

mode

string --

The mode the file should have, in octal (e.g. 0755).

owner

string --

The owner of the target file.

Examples

Example 1

Download a file into /tmp

Code
- file-downloaded:
    url: https://frkl.io/images/frkl-logo-black.svg
    dest: /tmp/logo.svg

Example 2

Download a file into ~/Downloads

Code
- file-downloaded:
    url: https://frkl.io/images/frkl-logo-black.svg

Example 3

Download a file, change owner.

Code
- file-downloaded:
    url: https://frkl.io/images/frkl-logo-black.svg
    dest: /tmp/logo.svg
    owner: freckles
Description

The user 'freckles' will be create if not availble on the sytem.

Command-line

frecklecute file-downloaded --help

Usage: frecklecute file-downloaded [OPTIONS] URL

  Download a file, create intermediate destination directories and a
  user/group if necessary.

  If no 'dest' option is provided, the file will be downloaded into
  '~/Downloads'.

  This uses the [Ansible get_url module](https://docs.ansible.com/ansible/la
  test/modules/get_url_module.html), check it's help for more details.

Options:
  --dest DEST           The destination file (or directory).  [default:
                        ~/Downloads/]
  --force / --no-force  Whether to force download/overwrite the target.
  --group GROUP         The group of the target file.
  --mode MODE           The mode the file should have, in octal (e.g. 0755).
  --owner USER          The owner of the target file.
  --help                Show this message and exit.