mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
added friendlier aliases for auth options (#46816)
* added friendlier aliases for auth options
This commit is contained in:
parent
cd1faca6e0
commit
e3882ad6f6
1 changed files with 17 additions and 0 deletions
|
@ -123,12 +123,16 @@ options:
|
||||||
description:
|
description:
|
||||||
- The username for use in HTTP basic authentication.
|
- The username for use in HTTP basic authentication.
|
||||||
- This parameter can be used without C(url_password) for sites that allow empty passwords.
|
- This parameter can be used without C(url_password) for sites that allow empty passwords.
|
||||||
|
- Since version 2.8 you can also use the 'username' alias for this option.
|
||||||
version_added: '1.6'
|
version_added: '1.6'
|
||||||
|
aliases: ['username']
|
||||||
url_password:
|
url_password:
|
||||||
description:
|
description:
|
||||||
- The password for use in HTTP basic authentication.
|
- The password for use in HTTP basic authentication.
|
||||||
- If the C(url_username) parameter is not specified, the C(url_password) parameter will not be used.
|
- If the C(url_username) parameter is not specified, the C(url_password) parameter will not be used.
|
||||||
|
- Since version 2.8 you can also use the 'password' alias for this option.
|
||||||
version_added: '1.6'
|
version_added: '1.6'
|
||||||
|
aliases: ['password']
|
||||||
force_basic_auth:
|
force_basic_auth:
|
||||||
version_added: '2.0'
|
version_added: '2.0'
|
||||||
description:
|
description:
|
||||||
|
@ -203,6 +207,14 @@ EXAMPLES = r'''
|
||||||
get_url:
|
get_url:
|
||||||
url: file:///tmp/afile.txt
|
url: file:///tmp/afile.txt
|
||||||
dest: /tmp/afilecopy.txt
|
dest: /tmp/afilecopy.txt
|
||||||
|
|
||||||
|
- name: < Fetch file that requires authentication.
|
||||||
|
username/password only availabe since 2.8, in older versions you ned to use url_username/url_password
|
||||||
|
get_url:
|
||||||
|
url: http://example.com/path/file.conf
|
||||||
|
dest: /etc/foo.conf
|
||||||
|
username: bar
|
||||||
|
password: '{{ mysecret }}'
|
||||||
'''
|
'''
|
||||||
|
|
||||||
RETURN = r'''
|
RETURN = r'''
|
||||||
|
@ -396,6 +408,11 @@ def extract_filename_from_headers(headers):
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
argument_spec = url_argument_spec()
|
argument_spec = url_argument_spec()
|
||||||
|
|
||||||
|
# setup aliases
|
||||||
|
argument_spec['url_username']['aliases'] = ['username']
|
||||||
|
argument_spec['url_password']['aliases'] = ['password']
|
||||||
|
|
||||||
argument_spec.update(
|
argument_spec.update(
|
||||||
url=dict(type='str', required=True),
|
url=dict(type='str', required=True),
|
||||||
dest=dict(type='path', required=True),
|
dest=dict(type='path', required=True),
|
||||||
|
|
Loading…
Reference in a new issue