ansible-core 2.17.5rc1__py3-none-any.whl → 2.18.0rc1__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 (330) 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 +3 -49
  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 +34 -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 +10 -5
  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 +8 -8
  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 +2 -2
  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/facts/timeout.py +1 -1
  126. ansible/module_utils/powershell/Ansible.ModuleUtils.AddType.psm1 +1 -1
  127. ansible/module_utils/powershell/Ansible.ModuleUtils.CamelConversion.psm1 +1 -1
  128. ansible/module_utils/splitter.py +1 -1
  129. ansible/modules/add_host.py +1 -1
  130. ansible/modules/apt.py +43 -32
  131. ansible/modules/apt_key.py +6 -6
  132. ansible/modules/apt_repository.py +23 -14
  133. ansible/modules/assemble.py +7 -2
  134. ansible/modules/assert.py +4 -4
  135. ansible/modules/blockinfile.py +3 -6
  136. ansible/modules/command.py +1 -1
  137. ansible/modules/copy.py +4 -4
  138. ansible/modules/cron.py +13 -10
  139. ansible/modules/deb822_repository.py +16 -17
  140. ansible/modules/debconf.py +25 -22
  141. ansible/modules/debug.py +1 -1
  142. ansible/modules/dnf.py +79 -164
  143. ansible/modules/dnf5.py +54 -29
  144. ansible/modules/dpkg_selections.py +2 -2
  145. ansible/modules/expect.py +2 -2
  146. ansible/modules/fetch.py +2 -2
  147. ansible/modules/file.py +5 -3
  148. ansible/modules/find.py +40 -12
  149. ansible/modules/gather_facts.py +4 -2
  150. ansible/modules/get_url.py +29 -24
  151. ansible/modules/git.py +35 -35
  152. ansible/modules/group.py +71 -1
  153. ansible/modules/hostname.py +2 -4
  154. ansible/modules/include_vars.py +5 -5
  155. ansible/modules/iptables.py +13 -16
  156. ansible/modules/known_hosts.py +16 -13
  157. ansible/modules/lineinfile.py +1 -4
  158. ansible/modules/meta.py +6 -1
  159. ansible/modules/mount_facts.py +651 -0
  160. ansible/modules/package_facts.py +63 -80
  161. ansible/modules/pause.py +4 -3
  162. ansible/modules/pip.py +14 -14
  163. ansible/modules/replace.py +1 -4
  164. ansible/modules/rpm_key.py +31 -11
  165. ansible/modules/service.py +8 -8
  166. ansible/modules/service_facts.py +20 -5
  167. ansible/modules/set_stats.py +1 -1
  168. ansible/modules/setup.py +3 -3
  169. ansible/modules/stat.py +3 -3
  170. ansible/modules/subversion.py +1 -1
  171. ansible/modules/systemd.py +16 -10
  172. ansible/modules/systemd_service.py +16 -10
  173. ansible/modules/sysvinit.py +4 -4
  174. ansible/modules/unarchive.py +35 -22
  175. ansible/modules/uri.py +24 -18
  176. ansible/modules/user.py +148 -13
  177. ansible/modules/validate_argument_spec.py +3 -3
  178. ansible/modules/wait_for_connection.py +2 -1
  179. ansible/modules/yum_repository.py +136 -179
  180. ansible/parsing/dataloader.py +2 -2
  181. ansible/parsing/mod_args.py +11 -10
  182. ansible/parsing/vault/__init__.py +8 -3
  183. ansible/parsing/yaml/constructor.py +10 -8
  184. ansible/parsing/yaml/objects.py +1 -1
  185. ansible/playbook/base.py +12 -23
  186. ansible/playbook/helpers.py +4 -0
  187. ansible/playbook/loop_control.py +8 -0
  188. ansible/playbook/play.py +4 -22
  189. ansible/playbook/play_context.py +0 -16
  190. ansible/playbook/playbook_include.py +2 -2
  191. ansible/playbook/role/__init__.py +2 -2
  192. ansible/plugins/__init__.py +2 -0
  193. ansible/plugins/action/__init__.py +7 -9
  194. ansible/plugins/action/dnf.py +7 -5
  195. ansible/plugins/action/package.py +5 -4
  196. ansible/plugins/action/reboot.py +2 -2
  197. ansible/plugins/become/__init__.py +1 -1
  198. ansible/plugins/callback/__init__.py +44 -3
  199. ansible/plugins/callback/default.py +1 -1
  200. ansible/plugins/cliconf/__init__.py +1 -1
  201. ansible/plugins/connection/paramiko_ssh.py +2 -80
  202. ansible/plugins/connection/psrp.py +33 -82
  203. ansible/plugins/connection/ssh.py +0 -8
  204. ansible/plugins/connection/winrm.py +46 -1
  205. ansible/plugins/doc_fragments/connection_pipelining.py +2 -2
  206. ansible/plugins/doc_fragments/constructed.py +10 -10
  207. ansible/plugins/doc_fragments/default_callback.py +8 -8
  208. ansible/plugins/doc_fragments/files.py +5 -5
  209. ansible/plugins/doc_fragments/inventory_cache.py +2 -2
  210. ansible/plugins/doc_fragments/result_format_callback.py +6 -6
  211. ansible/plugins/doc_fragments/return_common.py +1 -1
  212. ansible/plugins/doc_fragments/shell_common.py +2 -10
  213. ansible/plugins/doc_fragments/shell_windows.py +0 -9
  214. ansible/plugins/doc_fragments/url.py +2 -2
  215. ansible/plugins/doc_fragments/url_windows.py +4 -5
  216. ansible/plugins/doc_fragments/validate.py +1 -1
  217. ansible/plugins/filter/core.py +2 -0
  218. ansible/plugins/filter/human_to_bytes.yml +9 -0
  219. ansible/plugins/filter/password_hash.yml +1 -1
  220. ansible/plugins/filter/strftime.yml +1 -1
  221. ansible/plugins/filter/to_nice_json.yml +7 -3
  222. ansible/plugins/filter/to_uuid.yml +1 -1
  223. ansible/plugins/filter/unique.yml +28 -0
  224. ansible/plugins/inventory/script.py +1 -1
  225. ansible/plugins/list.py +1 -1
  226. ansible/plugins/loader.py +0 -11
  227. ansible/plugins/lookup/config.py +1 -1
  228. ansible/plugins/lookup/csvfile.py +21 -9
  229. ansible/plugins/lookup/env.py +8 -9
  230. ansible/plugins/lookup/ini.py +10 -1
  231. ansible/plugins/lookup/random_choice.py +2 -2
  232. ansible/plugins/lookup/url.py +7 -2
  233. ansible/plugins/shell/__init__.py +15 -20
  234. ansible/plugins/shell/powershell.py +9 -6
  235. ansible/plugins/strategy/__init__.py +18 -7
  236. ansible/plugins/strategy/linear.py +1 -13
  237. ansible/plugins/test/core.py +23 -1
  238. ansible/plugins/test/issubset.yml +1 -1
  239. ansible/plugins/test/subset.yml +1 -1
  240. ansible/plugins/test/timedout.yml +20 -0
  241. ansible/plugins/test/vault_encrypted.yml +6 -6
  242. ansible/plugins/test/vaulted_file.yml +19 -0
  243. ansible/release.py +2 -2
  244. ansible/template/__init__.py +3 -8
  245. ansible/utils/collection_loader/_collection_finder.py +23 -55
  246. ansible/utils/display.py +44 -31
  247. ansible/utils/galaxy.py +1 -1
  248. ansible/utils/jsonrpc.py +1 -1
  249. ansible/utils/listify.py +1 -5
  250. ansible/utils/path.py +3 -0
  251. ansible/utils/vars.py +18 -27
  252. ansible/vars/manager.py +7 -150
  253. ansible/vars/plugins.py +1 -1
  254. ansible_core-2.18.0rc1.dist-info/Apache-License.txt +202 -0
  255. {ansible_core-2.17.5rc1.dist-info → ansible_core-2.18.0rc1.dist-info}/METADATA +36 -23
  256. ansible_core-2.18.0rc1.dist-info/MIT-license.txt +14 -0
  257. ansible_core-2.18.0rc1.dist-info/PSF-license.txt +48 -0
  258. {ansible_core-2.17.5rc1.dist-info → ansible_core-2.18.0rc1.dist-info}/RECORD +321 -316
  259. {ansible_core-2.17.5rc1.dist-info → ansible_core-2.18.0rc1.dist-info}/entry_points.txt +1 -1
  260. ansible_core-2.18.0rc1.dist-info/simplified_bsd.txt +8 -0
  261. ansible_test/_data/completion/docker.txt +7 -7
  262. ansible_test/_data/completion/remote.txt +5 -4
  263. ansible_test/_data/completion/windows.txt +4 -4
  264. ansible_test/_data/requirements/ansible-test.txt +1 -2
  265. ansible_test/_data/requirements/constraints.txt +1 -2
  266. ansible_test/_data/requirements/sanity.ansible-doc.txt +3 -3
  267. ansible_test/_data/requirements/sanity.changelog.in +1 -1
  268. ansible_test/_data/requirements/sanity.changelog.txt +4 -4
  269. ansible_test/_data/requirements/sanity.import.plugin.txt +2 -2
  270. ansible_test/_data/requirements/sanity.import.txt +1 -1
  271. ansible_test/_data/requirements/sanity.integration-aliases.txt +1 -1
  272. ansible_test/_data/requirements/sanity.pep8.txt +1 -1
  273. ansible_test/_data/requirements/sanity.pylint.txt +6 -8
  274. ansible_test/_data/requirements/sanity.runtime-metadata.txt +2 -2
  275. ansible_test/_data/requirements/sanity.validate-modules.txt +3 -3
  276. ansible_test/_data/requirements/sanity.yamllint.in +1 -0
  277. ansible_test/_data/requirements/sanity.yamllint.txt +1 -1
  278. ansible_test/_internal/ansible_util.py +8 -35
  279. ansible_test/_internal/ci/azp.py +1 -1
  280. ansible_test/_internal/classification/__init__.py +0 -2
  281. ansible_test/_internal/cli/parsers/key_value_parsers.py +3 -0
  282. ansible_test/_internal/commands/integration/cloud/hcloud.py +1 -1
  283. ansible_test/_internal/commands/integration/cloud/httptester.py +1 -1
  284. ansible_test/_internal/commands/integration/cloud/nios.py +1 -1
  285. ansible_test/_internal/commands/sanity/__init__.py +96 -19
  286. ansible_test/_internal/commands/sanity/pylint.py +20 -24
  287. ansible_test/_internal/completion.py +2 -0
  288. ansible_test/_internal/constants.py +0 -1
  289. ansible_test/_internal/coverage_util.py +1 -2
  290. ansible_test/_internal/docker_util.py +10 -2
  291. ansible_test/_internal/encoding.py +4 -4
  292. ansible_test/_internal/host_configs.py +10 -0
  293. ansible_test/_internal/host_profiles.py +9 -13
  294. ansible_test/_internal/pypi_proxy.py +1 -1
  295. ansible_test/_internal/python_requirements.py +5 -14
  296. ansible_test/_internal/timeout.py +1 -1
  297. ansible_test/_internal/util.py +56 -8
  298. ansible_test/_internal/util_common.py +5 -1
  299. ansible_test/_util/controller/sanity/code-smell/action-plugin-docs.json +3 -1
  300. ansible_test/_util/controller/sanity/code-smell/action-plugin-docs.py +6 -3
  301. ansible_test/_util/controller/sanity/code-smell/empty-init.json +0 -2
  302. ansible_test/_util/controller/sanity/pylint/config/ansible-test-target.cfg +5 -0
  303. ansible_test/_util/controller/sanity/pylint/config/ansible-test.cfg +5 -0
  304. ansible_test/_util/controller/sanity/pylint/config/code-smell.cfg +5 -0
  305. ansible_test/_util/controller/sanity/pylint/config/collection.cfg +6 -0
  306. ansible_test/_util/controller/sanity/pylint/config/default.cfg +6 -0
  307. ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py +1 -19
  308. ansible_test/_util/controller/sanity/pylint/plugins/hide_unraisable.py +3 -4
  309. ansible_test/_util/controller/sanity/shellcheck/exclude.txt +1 -0
  310. ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py +67 -2
  311. ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py +27 -5
  312. ansible_test/_util/target/cli/ansible_test_cli_stub.py +0 -0
  313. ansible_test/_util/target/common/constants.py +2 -2
  314. ansible_test/_util/target/injector/python.py +5 -0
  315. ansible_test/_util/target/pytest/plugins/ansible_pytest_coverage.py +6 -0
  316. ansible_test/_util/target/sanity/import/importer.py +1 -1
  317. ansible_test/_util/target/setup/bootstrap.sh +6 -17
  318. ansible_test/_util/target/setup/requirements.py +18 -24
  319. ansible_test/config/config.yml +1 -1
  320. ansible_core-2.17.5rc1.data/scripts/ansible-test +0 -44
  321. ansible_test/_data/requirements/sanity.mypy.in +0 -10
  322. ansible_test/_data/requirements/sanity.mypy.txt +0 -18
  323. ansible_test/_internal/commands/sanity/mypy.py +0 -274
  324. ansible_test/_util/controller/sanity/mypy/ansible-core.ini +0 -116
  325. ansible_test/_util/controller/sanity/mypy/ansible-test.ini +0 -27
  326. ansible_test/_util/controller/sanity/mypy/modules.ini +0 -92
  327. ansible_test/_util/controller/sanity/mypy/packaging.ini +0 -20
  328. {ansible_core-2.17.5rc1.dist-info → ansible_core-2.18.0rc1.dist-info}/COPYING +0 -0
  329. {ansible_core-2.17.5rc1.dist-info → ansible_core-2.18.0rc1.dist-info}/WHEEL +0 -0
  330. {ansible_core-2.17.5rc1.dist-info → ansible_core-2.18.0rc1.dist-info}/top_level.txt +0 -0
@@ -6,7 +6,6 @@
6
6
 
7
7
  from __future__ import annotations
8
8
 
9
-
10
9
  DOCUMENTATION = '''
11
10
  ---
12
11
  module: yum_repository
@@ -23,9 +22,11 @@ options:
23
22
  - If set to V(true) Yum will download packages and metadata from this
24
23
  repo in parallel, if possible.
25
24
  - In ansible-core 2.11, 2.12, and 2.13 the default value is V(true).
26
- - This option has been deprecated in RHEL 8. If you're using one of the
27
- versions listed above, you can set this option to None to avoid passing an
25
+ - This option has been removed in RHEL 8. If you're using one of the
26
+ versions listed above, you can set this option to V(null) to avoid passing an
28
27
  unknown configuration option.
28
+ - This parameter is deprecated as it has been removed on systems supported by ansible-core
29
+ and will be removed in ansible-core 2.22.
29
30
  type: bool
30
31
  bandwidth:
31
32
  description:
@@ -50,6 +51,13 @@ options:
50
51
  - Relative cost of accessing this repository. Useful for weighing one
51
52
  repo's packages as greater/less than any other.
52
53
  type: str
54
+ countme:
55
+ description:
56
+ - Whether a special flag should be added to a randomly chosen metalink/mirrorlist query each week.
57
+ This allows the repository owner to estimate the number of systems consuming it.
58
+ default: ~
59
+ type: bool
60
+ version_added: '2.18'
53
61
  deltarpm_metadata_percentage:
54
62
  description:
55
63
  - When the relative size of deltarpm metadata vs pkgs is larger than
@@ -57,6 +65,8 @@ options:
57
65
  can give values over V(100), so V(200) means that the metadata is
58
66
  required to be half the size of the packages. Use V(0) to turn off
59
67
  this check, and always download metadata.
68
+ - This parameter is deprecated as it has no effect with dnf as an underlying package manager
69
+ and will be removed in ansible-core 2.22.
60
70
  type: str
61
71
  deltarpm_percentage:
62
72
  description:
@@ -66,8 +76,8 @@ options:
66
76
  type: str
67
77
  description:
68
78
  description:
69
- - A human-readable string describing the repository. This option corresponds to the "name" property in the repo file.
70
- - This parameter is only required if O(state) is set to V(present).
79
+ - A human-readable string describing the repository. This option corresponds to the C(name) property in the repo file.
80
+ - This parameter is only required if O(state=present).
71
81
  type: str
72
82
  enabled:
73
83
  description:
@@ -86,8 +96,11 @@ options:
86
96
  space separated list. Shell globs using wildcards (for example V(*) and V(?))
87
97
  are allowed.
88
98
  - The list can also be a regular YAML array.
99
+ - O(excludepkgs) alias was added in ansible-core 2.18.
89
100
  type: list
90
101
  elements: str
102
+ aliases:
103
+ - excludepkgs
91
104
  failovermethod:
92
105
  choices: [roundrobin, priority]
93
106
  description:
@@ -105,6 +118,8 @@ options:
105
118
  gpgcakey:
106
119
  description:
107
120
  - A URL pointing to the ASCII-armored CA key file for the repository.
121
+ - This parameter is deprecated as it has no effect with dnf as an underlying package manager
122
+ and will be removed in ansible-core 2.22.
108
123
  type: str
109
124
  gpgcheck:
110
125
  description:
@@ -122,7 +137,7 @@ options:
122
137
  module_hotfixes:
123
138
  description:
124
139
  - Disable module RPM filtering and make all RPMs from the repository
125
- available. The default is V(None).
140
+ available. The default is V(null).
126
141
  version_added: '2.11'
127
142
  type: bool
128
143
  http_caching:
@@ -133,6 +148,8 @@ options:
133
148
  - V(packages) means that only RPM package downloads should be cached (but
134
149
  not repository metadata downloads).
135
150
  - V(none) means that no HTTP downloads should be cached.
151
+ - This parameter is deprecated as it has no effect with dnf as an underlying package manager
152
+ and will be removed in ansible-core 2.22.
136
153
  choices: [all, packages, none]
137
154
  type: str
138
155
  include:
@@ -163,12 +180,15 @@ options:
163
180
  - This tells yum whether or not HTTP/1.1 keepalive should be used with
164
181
  this repository. This can improve transfer speeds by using one
165
182
  connection when downloading multiple files from a repository.
183
+ - This parameter is deprecated as it has no effect with dnf as an underlying package manager
184
+ and will be removed in ansible-core 2.22.
166
185
  type: bool
167
186
  keepcache:
168
187
  description:
169
188
  - Either V(1) or V(0). Determines whether or not yum keeps the cache of
170
189
  headers and packages after successful installation.
171
- - This parameter is deprecated and will be removed in version 2.20.
190
+ - This parameter is deprecated as it is only valid in the main configuration
191
+ and will be removed in ansible-core 2.20.
172
192
  choices: ['0', '1']
173
193
  type: str
174
194
  metadata_expire:
@@ -193,7 +213,9 @@ options:
193
213
  - V(read-only:future) - Commands that are likely to result in running
194
214
  other commands which will require the latest metadata. Eg.
195
215
  C(yum check-update).
196
- - Note that this option does not override "yum clean expire-cache".
216
+ - Note that this option does not override C(yum clean expire-cache).
217
+ - This parameter is deprecated as it has no effect with dnf as an underlying package manager
218
+ and will be removed in ansible-core 2.22.
197
219
  choices: [never, 'read-only:past', 'read-only:present', 'read-only:future']
198
220
  type: str
199
221
  metalink:
@@ -215,6 +237,8 @@ options:
215
237
  - Time (in seconds) after which the mirrorlist locally cached will
216
238
  expire.
217
239
  - Default value is 6 hours.
240
+ - This parameter is deprecated as it has no effect with dnf as an underlying package manager
241
+ and will be removed in ansible-core 2.22.
218
242
  type: str
219
243
  name:
220
244
  description:
@@ -236,6 +260,8 @@ options:
236
260
  protect:
237
261
  description:
238
262
  - Protect packages from updates from other repositories.
263
+ - This parameter is deprecated as it has no effect with dnf as an underlying package manager
264
+ and will be removed in ansible-core 2.22.
239
265
  type: bool
240
266
  proxy:
241
267
  description:
@@ -284,6 +310,8 @@ options:
284
310
  O(skip_if_unavailable) to be V(true). This is most useful for non-root
285
311
  processes which use yum on repos that have client cert files which are
286
312
  readable only by root.
313
+ - This parameter is deprecated as it has no effect with dnf as an underlying package manager
314
+ and will be removed in ansible-core 2.22.
287
315
  type: bool
288
316
  sslcacert:
289
317
  description:
@@ -329,6 +357,8 @@ options:
329
357
  - When a repository id is displayed, append these yum variables to the
330
358
  string if they are used in the O(baseurl)/etc. Variables are appended
331
359
  in the order listed (and found).
360
+ - This parameter is deprecated as it has no effect with dnf as an underlying package manager
361
+ and will be removed in ansible-core 2.22.
332
362
  type: str
333
363
  username:
334
364
  description:
@@ -412,158 +442,86 @@ state:
412
442
  sample: "present"
413
443
  '''
414
444
 
445
+ import configparser
415
446
  import os
416
447
 
417
- from ansible.module_utils.basic import AnsibleModule
418
- from ansible.module_utils.six.moves import configparser
448
+ from ansible.module_utils.basic import AnsibleModule, FILE_COMMON_ARGUMENTS
419
449
  from ansible.module_utils.common.text.converters import to_native
420
450
 
421
451
 
422
- class YumRepo(object):
423
- # Class global variables
424
- module = None
425
- params = None
426
- section = None
427
- repofile = configparser.RawConfigParser()
428
-
429
- # List of parameters which will be allowed in the repo file output
430
- allowed_params = [
431
- 'async',
432
- 'bandwidth',
433
- 'baseurl',
434
- 'cost',
435
- 'deltarpm_metadata_percentage',
436
- 'deltarpm_percentage',
437
- 'enabled',
438
- 'enablegroups',
439
- 'exclude',
440
- 'failovermethod',
441
- 'gpgcakey',
442
- 'gpgcheck',
443
- 'gpgkey',
444
- 'module_hotfixes',
445
- 'http_caching',
446
- 'include',
447
- 'includepkgs',
448
- 'ip_resolve',
449
- 'keepalive',
450
- 'keepcache',
451
- 'metadata_expire',
452
- 'metadata_expire_filter',
453
- 'metalink',
454
- 'mirrorlist',
455
- 'mirrorlist_expire',
456
- 'name',
457
- 'password',
458
- 'priority',
459
- 'protect',
460
- 'proxy',
461
- 'proxy_password',
462
- 'proxy_username',
463
- 'repo_gpgcheck',
464
- 'retries',
465
- 's3_enabled',
466
- 'skip_if_unavailable',
467
- 'sslcacert',
468
- 'ssl_check_cert_permissions',
469
- 'sslclientcert',
470
- 'sslclientkey',
471
- 'sslverify',
472
- 'throttle',
473
- 'timeout',
474
- 'ui_repoid_vars',
475
- 'username']
476
-
477
- # List of parameters which can be a list
478
- list_params = ['exclude', 'includepkgs']
479
-
480
- def __init__(self, module):
481
- # To be able to use fail_json
452
+ class YumRepo:
453
+ def __init__(self, module, params, repoid, dest):
482
454
  self.module = module
483
- # Shortcut for the params
484
- self.params = self.module.params
485
- # Section is always the repoid
486
- self.section = self.params['repoid']
487
-
488
- # Check if repo directory exists
489
- repos_dir = self.params['reposdir']
490
- if not os.path.isdir(repos_dir):
491
- self.module.fail_json(
492
- msg="Repo directory '%s' does not exist." % repos_dir)
493
-
494
- # Set dest; also used to set dest parameter for the FS attributes
495
- self.params['dest'] = os.path.join(
496
- repos_dir, "%s.repo" % self.params['file'])
497
-
498
- # Read the repo file if it exists
499
- if os.path.isfile(self.params['dest']):
500
- self.repofile.read(self.params['dest'])
455
+ self.params = params
456
+ self.section = repoid
457
+ self.repofile = configparser.RawConfigParser()
458
+ self.dest = dest
459
+ if os.path.isfile(dest):
460
+ self.repofile.read(dest)
501
461
 
502
462
  def add(self):
503
- # Remove already existing repo and create a new one
504
- if self.repofile.has_section(self.section):
505
- self.repofile.remove_section(self.section)
506
-
507
- # Add section
463
+ self.remove()
508
464
  self.repofile.add_section(self.section)
509
465
 
510
- # Baseurl/mirrorlist is not required because for removal we need only
511
- # the repo name. This is why we check if the baseurl/mirrorlist is
512
- # defined.
513
- req_params = (self.params['baseurl'], self.params['metalink'], self.params['mirrorlist'])
514
- if req_params == (None, None, None):
515
- self.module.fail_json(
516
- msg="Parameter 'baseurl', 'metalink' or 'mirrorlist' is required for "
517
- "adding a new repo.")
518
-
519
- # Set options
520
466
  for key, value in sorted(self.params.items()):
521
- if key in self.list_params and isinstance(value, list):
522
- # Join items into one string for specific parameters
523
- value = ' '.join(value)
524
- elif isinstance(value, bool):
525
- # Convert boolean value to integer
526
- value = int(value)
527
-
528
- # Set the value only if it was defined (default is None)
529
- if value is not None and key in self.allowed_params:
530
- if key == 'keepcache':
531
- self.module.deprecate(
532
- "'keepcache' parameter is deprecated.",
533
- version='2.20'
534
- )
535
- self.repofile.set(self.section, key, value)
467
+ if value is None:
468
+ continue
469
+ if key == 'keepcache':
470
+ self.module.deprecate(
471
+ "'keepcache' parameter is deprecated as it is only valid in "
472
+ "the main configuration.",
473
+ version='2.20'
474
+ )
475
+ elif key == 'async':
476
+ self.module.deprecate(
477
+ "'async' parameter is deprecated as it has been removed on systems supported by ansible-core",
478
+ version='2.22',
479
+ )
480
+ elif key in {
481
+ "deltarpm_metadata_percentage",
482
+ "gpgcakey",
483
+ "http_caching",
484
+ "keepalive",
485
+ "metadata_expire_filter",
486
+ "mirrorlist_expire",
487
+ "protect",
488
+ "ssl_check_cert_permissions",
489
+ "ui_repoid_vars",
490
+ }:
491
+ self.module.deprecate(
492
+ f"'{key}' parameter is deprecated as it has no effect with dnf "
493
+ "as an underlying package manager.",
494
+ version='2.22'
495
+ )
496
+ if isinstance(value, bool):
497
+ value = str(int(value))
498
+ self.repofile.set(self.section, key, value)
536
499
 
537
500
  def save(self):
538
- if len(self.repofile.sections()):
539
- # Write data into the file
501
+ if self.repofile.sections():
540
502
  try:
541
- with open(self.params['dest'], 'w') as fd:
503
+ with open(self.dest, 'w') as fd:
542
504
  self.repofile.write(fd)
543
505
  except IOError as e:
544
506
  self.module.fail_json(
545
- msg="Problems handling file %s." % self.params['dest'],
546
- details=to_native(e))
507
+ msg=f"Problems handling file {self.dest}.",
508
+ details=to_native(e),
509
+ )
547
510
  else:
548
- # Remove the file if there are not repos
549
511
  try:
550
- os.remove(self.params['dest'])
512
+ os.remove(self.dest)
551
513
  except OSError as e:
552
514
  self.module.fail_json(
553
- msg=(
554
- "Cannot remove empty repo file %s." %
555
- self.params['dest']),
556
- details=to_native(e))
515
+ msg=f"Cannot remove empty repo file {self.dest}.",
516
+ details=to_native(e),
517
+ )
557
518
 
558
519
  def remove(self):
559
- # Remove section if exists
560
- if self.repofile.has_section(self.section):
561
- self.repofile.remove_section(self.section)
520
+ self.repofile.remove_section(self.section)
562
521
 
563
522
  def dump(self):
564
523
  repo_string = ""
565
524
 
566
- # Compose the repo file
567
525
  for section in sorted(self.repofile.sections()):
568
526
  repo_string += "[%s]\n" % section
569
527
 
@@ -576,17 +534,17 @@ class YumRepo(object):
576
534
 
577
535
 
578
536
  def main():
579
- # Module settings
580
537
  argument_spec = dict(
581
538
  bandwidth=dict(),
582
539
  baseurl=dict(type='list', elements='str'),
583
540
  cost=dict(),
541
+ countme=dict(type='bool'),
584
542
  deltarpm_metadata_percentage=dict(),
585
543
  deltarpm_percentage=dict(),
586
544
  description=dict(),
587
545
  enabled=dict(type='bool'),
588
546
  enablegroups=dict(type='bool'),
589
- exclude=dict(type='list', elements='str'),
547
+ exclude=dict(type='list', elements='str', aliases=['excludepkgs']),
590
548
  failovermethod=dict(choices=['roundrobin', 'priority']),
591
549
  file=dict(),
592
550
  gpgcakey=dict(no_log=False),
@@ -633,78 +591,77 @@ def main():
633
591
  username=dict(),
634
592
  )
635
593
 
594
+ # async is a Python keyword
636
595
  argument_spec['async'] = dict(type='bool')
637
596
 
638
597
  module = AnsibleModule(
598
+ required_if=[
599
+ ["state", "present", ["baseurl", "mirrorlist", "metalink"], True],
600
+ ["state", "present", ["description"]],
601
+ ],
639
602
  argument_spec=argument_spec,
640
603
  add_file_common_args=True,
641
604
  supports_check_mode=True,
642
605
  )
643
606
 
644
- name = module.params['name']
645
- state = module.params['state']
607
+ # make copy of params as we need to split them into yum repo only and file params
608
+ yum_repo_params = module.params.copy()
609
+ for alias in module.aliases:
610
+ yum_repo_params.pop(alias, None)
611
+
612
+ file_common_params = {}
613
+ for param in FILE_COMMON_ARGUMENTS:
614
+ file_common_params[param] = yum_repo_params.pop(param)
615
+
616
+ state = yum_repo_params.pop("state")
617
+ name = yum_repo_params['name']
618
+ yum_repo_params['name'] = yum_repo_params.pop('description')
619
+
620
+ for list_param in ('baseurl', 'gpgkey'):
621
+ v = yum_repo_params[list_param]
622
+ if v is not None:
623
+ yum_repo_params[list_param] = '\n'.join(v)
624
+
625
+ for list_param in ('exclude', 'includepkgs'):
626
+ v = yum_repo_params[list_param]
627
+ if v is not None:
628
+ yum_repo_params[list_param] = ' '.join(v)
629
+
630
+ repos_dir = yum_repo_params.pop("reposdir")
631
+ if not os.path.isdir(repos_dir):
632
+ module.fail_json(
633
+ msg="Repo directory '%s' does not exist." % repos_dir
634
+ )
635
+
636
+ if (file := yum_repo_params.pop("file")) is None:
637
+ file = name
638
+ file_common_params["dest"] = os.path.join(repos_dir, f"{file}.repo")
639
+
640
+ yumrepo = YumRepo(module, yum_repo_params, name, file_common_params["dest"])
646
641
 
647
- # Check if required parameters are present
648
- if state == 'present':
649
- if (
650
- module.params['baseurl'] is None and
651
- module.params['metalink'] is None and
652
- module.params['mirrorlist'] is None):
653
- module.fail_json(
654
- msg="Parameter 'baseurl', 'metalink' or 'mirrorlist' is required.")
655
- if module.params['description'] is None:
656
- module.fail_json(
657
- msg="Parameter 'description' is required.")
658
-
659
- # Rename "name" and "description" to ensure correct key sorting
660
- module.params['repoid'] = module.params['name']
661
- module.params['name'] = module.params['description']
662
- del module.params['description']
663
-
664
- # Change list type to string for baseurl and gpgkey
665
- for list_param in ['baseurl', 'gpgkey']:
666
- if (
667
- list_param in module.params and
668
- module.params[list_param] is not None):
669
- module.params[list_param] = "\n".join(module.params[list_param])
670
-
671
- # Define repo file name if it doesn't exist
672
- if module.params['file'] is None:
673
- module.params['file'] = module.params['repoid']
674
-
675
- # Instantiate the YumRepo object
676
- yumrepo = YumRepo(module)
677
-
678
- # Get repo status before change
679
642
  diff = {
680
- 'before_header': yumrepo.params['dest'],
643
+ 'before_header': file_common_params["dest"],
681
644
  'before': yumrepo.dump(),
682
- 'after_header': yumrepo.params['dest'],
645
+ 'after_header': file_common_params["dest"],
683
646
  'after': ''
684
647
  }
685
648
 
686
- # Perform action depending on the state
687
649
  if state == 'present':
688
650
  yumrepo.add()
689
651
  elif state == 'absent':
690
652
  yumrepo.remove()
691
653
 
692
- # Get repo status after change
693
654
  diff['after'] = yumrepo.dump()
694
655
 
695
- # Compare repo states
696
656
  changed = diff['before'] != diff['after']
697
657
 
698
- # Save the file only if not in check mode and if there was a change
699
658
  if not module.check_mode and changed:
700
659
  yumrepo.save()
701
660
 
702
- # Change file attributes if needed
703
- if os.path.isfile(module.params['dest']):
704
- file_args = module.load_file_common_arguments(module.params)
661
+ if os.path.isfile(file_common_params["dest"]):
662
+ file_args = module.load_file_common_arguments(file_common_params)
705
663
  changed = module.set_fs_attributes_if_different(file_args, changed)
706
664
 
707
- # Print status of the change
708
665
  module.exit_json(changed=changed, repo=name, state=state, diff=diff)
709
666
 
710
667
 
@@ -18,7 +18,7 @@ from ansible.module_utils.six import binary_type, text_type
18
18
  from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text
19
19
  from ansible.parsing.quoting import unquote
20
20
  from ansible.parsing.utils.yaml import from_yaml
21
- from ansible.parsing.vault import VaultLib, b_HEADER, is_encrypted, is_encrypted_file, parse_vaulttext_envelope, PromptVaultSecret
21
+ from ansible.parsing.vault import VaultLib, is_encrypted, is_encrypted_file, parse_vaulttext_envelope, PromptVaultSecret
22
22
  from ansible.utils.path import unfrackpath
23
23
  from ansible.utils.display import Display
24
24
 
@@ -388,7 +388,7 @@ class DataLoader:
388
388
  # Limit how much of the file is read since we do not know
389
389
  # whether this is a vault file and therefore it could be very
390
390
  # large.
391
- if is_encrypted_file(f, count=len(b_HEADER)):
391
+ if is_encrypted_file(f):
392
392
  # if the file is encrypted and no password was specified,
393
393
  # the decrypt call would throw an error, but we check first
394
394
  # since the decrypt function doesn't know the file name
@@ -28,11 +28,8 @@ from ansible.utils.fqcn import add_internal_fqcns
28
28
  from ansible.utils.sentinel import Sentinel
29
29
 
30
30
 
31
- # For filtering out modules correctly below
32
- FREEFORM_ACTIONS = frozenset(C.MODULE_REQUIRE_ARGS)
33
-
34
- RAW_PARAM_MODULES = FREEFORM_ACTIONS.union(add_internal_fqcns((
35
- 'include',
31
+ # modules formated for user msg
32
+ _BUILTIN_RAW_PARAM_MODULES_SIMPLE = set([
36
33
  'include_vars',
37
34
  'include_tasks',
38
35
  'include_role',
@@ -42,8 +39,12 @@ RAW_PARAM_MODULES = FREEFORM_ACTIONS.union(add_internal_fqcns((
42
39
  'group_by',
43
40
  'set_fact',
44
41
  'meta',
45
- )))
46
-
42
+ ])
43
+ FREEFORM_ACTIONS_SIMPLE = set(C.MODULE_REQUIRE_ARGS_SIMPLE)
44
+ FREEFORM_ACTIONS = frozenset(C.MODULE_REQUIRE_ARGS)
45
+ RAW_PARAM_MODULES_SIMPLE = _BUILTIN_RAW_PARAM_MODULES_SIMPLE.union(FREEFORM_ACTIONS_SIMPLE)
46
+ # For filtering out modules correctly below, use all permutations
47
+ RAW_PARAM_MODULES = frozenset(add_internal_fqcns(RAW_PARAM_MODULES_SIMPLE)).union(FREEFORM_ACTIONS)
47
48
  BUILTIN_TASKS = frozenset(add_internal_fqcns((
48
49
  'meta',
49
50
  'include_tasks',
@@ -358,8 +359,8 @@ class ModuleArgsParser:
358
359
  if templar.is_template(raw_params):
359
360
  args['_variable_params'] = raw_params
360
361
  else:
361
- raise AnsibleParserError("this task '%s' has extra params, which is only allowed in the following modules: %s" % (action,
362
- ", ".join(RAW_PARAM_MODULES)),
363
- obj=self._task_ds)
362
+ raise AnsibleParserError(
363
+ "this task '%s' has extra params, which is only allowed in the following modules: %s" % (action, ", ".join(RAW_PARAM_MODULES_SIMPLE)),
364
+ obj=self._task_ds)
364
365
 
365
366
  return (action, args, delegate_to)
@@ -103,15 +103,17 @@ def is_encrypted(data):
103
103
  return False
104
104
 
105
105
 
106
- def is_encrypted_file(file_obj, start_pos=0, count=-1):
106
+ def is_encrypted_file(file_obj, start_pos=0, count=len(b_HEADER)):
107
107
  """Test if the contents of a file obj are a vault encrypted data blob.
108
108
 
109
109
  :arg file_obj: A file object that will be read from.
110
110
  :kwarg start_pos: A byte offset in the file to start reading the header
111
111
  from. Defaults to 0, the beginning of the file.
112
112
  :kwarg count: Read up to this number of bytes from the file to determine
113
- if it looks like encrypted vault data. The default is -1, read to the
114
- end of file.
113
+ if it looks like encrypted vault data. The default is the size of the
114
+ the vault header, which is what is needed most times.
115
+ For some IO classes, or files that don't begin with the vault itself,
116
+ set to -1 to read to the end of file.
115
117
  :returns: True if the file looks like a vault file. Otherwise, False.
116
118
  """
117
119
  # read the header and reset the file stream to where it started
@@ -357,6 +359,9 @@ def get_file_vault_secret(filename=None, vault_id=None, encoding=None, loader=No
357
359
  if not os.path.exists(this_path):
358
360
  raise AnsibleError("The vault password file %s was not found" % this_path)
359
361
 
362
+ if os.path.isdir(this_path):
363
+ raise AnsibleError(f"The vault password file provided '{this_path}' can not be a directory")
364
+
360
365
  # it is a script?
361
366
  if loader.is_executable(this_path):
362
367
 
@@ -147,30 +147,32 @@ class AnsibleConstructor(SafeConstructor):
147
147
 
148
148
  AnsibleConstructor.add_constructor(
149
149
  u'tag:yaml.org,2002:map',
150
- AnsibleConstructor.construct_yaml_map)
150
+ AnsibleConstructor.construct_yaml_map) # type: ignore[type-var]
151
151
 
152
152
  AnsibleConstructor.add_constructor(
153
153
  u'tag:yaml.org,2002:python/dict',
154
- AnsibleConstructor.construct_yaml_map)
154
+ AnsibleConstructor.construct_yaml_map) # type: ignore[type-var]
155
155
 
156
156
  AnsibleConstructor.add_constructor(
157
157
  u'tag:yaml.org,2002:str',
158
- AnsibleConstructor.construct_yaml_str)
158
+ AnsibleConstructor.construct_yaml_str) # type: ignore[type-var]
159
159
 
160
160
  AnsibleConstructor.add_constructor(
161
161
  u'tag:yaml.org,2002:python/unicode',
162
- AnsibleConstructor.construct_yaml_str)
162
+ AnsibleConstructor.construct_yaml_str) # type: ignore[type-var]
163
163
 
164
164
  AnsibleConstructor.add_constructor(
165
165
  u'tag:yaml.org,2002:seq',
166
- AnsibleConstructor.construct_yaml_seq)
166
+ AnsibleConstructor.construct_yaml_seq) # type: ignore[type-var]
167
167
 
168
168
  AnsibleConstructor.add_constructor(
169
169
  u'!unsafe',
170
- AnsibleConstructor.construct_yaml_unsafe)
170
+ AnsibleConstructor.construct_yaml_unsafe) # type: ignore[type-var]
171
171
 
172
172
  AnsibleConstructor.add_constructor(
173
173
  u'!vault',
174
- AnsibleConstructor.construct_vault_encrypted_unicode)
174
+ AnsibleConstructor.construct_vault_encrypted_unicode) # type: ignore[type-var]
175
175
 
176
- AnsibleConstructor.add_constructor(u'!vault-encrypted', AnsibleConstructor.construct_vault_encrypted_unicode)
176
+ AnsibleConstructor.add_constructor(
177
+ u'!vault-encrypted',
178
+ AnsibleConstructor.construct_vault_encrypted_unicode) # type: ignore[type-var]
@@ -122,7 +122,7 @@ class AnsibleVaultEncryptedUnicode(Sequence, AnsibleBaseYAMLObject):
122
122
  return True
123
123
 
124
124
  def __reversed__(self):
125
- # This gets inerhited from ``collections.Sequence`` which returns a generator
125
+ # This gets inherited from ``collections.Sequence`` which returns a generator
126
126
  # make this act more like the string implementation
127
127
  return to_text(self[::-1], errors='surrogate_or_strict')
128
128