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

NameTypeRequiredDefaultDescription
urlstringyesHTTP or HTTPS URL to download from
deststringyesAbsolute path to download to. If it names a directory, the file name is taken from the URL
forceboolfalseIf true, will download the file every time
checksumstringIf a checksum is passed to this parameter, the digest of the destination file will be calculated after it is downloaded
timeoutint10Timeout in seconds for URL request
validate_certsbooltrueIf false, SSL certificates will not be validated
use_proxybooltrueIf false, it will not use a proxy
url_usernamestringThe username for HTTP authentication
url_passwordstringThe password for HTTP authentication
usernamestringThe username for HTTP authentication (alias for url_username)
passwordstringThe password for HTTP authentication (alias for url_password)
force_basic_authboolfalseForce basic authentication
headersmap[string]stringmap[]Add custom HTTP headers
client_certstringPEM formatted certificate chain file to be used for SSL client authentication
client_keystringPEM formatted file that contains your private key to be used for SSL client authentication
modestringThe permissions of the destination file
ownerstringName of the user that should own the file
groupstringName of the group that should own the file
backupboolfalseCreate a backup file including the timestamp information
tmp_deststringAbsolute path of where temporary file is downloaded to
http_agentstringansible-httpgetHeader 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"