Debian Codegraph @

ansible_collections/community/hashi_vault/plugins/doc_fragments/connection.py

raw
1 # -*- coding: utf-8 -*-
2
3 # Copyright: (c) 2021, Brian Scholer (@briantist)
4 # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
5 # SPDX-License-Identifier: GPL-3.0-or-later
6
7 from __future__ import (absolute_import, division, print_function)
8 __metaclass__ = type
9
10
11 class ModuleDocFragment(object):
12
13 DOCUMENTATION = r'''
14 options:
15 url:
16 description:
17 - URL to the Vault service.
18 - If not specified by any other means, the value of the C(VAULT_ADDR) environment variable will be used.
19 - If C(VAULT_ADDR) is also not defined then an error will be raised.
20 type: str
21 proxies:
22 description:
23 - URL(s) to the proxies used to access the Vault service.
24 - It can be a string or a dict.
25 - If it's a dict, provide the scheme (eg. C(http) or C(https)) as the key, and the URL as the value.
26 - If it's a string, provide a single URL that will be used as the proxy for both C(http) and C(https) schemes.
27 - A string that can be interpreted as a dictionary will be converted to one (see examples).
28 - You can specify a different proxy for HTTP and HTTPS resources.
29 - If not specified, L(environment variables from the Requests library,https://requests.readthedocs.io/en/master/user/advanced/#proxies) are used.
30 type: raw
31 version_added: 1.1.0
32 ca_cert:
33 description:
34 - Path to certificate to use for authentication.
35 - If not specified by any other means, the C(VAULT_CACERT) environment variable will be used.
36 aliases: [ cacert ]
37 type: str
38 validate_certs:
39 description:
40 - Controls verification and validation of SSL certificates, mostly you only want to turn off with self signed ones.
41 - Will be populated with the inverse of C(VAULT_SKIP_VERIFY) if that is set and I(validate_certs) is not explicitly provided.
42 - Will default to C(true) if neither I(validate_certs) or C(VAULT_SKIP_VERIFY) are set.
43 type: bool
44 namespace:
45 description:
46 - Vault namespace where secrets reside. This option requires HVAC 0.7.0+ and Vault 0.11+.
47 - Optionally, this may be achieved by prefixing the authentication mount point and/or secret path with the namespace
48 (e.g C(mynamespace/secret/mysecret)).
49 - If environment variable C(VAULT_NAMESPACE) is set, its value will be used last among all ways to specify I(namespace).
50 type: str
51 timeout:
52 description:
53 - Sets the connection timeout in seconds.
54 - If not set, then the C(hvac) library's default is used.
55 type: int
56 version_added: 1.3.0
57 retries:
58 description:
59 - "Allows for retrying on errors, based on
60 the L(Retry class in the urllib3 library,https://urllib3.readthedocs.io/en/latest/reference/urllib3.util.html#urllib3.util.Retry)."
61 - This collection defines recommended defaults for retrying connections to Vault.
62 - This option can be specified as a positive number (integer) or dictionary.
63 - If this option is not specified or the number is C(0), then retries are disabled.
64 - A number sets the total number of retries, and uses collection defaults for the other settings.
65 - A dictionary value is used directly to initialize the C(Retry) class, so it can be used to fully customize retries.
66 - For detailed information on retries, see the collection User Guide.
67 type: raw
68 version_added: 1.3.0
69 retry_action:
70 description:
71 - Controls whether and how to show messages on I(retries).
72 - This has no effect if a request is not retried.
73 type: str
74 choices:
75 - ignore
76 - warn
77 default: warn
78 version_added: 1.3.0
79 '''
80
81 PLUGINS = r'''
82 options:
83 url:
84 env:
85 - name: ANSIBLE_HASHI_VAULT_ADDR
86 version_added: 0.2.0
87 ini:
88 - section: hashi_vault_collection
89 key: url
90 version_added: 1.4.0
91 vars:
92 - name: ansible_hashi_vault_url
93 version_added: 1.2.0
94 - name: ansible_hashi_vault_addr
95 version_added: 1.2.0
96 proxies:
97 env:
98 - name: ANSIBLE_HASHI_VAULT_PROXIES
99 ini:
100 - section: hashi_vault_collection
101 key: proxies
102 version_added: 1.4.0
103 vars:
104 - name: ansible_hashi_vault_proxies
105 version_added: 1.2.0
106 type: raw
107 version_added: 1.1.0
108 ca_cert:
109 env:
110 - name: ANSIBLE_HASHI_VAULT_CA_CERT
111 version_added: 1.2.0
112 ini:
113 - section: hashi_vault_collection
114 key: ca_cert
115 version_added: 1.4.0
116 vars:
117 - name: ansible_hashi_vault_ca_cert
118 version_added: 1.2.0
119 validate_certs:
120 vars:
121 - name: ansible_hashi_vault_validate_certs
122 version_added: 1.2.0
123 namespace:
124 env:
125 - name: ANSIBLE_HASHI_VAULT_NAMESPACE
126 version_added: 0.2.0
127 ini:
128 - section: hashi_vault_collection
129 key: namespace
130 version_added: 1.4.0
131 vars:
132 - name: ansible_hashi_vault_namespace
133 version_added: 1.2.0
134 timeout:
135 env:
136 - name: ANSIBLE_HASHI_VAULT_TIMEOUT
137 ini:
138 - section: hashi_vault_collection
139 key: timeout
140 version_added: 1.4.0
141 vars:
142 - name: ansible_hashi_vault_timeout
143 retries:
144 env:
145 - name: ANSIBLE_HASHI_VAULT_RETRIES
146 ini:
147 - section: hashi_vault_collection
148 key: retries
149 version_added: 1.4.0
150 vars:
151 - name: ansible_hashi_vault_retries
152 retry_action:
153 env:
154 - name: ANSIBLE_HASHI_VAULT_RETRY_ACTION
155 ini:
156 - section: hashi_vault_collection
157 key: retry_action
158 version_added: 1.4.0
159 vars:
160 - name: ansible_hashi_vault_retry_action
161 '''