From 5b00b40c2222e5ec3428c8ca6e35ca4e106695fd Mon Sep 17 00:00:00 2001 From: Timothy Appnel Date: Tue, 30 Aug 2016 12:04:03 -0700 Subject: [PATCH] Fixes get_url examples in docs and applies native YAML syntax. (#4474) --- lib/ansible/modules/network/basics/get_url.py | 33 +++++++++++++++---- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/lib/ansible/modules/network/basics/get_url.py b/lib/ansible/modules/network/basics/get_url.py index 296425dd7d0..7dfdc1c2ef1 100644 --- a/lib/ansible/modules/network/basics/get_url.py +++ b/lib/ansible/modules/network/basics/get_url.py @@ -168,20 +168,39 @@ author: "Jan-Piet Mens (@jpmens)" EXAMPLES=''' - 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 - 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 - 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 + dest: /etc/foo.conf + headers: 'key:value,key:value' -- name: download file with check - get_url: url=http://example.com/path/file.conf dest=/etc/foo.conf checksum=sha256:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c - 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 - 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