|
|
@ -168,20 +168,39 @@ author: "Jan-Piet Mens (@jpmens)"
|
|
|
|
|
|
|
|
|
|
|
|
EXAMPLES='''
|
|
|
|
EXAMPLES='''
|
|
|
|
- name: download foo.conf
|
|
|
|
- name: download foo.conf
|
|
|
|
get_url: url=http://example.com/path/file.conf dest=/etc/foo.conf mode=0440
|
|
|
|
get_url:
|
|
|
|
|
|
|
|
url: http://example.com/path/file.conf
|
|
|
|
|
|
|
|
dest: /etc/foo.conf
|
|
|
|
|
|
|
|
mode: 0440
|
|
|
|
|
|
|
|
|
|
|
|
- name: download file and force basic auth
|
|
|
|
- name: download file and force basic auth
|
|
|
|
get_url: url=http://example.com/path/file.conf dest=/etc/foo.conf force_basic_auth=yes
|
|
|
|
get_url:
|
|
|
|
|
|
|
|
url: http://example.com/path/file.conf
|
|
|
|
|
|
|
|
dest: /etc/foo.conf
|
|
|
|
|
|
|
|
force_basic_auth: yes
|
|
|
|
|
|
|
|
|
|
|
|
- name: download file with custom HTTP headers
|
|
|
|
- name: download file with custom HTTP headers
|
|
|
|
get_url: url=http://example.com/path/file.conf dest=/etc/foo.conf headers='key:value,key:value'
|
|
|
|
get_url:
|
|
|
|
|
|
|
|
url: http://example.com/path/file.conf
|
|
|
|
- name: download file with check
|
|
|
|
dest: /etc/foo.conf
|
|
|
|
get_url: url=http://example.com/path/file.conf dest=/etc/foo.conf checksum=sha256:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c
|
|
|
|
headers: 'key:value,key:value'
|
|
|
|
get_url: url=http://example.com/path/file.conf dest=/etc/foo.conf checksum=md5:66dffb5228a211e61d6d7ef4a86f5758
|
|
|
|
|
|
|
|
|
|
|
|
- name: download file with check (sha256)
|
|
|
|
|
|
|
|
get_url:
|
|
|
|
|
|
|
|
url: http://example.com/path/file.conf
|
|
|
|
|
|
|
|
dest: /etc/foo.conf
|
|
|
|
|
|
|
|
checksum: sha256:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: download file with check (md5)
|
|
|
|
|
|
|
|
get_url:
|
|
|
|
|
|
|
|
url: http://example.com/path/file.conf
|
|
|
|
|
|
|
|
dest: /etc/foo.conf
|
|
|
|
|
|
|
|
checksum: md5:66dffb5228a211e61d6d7ef4a86f5758
|
|
|
|
|
|
|
|
|
|
|
|
- name: download file from a file path
|
|
|
|
- name: download file from a file path
|
|
|
|
get_url: url="file:///tmp/afile.txt" dest=/tmp/afilecopy.txt
|
|
|
|
get_url:
|
|
|
|
|
|
|
|
url: "file:///tmp/afile.txt"
|
|
|
|
|
|
|
|
dest: /tmp/afilecopy.txt
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
from ansible.module_utils.six.moves.urllib.parse import urlsplit
|
|
|
|
from ansible.module_utils.six.moves.urllib.parse import urlsplit
|
|
|
|