| 1 |
# -*- coding: utf-8 -*- |
| 2 |
|
| 3 |
# Copyright (c) 2019 Ansible Project |
| 4 |
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 5 |
|
| 6 |
from __future__ import annotations |
| 7 |
|
| 8 |
|
| 9 |
class ModuleDocFragment: |
| 10 |
|
| 11 |
# Common options for Ansible.ModuleUtils.WebRequest |
| 12 |
DOCUMENTATION = r""" |
| 13 |
options: |
| 14 |
method: |
| 15 |
description: |
| 16 |
- The HTTP Method of the request. |
| 17 |
type: str |
| 18 |
follow_redirects: |
| 19 |
description: |
| 20 |
- Whether or the module should follow redirects. |
| 21 |
- V(all) will follow all redirect. |
| 22 |
- V(none) will not follow any redirect. |
| 23 |
- V(safe) will follow only "safe" redirects, where "safe" means that the |
| 24 |
client is only doing a C(GET) or C(HEAD) on the URI to which it is being |
| 25 |
redirected. |
| 26 |
- When following a redirected URL, the C(Authorization) header and any |
| 27 |
credentials set will be dropped and not redirected. |
| 28 |
choices: |
| 29 |
- all |
| 30 |
- none |
| 31 |
- safe |
| 32 |
default: safe |
| 33 |
type: str |
| 34 |
headers: |
| 35 |
description: |
| 36 |
- Extra headers to set on the request. |
| 37 |
- This should be a dictionary where the key is the header name and the |
| 38 |
value is the value for that header. |
| 39 |
type: dict |
| 40 |
http_agent: |
| 41 |
description: |
| 42 |
- Header to identify as, generally appears in web server logs. |
| 43 |
- This is set to the C(User-Agent) header on a HTTP request. |
| 44 |
default: ansible-httpget |
| 45 |
type: str |
| 46 |
maximum_redirection: |
| 47 |
description: |
| 48 |
- Specify how many times the module will redirect a connection to an |
| 49 |
alternative URI before the connection fails. |
| 50 |
- If set to V(0) or O(follow_redirects) is set to V(null), or V(safe) when |
| 51 |
not doing a C(GET) or C(HEAD) it prevents all redirection. |
| 52 |
default: 50 |
| 53 |
type: int |
| 54 |
timeout: |
| 55 |
description: |
| 56 |
- Specifies how long the request can be pending before it times out (in |
| 57 |
seconds). |
| 58 |
- Set to V(0) to specify an infinite timeout. |
| 59 |
default: 30 |
| 60 |
type: int |
| 61 |
validate_certs: |
| 62 |
description: |
| 63 |
- If V(no), SSL certificates will not be validated. |
| 64 |
- This should only be used on personally controlled sites using self-signed |
| 65 |
certificates. |
| 66 |
default: yes |
| 67 |
type: bool |
| 68 |
client_cert: |
| 69 |
description: |
| 70 |
- The path to the client certificate C(.pfx) that is used for X509 |
| 71 |
authentication. This path can either be the path to the C(.pfx) on the |
| 72 |
filesystem or the PowerShell certificate path |
| 73 |
C(Cert:\CurrentUser\My\<thumbprint>). |
| 74 |
- The WinRM connection must be authenticated with C(CredSSP) or C(become) |
| 75 |
is used on the task if the certificate file is not password protected. |
| 76 |
- Other authentication types can set O(client_cert_password) when the cert |
| 77 |
is password protected. |
| 78 |
type: str |
| 79 |
client_cert_password: |
| 80 |
description: |
| 81 |
- The password for O(client_cert) if the cert is password protected. |
| 82 |
type: str |
| 83 |
force_basic_auth: |
| 84 |
description: |
| 85 |
- By default the authentication header is only sent when a webservice |
| 86 |
responses to an initial request with a 401 status. Since some basic auth |
| 87 |
services do not properly send a 401, logins will fail. |
| 88 |
- This option forces the sending of the Basic authentication header upon |
| 89 |
the original request. |
| 90 |
default: no |
| 91 |
type: bool |
| 92 |
url_username: |
| 93 |
description: |
| 94 |
- The username to use for authentication. |
| 95 |
type: str |
| 96 |
url_password: |
| 97 |
description: |
| 98 |
- The password for O(url_username). |
| 99 |
type: str |
| 100 |
use_default_credential: |
| 101 |
description: |
| 102 |
- Uses the current user's credentials when authenticating with a server |
| 103 |
protected with C(NTLM), C(Kerberos), or C(Negotiate) authentication. |
| 104 |
- Sites that use C(Basic) auth will still require explicit credentials |
| 105 |
through the O(url_username) and O(url_password) options. |
| 106 |
- The module will only have access to the user's credentials if using |
| 107 |
C(become) with a password, you are connecting with SSH using a password, |
| 108 |
or connecting with WinRM using C(CredSSP) or C(Kerberos with delegation). |
| 109 |
- If not using C(become) or a different auth method to the ones stated |
| 110 |
above, there will be no default credentials available and no |
| 111 |
authentication will occur. |
| 112 |
default: no |
| 113 |
type: bool |
| 114 |
use_proxy: |
| 115 |
description: |
| 116 |
- If V(no), it will not use the proxy defined in IE for the current user. |
| 117 |
default: yes |
| 118 |
type: bool |
| 119 |
proxy_url: |
| 120 |
description: |
| 121 |
- An explicit proxy to use for the request. |
| 122 |
- By default, the request will use the IE defined proxy unless O(use_proxy=no). |
| 123 |
type: str |
| 124 |
proxy_username: |
| 125 |
description: |
| 126 |
- The username to use for proxy authentication. |
| 127 |
type: str |
| 128 |
proxy_password: |
| 129 |
description: |
| 130 |
- The password for O(proxy_username). |
| 131 |
type: str |
| 132 |
proxy_use_default_credential: |
| 133 |
description: |
| 134 |
- Uses the current user's credentials when authenticating with a proxy host |
| 135 |
protected with C(NTLM), C(Kerberos), or C(Negotiate) authentication. |
| 136 |
- Proxies that use C(Basic) auth will still require explicit credentials |
| 137 |
through the O(proxy_username) and O(proxy_password) options. |
| 138 |
- The module will only have access to the user's credentials if using |
| 139 |
C(become) with a password, you are connecting with SSH using a password, |
| 140 |
or connecting with WinRM using C(CredSSP) or C(Kerberos with delegation). |
| 141 |
- If not using C(become) or a different auth method to the ones stated |
| 142 |
above, there will be no default credentials available and no proxy |
| 143 |
authentication will occur. |
| 144 |
default: no |
| 145 |
type: bool |
| 146 |
seealso: |
| 147 |
- module: community.windows.win_inet_proxy |
| 148 |
""" |