get_url
Collection: builtin
Full Name: parallax.builtin.get_url
Aliases: ansible.builtin.get_url, get_url
Synopsis
Download a file over HTTP, HTTPS or FTP to the target
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| url | string | yes | HTTP or HTTPS URL to download from | |
| dest | string | yes | Absolute path to download to. If it names a directory, the file name is taken from the URL | |
| force | bool | false | If true, will download the file every time | |
| checksum | string | If a checksum is passed to this parameter, the digest of the destination file will be calculated after it is downloaded | ||
| timeout | int | 10 | Timeout in seconds for URL request | |
| validate_certs | bool | true | If false, SSL certificates will not be validated | |
| use_proxy | bool | true | If false, it will not use a proxy | |
| url_username | string | The username for HTTP authentication | ||
| url_password | string | The password for HTTP authentication | ||
| username | string | The username for HTTP authentication (alias for url_username) | ||
| password | string | The password for HTTP authentication (alias for url_password) | ||
| force_basic_auth | bool | false | Force basic authentication | |
| headers | map[string]string | map[] | Add custom HTTP headers | |
| client_cert | string | PEM formatted certificate chain file to be used for SSL client authentication | ||
| client_key | string | PEM formatted file that contains your private key to be used for SSL client authentication | ||
| mode | string | The permissions of the destination file | ||
| owner | string | Name of the user that should own the file | ||
| group | string | Name of the group that should own the file | ||
| backup | bool | false | Create a backup file including the timestamp information | |
| tmp_dest | string | Absolute path of where temporary file is downloaded to | ||
| http_agent | string | ansible-httpget | Header to identify as, generally appears in web server logs |
Example
- name: Download a release tarball and verify its checksum
get_url:
url: https://example.com/app-1.4.2.tar.gz
dest: /tmp/app-1.4.2.tar.gz
checksum: sha256:2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae
mode: "0644"