| 1 |
# Copyright (c) 2023 Ansible Project |
| 2 |
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) |
| 3 |
|
| 4 |
|
| 5 |
class ModuleDocFragment: |
| 6 |
|
| 7 |
# associated with plugin_utils._ldap.create_ldap_connection |
| 8 |
DOCUMENTATION = r""" |
| 9 |
options: |
| 10 |
auth_protocol: |
| 11 |
description: |
| 12 |
- The authentication protocol to use when connecting to the LDAP host. |
| 13 |
- Defaults to C(certificate) if LDAPS/StartTLS is used and I(certificate) |
| 14 |
has been specified. Otherwise it defaults to C(negotiate). |
| 15 |
- C(simple) is simple authentication where the user and password are sent |
| 16 |
in plaintext. It does not support any encryption so either must be used |
| 17 |
with LDAPS, or StartTLS. If using over a plaintext LDAP connection |
| 18 |
without TLS, C(encrypt=False) must be specified to explicitly opt into no |
| 19 |
encryption. |
| 20 |
- C(certificate) is TLS client certificate authentication. It can only be |
| 21 |
used with LDAPS or StartTLS. See I(certificate) for more |
| 22 |
information on how to specify the client certificate used for |
| 23 |
authentication. |
| 24 |
- C(negotiate) will attempt to negotiate Kerberos authentication with a |
| 25 |
fallback to NTLM. If Kerberos is available the Kerberos credential cache |
| 26 |
can be used if no username or password is specified. |
| 27 |
- C(kerberos) will use Kerberos authentication with no NTLM fallback. |
| 28 |
- C(ntlm) will use NTLM authentication with no Kerberos attempt. |
| 29 |
- C(negotiate), C(kerberos), and C(ntlm) support encryption over LDAP. |
| 30 |
- Kerberos support requires the C(pyspnego[kerberos]) extras to be |
| 31 |
installed. |
| 32 |
- See R(LDAP authentication,ansible_collections.microsoft.ad.docsite.guide_ldap_connection.authentication) |
| 33 |
for more information. |
| 34 |
- This option can be set using a Jinja2 template value. |
| 35 |
choices: |
| 36 |
- simple |
| 37 |
- certificate |
| 38 |
- negotiate |
| 39 |
- kerberos |
| 40 |
- ntlm |
| 41 |
type: str |
| 42 |
env: |
| 43 |
- name: MICROSOFT_AD_LDAP_AUTH_PROTOCOL |
| 44 |
ca_cert: |
| 45 |
description: |
| 46 |
- Can be the path to a CA certificate PEM or DER file, directory of PEM |
| 47 |
certificates, or the CA certificate PEM string that is used for |
| 48 |
certificate validation. |
| 49 |
- If omitted, the default CA store used for validation is dependent on |
| 50 |
the current Python settings. |
| 51 |
- This option can be set using a Jinja2 template value. |
| 52 |
type: str |
| 53 |
env: |
| 54 |
- name: MICROSOFT_AD_LDAP_CA_CERT |
| 55 |
cert_validation: |
| 56 |
description: |
| 57 |
- The certificate validation behaviour when using a TLS connection. |
| 58 |
- This can be set to C(always), C(ignore), C(ignore_hostname). |
| 59 |
- C(always) will perform certificate hostname and CA validation. |
| 60 |
- C(ignore) will ignore any certificate errors. |
| 61 |
- C(ignore_hostname) will validate the CA trust chain but will ignore any |
| 62 |
hostname checks performed by TLS. |
| 63 |
- See R(Certificate validation,ansible_collections.microsoft.ad.docsite.guide_ldap_connection.cert_validation) |
| 64 |
for more information. |
| 65 |
- This option can be set using a Jinja2 template value. |
| 66 |
choices: |
| 67 |
- always |
| 68 |
- ignore |
| 69 |
- ignore_hostname |
| 70 |
default: always |
| 71 |
type: str |
| 72 |
env: |
| 73 |
- name: MICROSOFT_AD_LDAP_CERT_VALIDATION |
| 74 |
certificate: |
| 75 |
description: |
| 76 |
- The certificate or certificate with key bundle that is used for |
| 77 |
certificate authentication. |
| 78 |
- The value can either be a path to a file containing the certificate or |
| 79 |
string of the PEM encoded certificate. |
| 80 |
- If using a path to a certificate file, the file can be a PEM encoded |
| 81 |
certificate, a PEM encoded certificate and key bundle, a DER encoded |
| 82 |
certificate, or a PFX/PKCS12 encoded certificate and key bundle. |
| 83 |
- Use I(certificate_key) if the certificate specified does not contain the |
| 84 |
key. |
| 85 |
- Use I(certificate_password) if the key is encrypted with a password. |
| 86 |
- This option can be set using a Jinja2 template value. |
| 87 |
type: str |
| 88 |
env: |
| 89 |
- name: MICROSOFT_AD_LDAP_CERTIFICATE |
| 90 |
certificate_key: |
| 91 |
description: |
| 92 |
- The certificate key that is used for certificate authentication. |
| 93 |
- The value can either be a path to a file containing the key in the PEM or |
| 94 |
DER encoded form, or it can be the string of a PEM encoded key. |
| 95 |
- Use I(certificate_password) if the key is encrypted with a password. |
| 96 |
- This option can be set using a Jinja2 template value. |
| 97 |
type: str |
| 98 |
env: |
| 99 |
- name: MICROSOFT_AD_LDAP_CERTIFICATE_KEY |
| 100 |
certificate_password: |
| 101 |
description: |
| 102 |
- The password used to decrypt the certificate key specified by |
| 103 |
I(certificate) or I(certificate_key). |
| 104 |
- This option can be set using a Jinja2 template value. |
| 105 |
type: str |
| 106 |
env: |
| 107 |
- name: MICROSOFT_AD_LDAP_CERTIFICATE_PASSWORD |
| 108 |
connection_timeout: |
| 109 |
description: |
| 110 |
- The timeout in seconds to wait until the connection is established before |
| 111 |
failing. |
| 112 |
- This option can be set using a Jinja2 template value. |
| 113 |
default: 5 |
| 114 |
type: int |
| 115 |
env: |
| 116 |
- name: MICROSOFT_AD_LDAP_CONNECTION_TIMEOUT |
| 117 |
encrypt: |
| 118 |
description: |
| 119 |
- Whether encryption is required for the connection. |
| 120 |
- Encryption can either be performed using the authentication protocol or |
| 121 |
through TLS. |
| 122 |
- The I(auth_protocol) C(negotiate), C(kerberos), and C(ntlm) all support |
| 123 |
encryption over LDAP whereas C(simple) does not. |
| 124 |
- If using C(auth_protocol=simple) over LDAP without TLS then this must be |
| 125 |
set to C(False). As no encryption is used, all traffic will be in |
| 126 |
plaintext and should be avoided. |
| 127 |
- This option can be set using a Jinja2 template value. |
| 128 |
default: true |
| 129 |
type: bool |
| 130 |
env: |
| 131 |
- name: MICROSOFT_AD_LDAP_ENCRYPT |
| 132 |
password: |
| 133 |
description: |
| 134 |
- The password to authenticate with. |
| 135 |
- If I(auth_protocol) is C(simple) and no password is specified, the |
| 136 |
bind will be performed as an unauthenticated bind. |
| 137 |
- If I(auth_protocol) is C(negotiate), C(kerberos), or C(ntlm) and no |
| 138 |
password is specified, it will attempt to use the local cached credential |
| 139 |
specified by I(username) if available. |
| 140 |
- This option can be set using a Jinja2 template value. |
| 141 |
type: str |
| 142 |
env: |
| 143 |
- name: MICROSOFT_AD_LDAP_PASSWORD |
| 144 |
port: |
| 145 |
description: |
| 146 |
- The LDAP port to use for the connection. |
| 147 |
- Port 389 is used for LDAP and port 686 is used for LDAPS. |
| 148 |
- Defaults to port C(636) if C(tls_mode=ldaps) otherwise C(389). |
| 149 |
- This option can be set using a Jinja2 template value. |
| 150 |
type: int |
| 151 |
env: |
| 152 |
- name: MICROSOFT_AD_LDAP_PORT |
| 153 |
server: |
| 154 |
description: |
| 155 |
- The domain controller/server to connect to. |
| 156 |
- If not specified the server will be derived from the current krb5.conf |
| 157 |
C(default_realm) setting and with an SRV DNS lookup. |
| 158 |
- See R(Server lookup,ansible_collections.microsoft.ad.docsite.guide_ldap_connection.server_lookup) |
| 159 |
for more information. |
| 160 |
- This option can be set using a Jinja2 template value. |
| 161 |
type: str |
| 162 |
env: |
| 163 |
- name: MICROSOFT_AD_LDAP_SERVER |
| 164 |
tls_mode: |
| 165 |
description: |
| 166 |
- The TLS operation to use. |
| 167 |
- If an explicit I(port) is set to C(636) then this defaults to C(ldaps). |
| 168 |
- C(ldaps) will connect over LDAPS (port 636). |
| 169 |
- C(start_tls) will connect over LDAP (port 389) and perform the StartTLS |
| 170 |
operation before the authentication bind. |
| 171 |
- It is recommended to use C(ldaps) over C(start_tls) if TLS is going to be |
| 172 |
used. |
| 173 |
- This option can be set using a Jinja2 template value. |
| 174 |
choices: |
| 175 |
- ldaps |
| 176 |
- start_tls |
| 177 |
type: str |
| 178 |
env: |
| 179 |
- name: MICROSOFT_AD_LDAP_TLS_MODE |
| 180 |
username: |
| 181 |
description: |
| 182 |
- The username to authenticate with. |
| 183 |
- If I(auth_protocol) is C(simple) and no username is specified, anonymous |
| 184 |
authentication is used. |
| 185 |
- If I(auth_protocol) is C(negotiate), C(kerberos), or C(ntlm) and no |
| 186 |
username is specified, it will attempt to use the local cached credential |
| 187 |
if available, for example one retrieved by C(kinit). |
| 188 |
- This option can be set using a Jinja2 template value. |
| 189 |
type: str |
| 190 |
env: |
| 191 |
- name: MICROSOFT_AD_LDAP_USERNAME |
| 192 |
notes: |
| 193 |
- See R(LDAP connection help,ansible_collections.microsoft.ad.docsite.guide_ldap_connection) |
| 194 |
for more information about LDAP connections. |
| 195 |
requirements: |
| 196 |
- dnspython - For option server lookup support |
| 197 |
- pyspnego >= 0.8.0 |
| 198 |
- pyspnego[kerberos] - For Kerberos and server lookup support |
| 199 |
- sansldap |
| 200 |
- dpapi-ng - For LAPS decryption support |
| 201 |
""" |