ansible-core 2.17.4__py3-none-any.whl → 2.18.0b1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of ansible-core might be problematic. Click here for more details.

Files changed (320) hide show
  1. ansible/__main__.py +2 -17
  2. ansible/cli/__init__.py +3 -15
  3. ansible/cli/config.py +187 -24
  4. ansible/cli/console.py +1 -1
  5. ansible/cli/doc.py +38 -16
  6. ansible/cli/galaxy.py +30 -53
  7. ansible/cli/inventory.py +2 -2
  8. ansible/cli/pull.py +2 -2
  9. ansible/cli/scripts/ansible_connection_cli_stub.py +1 -10
  10. ansible/config/base.yml +127 -57
  11. ansible/config/manager.py +89 -11
  12. ansible/constants.py +32 -9
  13. ansible/errors/__init__.py +5 -0
  14. ansible/executor/interpreter_discovery.py +1 -1
  15. ansible/executor/play_iterator.py +16 -0
  16. ansible/executor/playbook_executor.py +1 -4
  17. ansible/executor/powershell/become_wrapper.ps1 +4 -5
  18. ansible/executor/powershell/bootstrap_wrapper.ps1 +2 -3
  19. ansible/executor/powershell/exec_wrapper.ps1 +1 -1
  20. ansible/executor/powershell/module_manifest.py +2 -2
  21. ansible/executor/task_executor.py +50 -39
  22. ansible/executor/task_queue_manager.py +1 -1
  23. ansible/executor/task_result.py +1 -1
  24. ansible/galaxy/api.py +3 -4
  25. ansible/galaxy/collection/__init__.py +21 -10
  26. ansible/galaxy/collection/concrete_artifact_manager.py +2 -2
  27. ansible/galaxy/collection/galaxy_api_proxy.py +10 -16
  28. ansible/galaxy/collection/gpg.py +17 -23
  29. ansible/galaxy/data/COPYING +7 -0
  30. ansible/galaxy/data/apb/Dockerfile.j2 +1 -0
  31. ansible/galaxy/data/apb/Makefile.j2 +1 -0
  32. ansible/galaxy/data/apb/README.md +7 -3
  33. ansible/galaxy/data/apb/apb.yml.j2 +1 -0
  34. ansible/galaxy/data/apb/defaults/main.yml.j2 +1 -0
  35. ansible/galaxy/data/apb/handlers/main.yml.j2 +1 -0
  36. ansible/galaxy/data/apb/meta/main.yml.j2 +1 -0
  37. ansible/galaxy/data/apb/playbooks/deprovision.yml.j2 +1 -0
  38. ansible/galaxy/data/apb/playbooks/provision.yml.j2 +1 -0
  39. ansible/galaxy/data/apb/tasks/main.yml.j2 +1 -0
  40. ansible/galaxy/data/apb/tests/ansible.cfg +1 -0
  41. ansible/galaxy/data/apb/tests/inventory +1 -0
  42. ansible/galaxy/data/apb/tests/test.yml.j2 +1 -0
  43. ansible/galaxy/data/apb/vars/main.yml.j2 +1 -0
  44. ansible/galaxy/data/collections_galaxy_meta.yml +1 -0
  45. ansible/galaxy/data/container/defaults/main.yml.j2 +1 -0
  46. ansible/galaxy/data/container/handlers/main.yml.j2 +1 -0
  47. ansible/galaxy/data/container/meta/container.yml.j2 +1 -0
  48. ansible/galaxy/data/container/meta/main.yml.j2 +1 -0
  49. ansible/galaxy/data/container/tasks/main.yml.j2 +1 -0
  50. ansible/galaxy/data/container/tests/ansible.cfg +1 -0
  51. ansible/galaxy/data/container/tests/inventory +1 -0
  52. ansible/galaxy/data/container/tests/test.yml.j2 +1 -0
  53. ansible/galaxy/data/container/vars/main.yml.j2 +1 -0
  54. ansible/galaxy/data/default/collection/README.md.j2 +1 -0
  55. ansible/galaxy/data/default/collection/galaxy.yml.j2 +1 -0
  56. ansible/galaxy/data/default/collection/meta/runtime.yml +1 -0
  57. ansible/galaxy/data/default/collection/plugins/README.md.j2 +1 -0
  58. ansible/galaxy/data/default/role/defaults/main.yml.j2 +1 -0
  59. ansible/galaxy/data/default/role/handlers/main.yml.j2 +1 -0
  60. ansible/galaxy/data/default/role/meta/main.yml.j2 +1 -0
  61. ansible/galaxy/data/default/role/tasks/main.yml.j2 +1 -0
  62. ansible/galaxy/data/default/role/tests/inventory +1 -0
  63. ansible/galaxy/data/default/role/tests/test.yml.j2 +1 -0
  64. ansible/galaxy/data/default/role/vars/main.yml.j2 +1 -0
  65. ansible/galaxy/data/network/cliconf_plugins/example.py.j2 +1 -0
  66. ansible/galaxy/data/network/defaults/main.yml.j2 +1 -0
  67. ansible/galaxy/data/network/library/example_command.py.j2 +1 -0
  68. ansible/galaxy/data/network/library/example_config.py.j2 +1 -0
  69. ansible/galaxy/data/network/library/example_facts.py.j2 +1 -0
  70. ansible/galaxy/data/network/meta/main.yml.j2 +1 -0
  71. ansible/galaxy/data/network/module_utils/example.py.j2 +1 -0
  72. ansible/galaxy/data/network/netconf_plugins/example.py.j2 +1 -0
  73. ansible/galaxy/data/network/tasks/main.yml.j2 +1 -0
  74. ansible/galaxy/data/network/terminal_plugins/example.py.j2 +1 -0
  75. ansible/galaxy/data/network/tests/inventory +1 -0
  76. ansible/galaxy/data/network/tests/test.yml.j2 +1 -0
  77. ansible/galaxy/data/network/vars/main.yml.j2 +1 -0
  78. ansible/galaxy/dependency_resolution/providers.py +3 -3
  79. ansible/galaxy/role.py +1 -1
  80. ansible/galaxy/token.py +20 -8
  81. ansible/keyword_desc.yml +1 -1
  82. ansible/module_utils/_internal/__init__.py +0 -0
  83. ansible/module_utils/_internal/_concurrent/__init__.py +0 -0
  84. ansible/module_utils/_internal/_concurrent/_daemon_threading.py +28 -0
  85. ansible/module_utils/_internal/_concurrent/_futures.py +21 -0
  86. ansible/module_utils/ansible_release.py +2 -2
  87. ansible/module_utils/api.py +2 -2
  88. ansible/module_utils/basic.py +14 -11
  89. ansible/module_utils/common/collections.py +1 -1
  90. ansible/module_utils/common/file.py +0 -6
  91. ansible/module_utils/common/process.py +22 -9
  92. ansible/module_utils/common/text/converters.py +5 -8
  93. ansible/module_utils/common/text/formatters.py +20 -4
  94. ansible/module_utils/common/validation.py +33 -25
  95. ansible/module_utils/compat/paramiko.py +6 -1
  96. ansible/module_utils/compat/selinux.py +2 -2
  97. ansible/module_utils/connection.py +8 -24
  98. ansible/module_utils/csharp/Ansible.Become.cs +14 -25
  99. ansible/module_utils/csharp/Ansible.Process.cs +1 -1
  100. ansible/module_utils/distro/__init__.py +1 -1
  101. ansible/module_utils/distro/_distro.py +8 -4
  102. ansible/module_utils/facts/collector.py +2 -0
  103. ansible/module_utils/facts/default_collectors.py +3 -1
  104. ansible/module_utils/facts/hardware/aix.py +54 -52
  105. ansible/module_utils/facts/hardware/darwin.py +37 -34
  106. ansible/module_utils/facts/hardware/freebsd.py +55 -15
  107. ansible/module_utils/facts/hardware/hpux.py +3 -0
  108. ansible/module_utils/facts/hardware/linux.py +101 -57
  109. ansible/module_utils/facts/hardware/netbsd.py +3 -0
  110. ansible/module_utils/facts/hardware/openbsd.py +4 -1
  111. ansible/module_utils/facts/hardware/sunos.py +7 -1
  112. ansible/module_utils/facts/network/aix.py +16 -17
  113. ansible/module_utils/facts/network/fc_wwn.py +4 -1
  114. ansible/module_utils/facts/network/hpux.py +21 -4
  115. ansible/module_utils/facts/network/iscsi.py +7 -8
  116. ansible/module_utils/facts/network/linux.py +0 -2
  117. ansible/module_utils/facts/other/facter.py +9 -4
  118. ansible/module_utils/facts/other/ohai.py +5 -5
  119. ansible/module_utils/facts/packages.py +49 -7
  120. ansible/module_utils/facts/sysctl.py +33 -31
  121. ansible/module_utils/facts/system/distribution.py +1 -1
  122. ansible/module_utils/facts/system/local.py +12 -22
  123. ansible/module_utils/facts/system/service_mgr.py +3 -1
  124. ansible/module_utils/facts/system/systemd.py +47 -0
  125. ansible/module_utils/powershell/Ansible.ModuleUtils.AddType.psm1 +1 -1
  126. ansible/module_utils/powershell/Ansible.ModuleUtils.CamelConversion.psm1 +1 -1
  127. ansible/module_utils/splitter.py +1 -1
  128. ansible/modules/add_host.py +1 -1
  129. ansible/modules/apt.py +43 -32
  130. ansible/modules/apt_key.py +6 -6
  131. ansible/modules/apt_repository.py +23 -14
  132. ansible/modules/assemble.py +7 -2
  133. ansible/modules/assert.py +4 -4
  134. ansible/modules/blockinfile.py +3 -6
  135. ansible/modules/command.py +1 -1
  136. ansible/modules/copy.py +4 -4
  137. ansible/modules/cron.py +13 -10
  138. ansible/modules/deb822_repository.py +16 -17
  139. ansible/modules/debconf.py +9 -9
  140. ansible/modules/debug.py +1 -1
  141. ansible/modules/dnf.py +79 -164
  142. ansible/modules/dnf5.py +48 -31
  143. ansible/modules/dpkg_selections.py +2 -2
  144. ansible/modules/expect.py +2 -2
  145. ansible/modules/fetch.py +2 -2
  146. ansible/modules/file.py +5 -3
  147. ansible/modules/find.py +40 -12
  148. ansible/modules/gather_facts.py +4 -2
  149. ansible/modules/get_url.py +29 -24
  150. ansible/modules/git.py +35 -35
  151. ansible/modules/group.py +71 -1
  152. ansible/modules/hostname.py +2 -4
  153. ansible/modules/include_vars.py +5 -5
  154. ansible/modules/iptables.py +13 -16
  155. ansible/modules/known_hosts.py +16 -13
  156. ansible/modules/lineinfile.py +1 -4
  157. ansible/modules/meta.py +6 -1
  158. ansible/modules/mount_facts.py +651 -0
  159. ansible/modules/package_facts.py +63 -80
  160. ansible/modules/pause.py +4 -3
  161. ansible/modules/pip.py +14 -14
  162. ansible/modules/replace.py +1 -4
  163. ansible/modules/rpm_key.py +31 -11
  164. ansible/modules/service.py +8 -8
  165. ansible/modules/service_facts.py +20 -5
  166. ansible/modules/set_stats.py +1 -1
  167. ansible/modules/setup.py +3 -3
  168. ansible/modules/stat.py +3 -3
  169. ansible/modules/subversion.py +1 -1
  170. ansible/modules/systemd.py +16 -10
  171. ansible/modules/systemd_service.py +16 -10
  172. ansible/modules/sysvinit.py +4 -4
  173. ansible/modules/unarchive.py +35 -22
  174. ansible/modules/uri.py +24 -18
  175. ansible/modules/user.py +145 -12
  176. ansible/modules/validate_argument_spec.py +3 -3
  177. ansible/modules/wait_for_connection.py +2 -1
  178. ansible/modules/yum_repository.py +136 -179
  179. ansible/parsing/dataloader.py +2 -2
  180. ansible/parsing/mod_args.py +11 -10
  181. ansible/parsing/vault/__init__.py +8 -3
  182. ansible/parsing/yaml/constructor.py +10 -8
  183. ansible/parsing/yaml/objects.py +1 -1
  184. ansible/playbook/base.py +12 -23
  185. ansible/playbook/helpers.py +4 -0
  186. ansible/playbook/loop_control.py +8 -0
  187. ansible/playbook/play.py +4 -22
  188. ansible/playbook/play_context.py +0 -16
  189. ansible/playbook/playbook_include.py +2 -2
  190. ansible/playbook/role/__init__.py +2 -2
  191. ansible/playbook/task.py +1 -1
  192. ansible/plugins/__init__.py +2 -0
  193. ansible/plugins/action/__init__.py +7 -9
  194. ansible/plugins/action/reboot.py +2 -2
  195. ansible/plugins/become/__init__.py +1 -1
  196. ansible/plugins/callback/__init__.py +44 -3
  197. ansible/plugins/callback/default.py +1 -1
  198. ansible/plugins/cliconf/__init__.py +1 -1
  199. ansible/plugins/connection/paramiko_ssh.py +2 -80
  200. ansible/plugins/connection/psrp.py +33 -82
  201. ansible/plugins/connection/ssh.py +0 -8
  202. ansible/plugins/connection/winrm.py +46 -1
  203. ansible/plugins/doc_fragments/connection_pipelining.py +2 -2
  204. ansible/plugins/doc_fragments/constructed.py +10 -10
  205. ansible/plugins/doc_fragments/default_callback.py +8 -8
  206. ansible/plugins/doc_fragments/files.py +5 -5
  207. ansible/plugins/doc_fragments/inventory_cache.py +2 -2
  208. ansible/plugins/doc_fragments/result_format_callback.py +6 -6
  209. ansible/plugins/doc_fragments/return_common.py +1 -1
  210. ansible/plugins/doc_fragments/shell_common.py +2 -10
  211. ansible/plugins/doc_fragments/shell_windows.py +0 -9
  212. ansible/plugins/doc_fragments/url.py +2 -2
  213. ansible/plugins/doc_fragments/url_windows.py +4 -5
  214. ansible/plugins/doc_fragments/validate.py +1 -1
  215. ansible/plugins/filter/core.py +2 -0
  216. ansible/plugins/filter/human_to_bytes.yml +9 -0
  217. ansible/plugins/filter/password_hash.yml +1 -1
  218. ansible/plugins/filter/strftime.yml +1 -1
  219. ansible/plugins/filter/to_nice_json.yml +7 -3
  220. ansible/plugins/filter/to_uuid.yml +1 -1
  221. ansible/plugins/inventory/script.py +1 -1
  222. ansible/plugins/list.py +1 -1
  223. ansible/plugins/loader.py +0 -11
  224. ansible/plugins/lookup/config.py +1 -1
  225. ansible/plugins/lookup/csvfile.py +21 -9
  226. ansible/plugins/lookup/env.py +8 -9
  227. ansible/plugins/lookup/ini.py +10 -1
  228. ansible/plugins/lookup/random_choice.py +2 -2
  229. ansible/plugins/lookup/url.py +7 -2
  230. ansible/plugins/shell/__init__.py +15 -20
  231. ansible/plugins/shell/powershell.py +9 -6
  232. ansible/plugins/strategy/__init__.py +16 -7
  233. ansible/plugins/test/core.py +23 -1
  234. ansible/plugins/test/issubset.yml +1 -1
  235. ansible/plugins/test/subset.yml +1 -1
  236. ansible/plugins/test/timedout.yml +20 -0
  237. ansible/plugins/test/vault_encrypted.yml +6 -6
  238. ansible/plugins/test/vaulted_file.yml +19 -0
  239. ansible/release.py +2 -2
  240. ansible/template/__init__.py +3 -8
  241. ansible/utils/collection_loader/_collection_finder.py +23 -55
  242. ansible/utils/display.py +44 -31
  243. ansible/utils/jsonrpc.py +1 -1
  244. ansible/utils/listify.py +1 -5
  245. ansible/utils/path.py +3 -0
  246. ansible/utils/vars.py +18 -27
  247. ansible/vars/manager.py +7 -150
  248. ansible/vars/plugins.py +1 -1
  249. ansible_core-2.18.0b1.dist-info/Apache-License.txt +202 -0
  250. {ansible_core-2.17.4.dist-info → ansible_core-2.18.0b1.dist-info}/METADATA +36 -23
  251. ansible_core-2.18.0b1.dist-info/MIT-license.txt +14 -0
  252. ansible_core-2.18.0b1.dist-info/PSF-license.txt +48 -0
  253. {ansible_core-2.17.4.dist-info → ansible_core-2.18.0b1.dist-info}/RECORD +311 -306
  254. {ansible_core-2.17.4.dist-info → ansible_core-2.18.0b1.dist-info}/WHEEL +1 -1
  255. {ansible_core-2.17.4.dist-info → ansible_core-2.18.0b1.dist-info}/entry_points.txt +1 -1
  256. ansible_core-2.18.0b1.dist-info/simplified_bsd.txt +8 -0
  257. ansible_test/_data/completion/docker.txt +7 -7
  258. ansible_test/_data/completion/remote.txt +5 -4
  259. ansible_test/_data/completion/windows.txt +4 -4
  260. ansible_test/_data/requirements/ansible-test.txt +1 -2
  261. ansible_test/_data/requirements/constraints.txt +1 -2
  262. ansible_test/_data/requirements/sanity.ansible-doc.txt +3 -3
  263. ansible_test/_data/requirements/sanity.changelog.in +1 -1
  264. ansible_test/_data/requirements/sanity.changelog.txt +4 -4
  265. ansible_test/_data/requirements/sanity.import.plugin.txt +2 -2
  266. ansible_test/_data/requirements/sanity.import.txt +1 -1
  267. ansible_test/_data/requirements/sanity.integration-aliases.txt +1 -1
  268. ansible_test/_data/requirements/sanity.pep8.txt +1 -1
  269. ansible_test/_data/requirements/sanity.pylint.txt +5 -7
  270. ansible_test/_data/requirements/sanity.runtime-metadata.txt +2 -2
  271. ansible_test/_data/requirements/sanity.validate-modules.txt +3 -3
  272. ansible_test/_data/requirements/sanity.yamllint.in +1 -0
  273. ansible_test/_data/requirements/sanity.yamllint.txt +1 -1
  274. ansible_test/_internal/ansible_util.py +8 -35
  275. ansible_test/_internal/ci/azp.py +1 -1
  276. ansible_test/_internal/classification/__init__.py +0 -2
  277. ansible_test/_internal/cli/parsers/key_value_parsers.py +3 -0
  278. ansible_test/_internal/commands/integration/cloud/hcloud.py +1 -1
  279. ansible_test/_internal/commands/integration/cloud/httptester.py +1 -1
  280. ansible_test/_internal/commands/integration/cloud/nios.py +1 -1
  281. ansible_test/_internal/commands/sanity/__init__.py +96 -19
  282. ansible_test/_internal/commands/sanity/pylint.py +20 -24
  283. ansible_test/_internal/completion.py +2 -0
  284. ansible_test/_internal/constants.py +0 -1
  285. ansible_test/_internal/coverage_util.py +1 -2
  286. ansible_test/_internal/docker_util.py +1 -1
  287. ansible_test/_internal/host_configs.py +10 -0
  288. ansible_test/_internal/host_profiles.py +9 -13
  289. ansible_test/_internal/pypi_proxy.py +1 -1
  290. ansible_test/_internal/python_requirements.py +5 -14
  291. ansible_test/_internal/timeout.py +1 -1
  292. ansible_test/_internal/util.py +40 -0
  293. ansible_test/_internal/util_common.py +5 -1
  294. ansible_test/_util/controller/sanity/code-smell/action-plugin-docs.json +3 -1
  295. ansible_test/_util/controller/sanity/code-smell/action-plugin-docs.py +6 -3
  296. ansible_test/_util/controller/sanity/code-smell/empty-init.json +0 -2
  297. ansible_test/_util/controller/sanity/pylint/config/collection.cfg +1 -0
  298. ansible_test/_util/controller/sanity/pylint/config/default.cfg +1 -0
  299. ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py +1 -19
  300. ansible_test/_util/controller/sanity/shellcheck/exclude.txt +1 -0
  301. ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py +67 -2
  302. ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py +27 -5
  303. ansible_test/_util/target/cli/ansible_test_cli_stub.py +0 -0
  304. ansible_test/_util/target/common/constants.py +2 -2
  305. ansible_test/_util/target/injector/python.py +5 -0
  306. ansible_test/_util/target/pytest/plugins/ansible_pytest_coverage.py +6 -0
  307. ansible_test/_util/target/sanity/import/importer.py +1 -1
  308. ansible_test/_util/target/setup/bootstrap.sh +6 -17
  309. ansible_test/_util/target/setup/requirements.py +14 -20
  310. ansible_test/config/config.yml +1 -1
  311. ansible_core-2.17.4.data/scripts/ansible-test +0 -44
  312. ansible_test/_data/requirements/sanity.mypy.in +0 -10
  313. ansible_test/_data/requirements/sanity.mypy.txt +0 -18
  314. ansible_test/_internal/commands/sanity/mypy.py +0 -274
  315. ansible_test/_util/controller/sanity/mypy/ansible-core.ini +0 -116
  316. ansible_test/_util/controller/sanity/mypy/ansible-test.ini +0 -27
  317. ansible_test/_util/controller/sanity/mypy/modules.ini +0 -92
  318. ansible_test/_util/controller/sanity/mypy/packaging.ini +0 -20
  319. {ansible_core-2.17.4.dist-info → ansible_core-2.18.0b1.dist-info}/COPYING +0 -0
  320. {ansible_core-2.17.4.dist-info → ansible_core-2.18.0b1.dist-info}/top_level.txt +0 -0
@@ -12,20 +12,14 @@ import contextlib
12
12
  import inspect
13
13
  import os
14
14
  import subprocess
15
- import sys
16
15
  import typing as t
17
16
 
18
17
  from dataclasses import dataclass, fields as dc_fields
19
- from functools import partial
20
18
  from urllib.error import HTTPError, URLError
21
19
 
22
20
  if t.TYPE_CHECKING:
23
21
  from ansible.utils.display import Display
24
22
 
25
- IS_PY310_PLUS = sys.version_info[:2] >= (3, 10)
26
-
27
- frozen_dataclass = partial(dataclass, frozen=True, **({'slots': True} if IS_PY310_PLUS else {}))
28
-
29
23
 
30
24
  def get_signature_from_source(source, display=None): # type: (str, t.Optional[Display]) -> str
31
25
  if display is not None:
@@ -128,7 +122,7 @@ def parse_gpg_errors(status_out): # type: (str) -> t.Iterator[GpgBaseError]
128
122
  yield cls(*fields)
129
123
 
130
124
 
131
- @frozen_dataclass
125
+ @dataclass(frozen=True, slots=True)
132
126
  class GpgBaseError(Exception):
133
127
  status: str
134
128
 
@@ -142,35 +136,35 @@ class GpgBaseError(Exception):
142
136
  super(GpgBaseError, self).__setattr__(field_name, field_type(getattr(self, field_name)))
143
137
 
144
138
 
145
- @frozen_dataclass
139
+ @dataclass(frozen=True, slots=True)
146
140
  class GpgExpSig(GpgBaseError):
147
141
  """The signature with the keyid is good, but the signature is expired."""
148
142
  keyid: str
149
143
  username: str
150
144
 
151
145
 
152
- @frozen_dataclass
146
+ @dataclass(frozen=True, slots=True)
153
147
  class GpgExpKeySig(GpgBaseError):
154
148
  """The signature with the keyid is good, but the signature was made by an expired key."""
155
149
  keyid: str
156
150
  username: str
157
151
 
158
152
 
159
- @frozen_dataclass
153
+ @dataclass(frozen=True, slots=True)
160
154
  class GpgRevKeySig(GpgBaseError):
161
155
  """The signature with the keyid is good, but the signature was made by a revoked key."""
162
156
  keyid: str
163
157
  username: str
164
158
 
165
159
 
166
- @frozen_dataclass
160
+ @dataclass(frozen=True, slots=True)
167
161
  class GpgBadSig(GpgBaseError):
168
162
  """The signature with the keyid has not been verified okay."""
169
163
  keyid: str
170
164
  username: str
171
165
 
172
166
 
173
- @frozen_dataclass
167
+ @dataclass(frozen=True, slots=True)
174
168
  class GpgErrSig(GpgBaseError):
175
169
  """"It was not possible to check the signature. This may be caused by
176
170
  a missing public key or an unsupported algorithm. A RC of 4
@@ -186,24 +180,24 @@ class GpgErrSig(GpgBaseError):
186
180
  fpr: str
187
181
 
188
182
 
189
- @frozen_dataclass
183
+ @dataclass(frozen=True, slots=True)
190
184
  class GpgNoPubkey(GpgBaseError):
191
185
  """The public key is not available."""
192
186
  keyid: str
193
187
 
194
188
 
195
- @frozen_dataclass
189
+ @dataclass(frozen=True, slots=True)
196
190
  class GpgMissingPassPhrase(GpgBaseError):
197
191
  """No passphrase was supplied."""
198
192
 
199
193
 
200
- @frozen_dataclass
194
+ @dataclass(frozen=True, slots=True)
201
195
  class GpgBadPassphrase(GpgBaseError):
202
196
  """The supplied passphrase was wrong or not given."""
203
197
  keyid: str
204
198
 
205
199
 
206
- @frozen_dataclass
200
+ @dataclass(frozen=True, slots=True)
207
201
  class GpgNoData(GpgBaseError):
208
202
  """No data has been found. Codes for WHAT are:
209
203
  - 1 :: No armored data.
@@ -215,7 +209,7 @@ class GpgNoData(GpgBaseError):
215
209
  what: str
216
210
 
217
211
 
218
- @frozen_dataclass
212
+ @dataclass(frozen=True, slots=True)
219
213
  class GpgUnexpected(GpgBaseError):
220
214
  """No data has been found. Codes for WHAT are:
221
215
  - 1 :: No armored data.
@@ -227,7 +221,7 @@ class GpgUnexpected(GpgBaseError):
227
221
  what: str
228
222
 
229
223
 
230
- @frozen_dataclass
224
+ @dataclass(frozen=True, slots=True)
231
225
  class GpgError(GpgBaseError):
232
226
  """This is a generic error status message, it might be followed by error location specific data."""
233
227
  location: str
@@ -235,30 +229,30 @@ class GpgError(GpgBaseError):
235
229
  more: str = ""
236
230
 
237
231
 
238
- @frozen_dataclass
232
+ @dataclass(frozen=True, slots=True)
239
233
  class GpgFailure(GpgBaseError):
240
234
  """This is the counterpart to SUCCESS and used to indicate a program failure."""
241
235
  location: str
242
236
  code: int
243
237
 
244
238
 
245
- @frozen_dataclass
239
+ @dataclass(frozen=True, slots=True)
246
240
  class GpgBadArmor(GpgBaseError):
247
241
  """The ASCII armor is corrupted."""
248
242
 
249
243
 
250
- @frozen_dataclass
244
+ @dataclass(frozen=True, slots=True)
251
245
  class GpgKeyExpired(GpgBaseError):
252
246
  """The key has expired."""
253
247
  timestamp: int
254
248
 
255
249
 
256
- @frozen_dataclass
250
+ @dataclass(frozen=True, slots=True)
257
251
  class GpgKeyRevoked(GpgBaseError):
258
252
  """The used key has been revoked by its owner."""
259
253
 
260
254
 
261
- @frozen_dataclass
255
+ @dataclass(frozen=True, slots=True)
262
256
  class GpgNoSecKey(GpgBaseError):
263
257
  """The secret key is not available."""
264
258
  keyid: str
@@ -0,0 +1,7 @@
1
+ All templates, files and files generated from them in the subdirectories of this one
2
+ are subject to the MIT license when applicable.
3
+
4
+ MIT License:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  FROM ansibleplaybookbundle/apb-base
2
3
 
3
4
  LABEL "com.redhat.apb.spec"=\
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  DOCKERHOST = DOCKERHOST
2
3
  DOCKERORG = DOCKERORG
3
4
  IMAGENAME = {{ role_name }}
@@ -6,17 +6,21 @@ A brief description of the APB goes here.
6
6
  Requirements
7
7
  ------------
8
8
 
9
- Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here. For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
9
+ Any pre-requisites that may not be covered by Ansible itself or the role should be mentioned here.
10
+ For instance, if the role uses the EC2 module, it may be a good idea to mention in this section that the boto package is required.
10
11
 
11
12
  APB Variables
12
13
  --------------
13
14
 
14
- A description of the settable variables for this APB should go here, including any variables that are in defaults/main.yml, vars/main.yml, apb.yml, and any variables that can/should be set via parameters to the role. Any variables that are read from other roles and/or the global scope (i.e. hostvars, group vars, etc.) should be mentioned here as well.
15
+ A description of the settable variables for this APB should go here, including any variables that are in defaults/main.yml, vars/main.yml, apb.yml, and
16
+ any variables that can/should be set via parameters to the role.
17
+ Any variables that are read from other roles and/or the global scope (i.e. hostvars, group vars, etc.) should be mentioned here as well.
15
18
 
16
19
  Dependencies
17
20
  ------------
18
21
 
19
- A list of other APBs/roles hosted on Galaxy should go here, plus any details in regards to parameters that may need to be set for other roles, or variables that are used from other roles.
22
+ A list of other APBs/roles hosted on Galaxy should go here, plus any details in regards to
23
+ parameters that may need to be set for other roles, or variables that are used from other roles.
20
24
 
21
25
  Example Playbook
22
26
  ----------------
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  version: '1.0.0'
2
3
  name: {{ role_name }}
3
4
  description: {{ description }}
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  # defaults file for {{ role_name }}
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  # handlers file for {{ role_name }}
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  galaxy_info:
2
3
  author: {{ author }}
3
4
  description: {{ description }}
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  - name: "{{ role_name }} playbook to deprovision the application"
2
3
  hosts: localhost
3
4
  gather_facts: false
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  - name: "{{ role_name }} playbook to provision the application"
2
3
  hosts: localhost
3
4
  gather_facts: false
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  # tasks file for {{ role_name }}
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  [defaults]
2
3
  inventory=./inventory
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  localhost
2
3
 
3
4
 
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  - hosts: localhost
3
4
  gather_facts: no
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  # vars file for {{ role_name }}
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  # Copyright (c) 2019 Ansible Project
2
3
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
3
4
 
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  # defaults file for {{ role_name }}
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  # handlers file for {{ role_name }}
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  # Add your Ansible Container service definitions here.
2
3
  # For example:
3
4
  #
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  galaxy_info:
2
3
  author: {{ author }}
3
4
  description: {{ description }}
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  # tasks file for {{ role_name }}
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  [defaults]
2
3
  inventory=./inventory
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  localhost
2
3
 
3
4
 
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  - hosts: localhost
3
4
  gather_facts: no
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  # vars file for {{ role_name }}
@@ -1,3 +1,4 @@
1
+ {# SPDX-License-Identifier: MIT-0 #}
1
2
  # Ansible Collection - {{ namespace }}.{{ collection_name }}
2
3
 
3
4
  Documentation for the collection.
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ### REQUIRED
2
3
  {% for option in required_config %}
3
4
  {{ option.description | comment_ify }}
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  # Collections must specify a minimum required ansible version to upload
3
4
  # to galaxy
@@ -1,3 +1,4 @@
1
+ {# SPDX-License-Identifier: MIT-0 #}
1
2
  # Collections Plugins Directory
2
3
 
3
4
  This directory can be used to ship various plugins inside an Ansible collection. Each plugin is placed in a folder that
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  # defaults file for {{ role_name }}
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  # handlers file for {{ role_name }}
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  galaxy_info:
2
3
  author: {{ author }}
3
4
  description: {{ description }}
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  # tasks file for {{ role_name }}
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  localhost
2
3
 
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  - hosts: localhost
3
4
  remote_user: root
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  # vars file for {{ role_name }}
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  #
2
3
  # (c) 2018 Red Hat Inc.
3
4
  #
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  # defaults file for {{ role_name }}
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  #
2
3
  # (c) 2018 Red Hat Inc.
3
4
  #
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  #
2
3
  # (c) 2018 Red Hat Inc.
3
4
  #
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  #
2
3
  # (c) 2018 Red Hat Inc.
3
4
  #
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  galaxy_info:
2
3
  author: {{ author }}
3
4
  description: {{ description }}
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  #
2
3
  # (c) 2018 Red Hat Inc.
3
4
  #
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  #
2
3
  # (c) 2018 Red Hat Inc.
3
4
  #
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  # tasks file for {{ role_name }}
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  #
2
3
  # (c) 2018 Red Hat Inc.
3
4
  #
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  localhost
2
3
 
@@ -1,3 +1,4 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  - hosts: localhost
3
4
  connection: network_cli
@@ -1,2 +1,3 @@
1
+ #SPDX-License-Identifier: MIT-0
1
2
  ---
2
3
  # vars file for {{ role_name }}
@@ -126,7 +126,7 @@ class CollectionDependencyProviderBase(AbstractProvider):
126
126
  the current candidate list
127
127
 
128
128
  * ``parent`` specifies the candidate that provides
129
- (dependend on) the requirement, or `None`
129
+ (depended on) the requirement, or `None`
130
130
  to indicate a root requirement.
131
131
 
132
132
  resolvelib >=0.7.0, < 0.8.0
@@ -202,7 +202,7 @@ class CollectionDependencyProviderBase(AbstractProvider):
202
202
  remote archives), the one-and-only match is returned
203
203
 
204
204
  For a "named" requirement, Galaxy-compatible APIs are consulted
205
- to find concrete candidates for this requirement. Of theres a
205
+ to find concrete candidates for this requirement. If there's a
206
206
  pre-installed candidate, it's prepended in front of others.
207
207
 
208
208
  resolvelib >=0.5.3, <0.6.0
@@ -437,7 +437,7 @@ class CollectionDependencyProviderBase(AbstractProvider):
437
437
  # FIXME: differs. So how do we resolve this case? Priority?
438
438
  # FIXME: Taking into account a pinned hash? Exploding on
439
439
  # FIXME: any differences?
440
- # NOTE: The underlying implmentation currently uses first found
440
+ # NOTE: The underlying implementation currently uses first found
441
441
  req_map = self._api_proxy.get_collection_dependencies(candidate)
442
442
 
443
443
  # NOTE: This guard expression MUST perform an early exit only
ansible/galaxy/role.py CHANGED
@@ -256,7 +256,7 @@ class GalaxyRole(object):
256
256
  display.display("- downloading role from %s" % archive_url)
257
257
 
258
258
  try:
259
- url_file = open_url(archive_url, validate_certs=self._validate_certs, http_agent=user_agent())
259
+ url_file = open_url(archive_url, validate_certs=self._validate_certs, http_agent=user_agent(), timeout=60)
260
260
  temp_file = tempfile.NamedTemporaryFile(delete=False)
261
261
  data = url_file.read()
262
262
  while data:
ansible/galaxy/token.py CHANGED
@@ -21,11 +21,14 @@
21
21
  from __future__ import annotations
22
22
 
23
23
  import base64
24
- import os
25
24
  import json
25
+ import os
26
+ import time
26
27
  from stat import S_IRUSR, S_IWUSR
28
+ from urllib.error import HTTPError
27
29
 
28
30
  from ansible import constants as C
31
+ from ansible.galaxy.api import GalaxyError
29
32
  from ansible.galaxy.user_agent import user_agent
30
33
  from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text
31
34
  from ansible.module_utils.common.yaml import yaml_dump, yaml_load
@@ -57,12 +60,16 @@ class KeycloakToken(object):
57
60
  self.client_id = client_id
58
61
  if self.client_id is None:
59
62
  self.client_id = 'cloud-services'
63
+ self._expiration = None
60
64
 
61
65
  def _form_payload(self):
62
66
  return 'grant_type=refresh_token&client_id=%s&refresh_token=%s' % (self.client_id,
63
67
  self.access_token)
64
68
 
65
69
  def get(self):
70
+ if self._expiration and time.time() >= self._expiration:
71
+ self._token = None
72
+
66
73
  if self._token:
67
74
  return self._token
68
75
 
@@ -76,15 +83,20 @@ class KeycloakToken(object):
76
83
  # or 'azp' (Authorized party - the party to which the ID Token was issued)
77
84
  payload = self._form_payload()
78
85
 
79
- resp = open_url(to_native(self.auth_url),
80
- data=payload,
81
- validate_certs=self.validate_certs,
82
- method='POST',
83
- http_agent=user_agent())
86
+ try:
87
+ resp = open_url(to_native(self.auth_url),
88
+ data=payload,
89
+ validate_certs=self.validate_certs,
90
+ method='POST',
91
+ http_agent=user_agent())
92
+ except HTTPError as e:
93
+ raise GalaxyError(e, 'Unable to get access token')
84
94
 
85
- # TODO: handle auth errors
95
+ data = json.load(resp)
86
96
 
87
- data = json.loads(to_text(resp.read(), errors='surrogate_or_strict'))
97
+ # So that we have a buffer, expire the token in ~2/3 the given value
98
+ expires_in = data['expires_in'] // 3 * 2
99
+ self._expiration = time.time() + expires_in
88
100
 
89
101
  # - extract 'access_token'
90
102
  self._token = data.get('access_token')
ansible/keyword_desc.yml CHANGED
@@ -61,7 +61,7 @@ serial: Explicitly define how Ansible batches the execution of the current play
61
61
  strategy: Allows you to choose the strategy plugin to use for the play. See :ref:`strategy_plugins`.
62
62
  tags: Tags applied to the task or included tasks, this allows selecting subsets of tasks from the command line.
63
63
  tasks: Main list of tasks to execute in the play, they run after :term:`roles` and before :term:`post_tasks`.
64
- timeout: Time limit for the task to execute in, if exceeded Ansible will interrupt and fail the task.
64
+ timeout: Time limit for the task action to execute in, if exceeded, Ansible will interrupt the process. Timeout does not include templating or looping.
65
65
  throttle: Limit the number of concurrent task runs on task, block and playbook level. This is independent of the forks and serial settings, but cannot be set higher than those limits. For example, if forks is set to 10 and the throttle is set to 15, at most 10 hosts will be operated on in parallel.
66
66
  until: "This keyword implies a ':term:`retries` loop' that will go on until the condition supplied here is met or we hit the :term:`retries` limit."
67
67
  vars: Dictionary/map of variables
File without changes
File without changes
@@ -0,0 +1,28 @@
1
+ """Proxy stdlib threading module that only supports non-joinable daemon threads."""
2
+ # NB: all new local module attrs are _ prefixed to ensure an identical public attribute surface area to the module we're proxying
3
+
4
+ from __future__ import annotations as _annotations
5
+
6
+ import threading as _threading
7
+ import typing as _t
8
+
9
+
10
+ class _DaemonThread(_threading.Thread):
11
+ """
12
+ Daemon-only Thread subclass; prevents running threads of this type from blocking interpreter shutdown and process exit.
13
+ The join() method is a no-op.
14
+ """
15
+
16
+ def __init__(self, *args, daemon: bool | None = None, **kwargs) -> None:
17
+ super().__init__(*args, daemon=daemon or True, **kwargs)
18
+
19
+ def join(self, timeout=None) -> None:
20
+ """ThreadPoolExecutor's atexit handler joins all queue threads before allowing shutdown; prevent them from blocking."""
21
+
22
+
23
+ Thread = _DaemonThread # shadow the real Thread attr with our _DaemonThread
24
+
25
+
26
+ def __getattr__(name: str) -> _t.Any:
27
+ """Delegate anything not defined locally to the real `threading` module."""
28
+ return getattr(_threading, name)
@@ -0,0 +1,21 @@
1
+ """Utilities for concurrent code execution using futures."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import concurrent.futures
6
+ import types
7
+
8
+ from . import _daemon_threading
9
+
10
+
11
+ class DaemonThreadPoolExecutor(concurrent.futures.ThreadPoolExecutor):
12
+ """ThreadPoolExecutor subclass that creates non-joinable daemon threads for non-blocking pool and process shutdown with abandoned threads."""
13
+
14
+ atc = concurrent.futures.ThreadPoolExecutor._adjust_thread_count
15
+
16
+ # clone the base class `_adjust_thread_count` method with a copy of its globals dict
17
+ _adjust_thread_count = types.FunctionType(atc.__code__, atc.__globals__.copy(), name=atc.__name__, argdefs=atc.__defaults__, closure=atc.__closure__)
18
+ # patch the method closure's `threading` module import to use our daemon-only thread factory instead
19
+ _adjust_thread_count.__globals__.update(threading=_daemon_threading)
20
+
21
+ del atc # don't expose this as a class attribute
@@ -17,6 +17,6 @@
17
17
 
18
18
  from __future__ import annotations
19
19
 
20
- __version__ = '2.17.4'
20
+ __version__ = '2.18.0b1'
21
21
  __author__ = 'Ansible, Inc.'
22
- __codename__ = "Gallows Pole"
22
+ __codename__ = "Fool in the Rain"