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
@@ -324,12 +324,11 @@ from ansible.utils.hashing import sha1
324
324
  HAS_PYPSRP = True
325
325
  PYPSRP_IMP_ERR = None
326
326
  try:
327
- import pypsrp
328
327
  from pypsrp.complex_objects import GenericComplexObject, PSInvocationState, RunspacePoolState
329
328
  from pypsrp.exceptions import AuthenticationError, WinRMError
330
329
  from pypsrp.host import PSHost, PSHostUserInterface
331
330
  from pypsrp.powershell import PowerShell, RunspacePool
332
- from pypsrp.wsman import WSMan, AUTH_KWARGS
331
+ from pypsrp.wsman import WSMan
333
332
  from requests.exceptions import ConnectionError, ConnectTimeout
334
333
  except ImportError as err:
335
334
  HAS_PYPSRP = False
@@ -344,9 +343,8 @@ class Connection(ConnectionBase):
344
343
  module_implementation_preferences = ('.ps1', '.exe', '')
345
344
  allow_executable = False
346
345
  has_pipelining = True
347
- allow_extras = True
348
346
 
349
- # Satifies mypy as this connection only ever runs with this plugin
347
+ # Satisfies mypy as this connection only ever runs with this plugin
350
348
  _shell: PowerShellPlugin
351
349
 
352
350
  def __init__(self, *args: t.Any, **kwargs: t.Any) -> None:
@@ -712,7 +710,6 @@ if ($read -gt 0) {
712
710
  def _build_kwargs(self) -> None:
713
711
  self._psrp_host = self.get_option('remote_addr')
714
712
  self._psrp_user = self.get_option('remote_user')
715
- self._psrp_pass = self.get_option('remote_password')
716
713
 
717
714
  protocol = self.get_option('protocol')
718
715
  port = self.get_option('port')
@@ -724,95 +721,49 @@ if ($read -gt 0) {
724
721
  elif port is None:
725
722
  port = 5986 if protocol == 'https' else 5985
726
723
 
727
- self._psrp_protocol = protocol
728
724
  self._psrp_port = int(port)
729
-
730
- self._psrp_path = self.get_option('path')
731
725
  self._psrp_auth = self.get_option('auth')
726
+ self._psrp_configuration_name = self.get_option('configuration_name')
727
+
732
728
  # cert validation can either be a bool or a path to the cert
733
729
  cert_validation = self.get_option('cert_validation')
734
730
  cert_trust_path = self.get_option('ca_cert')
735
731
  if cert_validation == 'ignore':
736
- self._psrp_cert_validation = False
732
+ psrp_cert_validation = False
737
733
  elif cert_trust_path is not None:
738
- self._psrp_cert_validation = cert_trust_path
734
+ psrp_cert_validation = cert_trust_path
739
735
  else:
740
- self._psrp_cert_validation = True
741
-
742
- self._psrp_connection_timeout = self.get_option('connection_timeout') # Can be None
743
- self._psrp_read_timeout = self.get_option('read_timeout') # Can be None
744
- self._psrp_message_encryption = self.get_option('message_encryption')
745
- self._psrp_proxy = self.get_option('proxy')
746
- self._psrp_ignore_proxy = boolean(self.get_option('ignore_proxy'))
747
- self._psrp_operation_timeout = int(self.get_option('operation_timeout'))
748
- self._psrp_max_envelope_size = int(self.get_option('max_envelope_size'))
749
- self._psrp_configuration_name = self.get_option('configuration_name')
750
- self._psrp_reconnection_retries = int(self.get_option('reconnection_retries'))
751
- self._psrp_reconnection_backoff = float(self.get_option('reconnection_backoff'))
752
-
753
- self._psrp_certificate_key_pem = self.get_option('certificate_key_pem')
754
- self._psrp_certificate_pem = self.get_option('certificate_pem')
755
- self._psrp_credssp_auth_mechanism = self.get_option('credssp_auth_mechanism')
756
- self._psrp_credssp_disable_tlsv1_2 = self.get_option('credssp_disable_tlsv1_2')
757
- self._psrp_credssp_minimum_version = self.get_option('credssp_minimum_version')
758
- self._psrp_negotiate_send_cbt = self.get_option('negotiate_send_cbt')
759
- self._psrp_negotiate_delegate = self.get_option('negotiate_delegate')
760
- self._psrp_negotiate_hostname_override = self.get_option('negotiate_hostname_override')
761
- self._psrp_negotiate_service = self.get_option('negotiate_service')
762
-
763
- supported_args = []
764
- for auth_kwarg in AUTH_KWARGS.values():
765
- supported_args.extend(auth_kwarg)
766
- extra_args = {v.replace('ansible_psrp_', '') for v in self.get_option('_extras')}
767
- unsupported_args = extra_args.difference(supported_args)
768
-
769
- for arg in unsupported_args:
770
- display.warning("ansible_psrp_%s is unsupported by the current "
771
- "psrp version installed" % arg)
736
+ psrp_cert_validation = True
772
737
 
773
738
  self._psrp_conn_kwargs = dict(
774
- server=self._psrp_host, port=self._psrp_port,
775
- username=self._psrp_user, password=self._psrp_pass,
776
- ssl=self._psrp_protocol == 'https', path=self._psrp_path,
777
- auth=self._psrp_auth, cert_validation=self._psrp_cert_validation,
778
- connection_timeout=self._psrp_connection_timeout,
779
- encryption=self._psrp_message_encryption, proxy=self._psrp_proxy,
780
- no_proxy=self._psrp_ignore_proxy,
781
- max_envelope_size=self._psrp_max_envelope_size,
782
- operation_timeout=self._psrp_operation_timeout,
783
- certificate_key_pem=self._psrp_certificate_key_pem,
784
- certificate_pem=self._psrp_certificate_pem,
785
- credssp_auth_mechanism=self._psrp_credssp_auth_mechanism,
786
- credssp_disable_tlsv1_2=self._psrp_credssp_disable_tlsv1_2,
787
- credssp_minimum_version=self._psrp_credssp_minimum_version,
788
- negotiate_send_cbt=self._psrp_negotiate_send_cbt,
789
- negotiate_delegate=self._psrp_negotiate_delegate,
790
- negotiate_hostname_override=self._psrp_negotiate_hostname_override,
791
- negotiate_service=self._psrp_negotiate_service,
739
+ server=self._psrp_host,
740
+ port=self._psrp_port,
741
+ username=self._psrp_user,
742
+ password=self.get_option('remote_password'),
743
+ ssl=protocol == 'https',
744
+ path=self.get_option('path'),
745
+ auth=self._psrp_auth,
746
+ cert_validation=psrp_cert_validation,
747
+ connection_timeout=self.get_option('connection_timeout'),
748
+ encryption=self.get_option('message_encryption'),
749
+ proxy=self.get_option('proxy'),
750
+ no_proxy=boolean(self.get_option('ignore_proxy')),
751
+ max_envelope_size=self.get_option('max_envelope_size'),
752
+ operation_timeout=self.get_option('operation_timeout'),
753
+ read_timeout=self.get_option('read_timeout'),
754
+ reconnection_retries=self.get_option('reconnection_retries'),
755
+ reconnection_backoff=float(self.get_option('reconnection_backoff')),
756
+ certificate_key_pem=self.get_option('certificate_key_pem'),
757
+ certificate_pem=self.get_option('certificate_pem'),
758
+ credssp_auth_mechanism=self.get_option('credssp_auth_mechanism'),
759
+ credssp_disable_tlsv1_2=self.get_option('credssp_disable_tlsv1_2'),
760
+ credssp_minimum_version=self.get_option('credssp_minimum_version'),
761
+ negotiate_send_cbt=self.get_option('negotiate_send_cbt'),
762
+ negotiate_delegate=self.get_option('negotiate_delegate'),
763
+ negotiate_hostname_override=self.get_option('negotiate_hostname_override'),
764
+ negotiate_service=self.get_option('negotiate_service'),
792
765
  )
793
766
 
794
- # Check if PSRP version supports newer read_timeout argument (needs pypsrp 0.3.0+)
795
- if hasattr(pypsrp, 'FEATURES') and 'wsman_read_timeout' in pypsrp.FEATURES:
796
- self._psrp_conn_kwargs['read_timeout'] = self._psrp_read_timeout
797
- elif self._psrp_read_timeout is not None:
798
- display.warning("ansible_psrp_read_timeout is unsupported by the current psrp version installed, "
799
- "using ansible_psrp_connection_timeout value for read_timeout instead.")
800
-
801
- # Check if PSRP version supports newer reconnection_retries argument (needs pypsrp 0.3.0+)
802
- if hasattr(pypsrp, 'FEATURES') and 'wsman_reconnections' in pypsrp.FEATURES:
803
- self._psrp_conn_kwargs['reconnection_retries'] = self._psrp_reconnection_retries
804
- self._psrp_conn_kwargs['reconnection_backoff'] = self._psrp_reconnection_backoff
805
- else:
806
- if self._psrp_reconnection_retries is not None:
807
- display.warning("ansible_psrp_reconnection_retries is unsupported by the current psrp version installed.")
808
- if self._psrp_reconnection_backoff is not None:
809
- display.warning("ansible_psrp_reconnection_backoff is unsupported by the current psrp version installed.")
810
-
811
- # add in the extra args that were set
812
- for arg in extra_args.intersection(supported_args):
813
- option = self.get_option('_extras')['ansible_psrp_%s' % arg]
814
- self._psrp_conn_kwargs[arg] = option
815
-
816
767
  def _exec_psrp_script(
817
768
  self,
818
769
  script: str,
@@ -1306,14 +1306,6 @@ class Connection(ConnectionBase):
1306
1306
  # prompt that will not occur
1307
1307
  sudoable = False
1308
1308
 
1309
- # Make sure our first command is to set the console encoding to
1310
- # utf-8, this must be done via chcp to get utf-8 (65001)
1311
- # union-attr ignores rely on internal powershell shell plugin details,
1312
- # this should be fixed at a future point in time.
1313
- cmd_parts = ["chcp.com", "65001", self._shell._SHELL_REDIRECT_ALLNULL, self._shell._SHELL_AND] # type: ignore[union-attr]
1314
- cmd_parts.extend(self._shell._encode_script(cmd, as_list=True, strict_mode=False, preserve_rc=False)) # type: ignore[union-attr]
1315
- cmd = ' '.join(cmd_parts)
1316
-
1317
1309
  # we can only use tty when we are not pipelining the modules. piping
1318
1310
  # data into /usr/bin/python inside a tty automatically invokes the
1319
1311
  # python interactive-mode but the modules are not compatible with the
@@ -207,6 +207,14 @@ except ImportError as e:
207
207
  HAS_WINRM = False
208
208
  WINRM_IMPORT_ERR = e
209
209
 
210
+ try:
211
+ from winrm.exceptions import WSManFaultError
212
+ except ImportError:
213
+ # This was added in pywinrm 0.5.0, we just use our no-op exception for
214
+ # older versions which won't be able to handle this scenario.
215
+ class WSManFaultError(Exception): # type: ignore[no-redef]
216
+ pass
217
+
210
218
  try:
211
219
  import xmltodict
212
220
  HAS_XMLTODICT = True
@@ -633,7 +641,11 @@ class Connection(ConnectionBase):
633
641
  command_id = None
634
642
  try:
635
643
  stdin_push_failed = False
636
- command_id = self.protocol.run_command(self.shell_id, to_bytes(command), map(to_bytes, args), console_mode_stdin=(stdin_iterator is None))
644
+ command_id = self._winrm_run_command(
645
+ to_bytes(command),
646
+ tuple(map(to_bytes, args)),
647
+ console_mode_stdin=(stdin_iterator is None),
648
+ )
637
649
 
638
650
  try:
639
651
  if stdin_iterator:
@@ -697,6 +709,39 @@ class Connection(ConnectionBase):
697
709
 
698
710
  display.warning("Failed to cleanup running WinRM command, resources might still be in use on the target server")
699
711
 
712
+ def _winrm_run_command(
713
+ self,
714
+ command: bytes,
715
+ args: tuple[bytes, ...],
716
+ console_mode_stdin: bool = False,
717
+ ) -> str:
718
+ """Starts a command with handling when the WSMan quota is exceeded."""
719
+ try:
720
+ return self.protocol.run_command(
721
+ self.shell_id,
722
+ command,
723
+ args,
724
+ console_mode_stdin=console_mode_stdin,
725
+ )
726
+ except WSManFaultError as fault_error:
727
+ if fault_error.wmierror_code != 0x803381A6:
728
+ raise
729
+
730
+ # 0x803381A6 == ERROR_WSMAN_QUOTA_MAX_OPERATIONS
731
+ # WinRS does not decrement the operation count for commands,
732
+ # only way to avoid this is to re-create the shell. This is
733
+ # important for action plugins that might be running multiple
734
+ # processes in the same connection.
735
+ display.vvvvv("Shell operation quota exceeded, re-creating shell", host=self._winrm_host)
736
+ self.close()
737
+ self._connect()
738
+ return self.protocol.run_command(
739
+ self.shell_id,
740
+ command,
741
+ args,
742
+ console_mode_stdin=console_mode_stdin,
743
+ )
744
+
700
745
  def _connect(self) -> Connection:
701
746
 
702
747
  if not HAS_WINRM:
@@ -14,8 +14,8 @@ options:
14
14
  - Pipelining reduces the number of connection operations required to execute a module on the remote server,
15
15
  by executing many Ansible modules without actual file transfers.
16
16
  - This can result in a very significant performance improvement when enabled.
17
- - However this can conflict with privilege escalation (become).
18
- For example, when using sudo operations you must first disable 'requiretty' in the sudoers file for the target hosts,
17
+ - However this can conflict with privilege escalation (C(become)).
18
+ For example, when using sudo operations you must first disable C(requiretty) in the sudoers file for the target hosts,
19
19
  which is why this feature is disabled by default.
20
20
  env:
21
21
  - name: ANSIBLE_PIPELINING
@@ -32,19 +32,19 @@ options:
32
32
  suboptions:
33
33
  parent_group:
34
34
  type: str
35
- description: parent group for keyed group
35
+ description: parent group for keyed group.
36
36
  prefix:
37
37
  type: str
38
- description: A keyed group name will start with this prefix
38
+ description: A keyed group name will start with this prefix.
39
39
  default: ''
40
40
  separator:
41
41
  type: str
42
- description: separator used to build the keyed group name
42
+ description: separator used to build the keyed group name.
43
43
  default: "_"
44
44
  key:
45
45
  type: str
46
46
  description:
47
- - The key from input dictionary used to generate groups
47
+ - The key from input dictionary used to generate groups.
48
48
  default_value:
49
49
  description:
50
50
  - The default value when the host variable's value is an empty string.
@@ -53,16 +53,16 @@ options:
53
53
  version_added: '2.12'
54
54
  trailing_separator:
55
55
  description:
56
- - Set this option to V(False) to omit the O(keyed_groups[].separator) after the host variable when the value is an empty string.
56
+ - Set this option to V(false) to omit the O(keyed_groups[].separator) after the host variable when the value is an empty string.
57
57
  - This option is mutually exclusive with O(keyed_groups[].default_value).
58
58
  type: bool
59
- default: True
59
+ default: true
60
60
  version_added: '2.12'
61
61
  use_extra_vars:
62
62
  version_added: '2.11'
63
63
  description: Merge extra vars into the available variables for composition (highest precedence).
64
64
  type: bool
65
- default: False
65
+ default: false
66
66
  ini:
67
67
  - section: inventory_plugins
68
68
  key: use_extra_vars
@@ -70,10 +70,10 @@ options:
70
70
  - name: ANSIBLE_INVENTORY_USE_EXTRA_VARS
71
71
  leading_separator:
72
72
  description:
73
- - Use in conjunction with keyed_groups.
73
+ - Use in conjunction with O(keyed_groups).
74
74
  - By default, a keyed group that does not have a prefix or a separator provided will have a name that starts with an underscore.
75
- - This is because the default prefix is "" and the default separator is "_".
76
- - Set this option to False to omit the leading underscore (or other separator) if no prefix is given.
75
+ - This is because the default prefix is V("") and the default separator is V("_").
76
+ - Set this option to V(false) to omit the leading underscore (or other separator) if no prefix is given.
77
77
  - If the group name is derived from a mapping the separator is still used to concatenate the items.
78
78
  - To not use a separator in the group name at all, set the separator for the keyed group to an empty string instead.
79
79
  type: boolean
@@ -11,7 +11,7 @@ class ModuleDocFragment(object):
11
11
  options:
12
12
  display_skipped_hosts:
13
13
  name: Show skipped hosts
14
- description: "Toggle to control displaying skipped task/host results in a task"
14
+ description: "Toggle to control displaying skipped task/host results in a task."
15
15
  type: bool
16
16
  default: yes
17
17
  env:
@@ -21,7 +21,7 @@ class ModuleDocFragment(object):
21
21
  section: defaults
22
22
  display_ok_hosts:
23
23
  name: Show 'ok' hosts
24
- description: "Toggle to control displaying 'ok' task/host results in a task"
24
+ description: "Toggle to control displaying 'ok' task/host results in a task."
25
25
  type: bool
26
26
  default: yes
27
27
  env:
@@ -32,7 +32,7 @@ class ModuleDocFragment(object):
32
32
  version_added: '2.7'
33
33
  display_failed_stderr:
34
34
  name: Use STDERR for failed and unreachable tasks
35
- description: "Toggle to control whether failed and unreachable tasks are displayed to STDERR (vs. STDOUT)"
35
+ description: "Toggle to control whether failed and unreachable tasks are displayed to STDERR rather than STDOUT."
36
36
  type: bool
37
37
  default: no
38
38
  env:
@@ -43,7 +43,7 @@ class ModuleDocFragment(object):
43
43
  version_added: '2.7'
44
44
  show_custom_stats:
45
45
  name: Show custom stats
46
- description: 'This adds the custom stats set via the set_stats plugin to the play recap'
46
+ description: 'This adds the custom stats set via the set_stats plugin to the play recap.'
47
47
  type: bool
48
48
  default: no
49
49
  env:
@@ -53,7 +53,7 @@ class ModuleDocFragment(object):
53
53
  section: defaults
54
54
  show_per_host_start:
55
55
  name: Show per host task start
56
- description: 'This adds output that shows when a task is started to execute for each host'
56
+ description: 'This adds output that shows when a task starts to execute for each host.'
57
57
  type: bool
58
58
  default: no
59
59
  env:
@@ -67,7 +67,7 @@ class ModuleDocFragment(object):
67
67
  description:
68
68
  - Toggle to control displaying markers when running in check mode.
69
69
  - "The markers are C(DRY RUN) at the beginning and ending of playbook execution (when calling C(ansible-playbook --check))
70
- and C(CHECK MODE) as a suffix at every play and task that is run in check mode."
70
+ and C(CHECK MODE) as a suffix at every play and task that is run in check mode."
71
71
  type: bool
72
72
  default: no
73
73
  version_added: '2.9'
@@ -79,8 +79,8 @@ class ModuleDocFragment(object):
79
79
  show_task_path_on_failure:
80
80
  name: Show file path on failed tasks
81
81
  description:
82
- When a task fails, display the path to the file containing the failed task and the line number.
83
- This information is displayed automatically for every task when running with C(-vv) or greater verbosity.
82
+ - When a task fails, display the path to the file containing the failed task and the line number.
83
+ This information is displayed automatically for every task when running with C(-vv) or greater verbosity.
84
84
  type: bool
85
85
  default: no
86
86
  env:
@@ -16,7 +16,7 @@ options:
16
16
  mode:
17
17
  description:
18
18
  - The permissions the resulting filesystem object should have.
19
- - For those used to I(/usr/bin/chmod) remember that modes are actually octal numbers.
19
+ - For those used to C(/usr/bin/chmod) remember that modes are actually octal numbers.
20
20
  You must give Ansible enough information to parse them correctly.
21
21
  For consistent results, quote octal numbers (for example, V('644') or V('1777')) so Ansible receives
22
22
  a string and can do its own conversion from string into number.
@@ -33,7 +33,7 @@ options:
33
33
  type: raw
34
34
  owner:
35
35
  description:
36
- - Name of the user that should own the filesystem object, as would be fed to I(chown).
36
+ - Name of the user that should own the filesystem object, as would be fed to C(chown).
37
37
  - When left unspecified, it uses the current user unless you are root, in which
38
38
  case it can preserve the previous ownership.
39
39
  - Specifying a numeric username will be assumed to be a user ID and not a username. Avoid numeric usernames to avoid this confusion.
@@ -41,7 +41,7 @@ options:
41
41
  type: str
42
42
  group:
43
43
  description:
44
- - Name of the group that should own the filesystem object, as would be fed to I(chown).
44
+ - Name of the group that should own the filesystem object, as would be fed to C(chown).
45
45
  - When left unspecified, it uses the current group of the current user unless you are root,
46
46
  in which case it can preserve the previous ownership.
47
47
  type: str
@@ -82,8 +82,8 @@ options:
82
82
  attributes:
83
83
  description:
84
84
  - The attributes the resulting filesystem object should have.
85
- - To get supported flags look at the man page for I(chattr) on the target system.
86
- - This string should contain the attributes in the same order as the one displayed by I(lsattr).
85
+ - To get supported flags look at the man page for C(chattr) on the target system.
86
+ - This string should contain the attributes in the same order as the one displayed by C(lsattr).
87
87
  - The C(=) operator is assumed as default, otherwise C(+) or C(-) operators need to be included in the string.
88
88
  type: str
89
89
  aliases: [ attr ]
@@ -35,7 +35,7 @@ options:
35
35
  key: cache_plugin
36
36
  cache_timeout:
37
37
  description:
38
- - Cache duration in seconds
38
+ - Cache duration in seconds.
39
39
  default: 3600
40
40
  type: int
41
41
  env:
@@ -60,7 +60,7 @@ options:
60
60
  key: cache_connection
61
61
  cache_prefix:
62
62
  description:
63
- - Prefix to use for cache plugin files/tables
63
+ - Prefix to use for cache plugin files/tables.
64
64
  default: ansible_inventory_
65
65
  env:
66
66
  - name: ANSIBLE_CACHE_PLUGIN_PREFIX
@@ -29,15 +29,15 @@ class ModuleDocFragment(object):
29
29
  pretty_results:
30
30
  name: Configure output for readability
31
31
  description:
32
- - Configure the result format to be more readable
33
- - When O(result_format) is set to V(yaml) this option defaults to V(True), and defaults
34
- to V(False) when configured to V(json).
35
- - Setting this option to V(True) will force V(json) and V(yaml) results to always be pretty
32
+ - Configure the result format to be more readable.
33
+ - When O(result_format) is set to V(yaml) this option defaults to V(true), and defaults
34
+ to V(false) when configured to V(json).
35
+ - Setting this option to V(true) will force V(json) and V(yaml) results to always be pretty
36
36
  printed regardless of verbosity.
37
- - When set to V(True) and used with the V(yaml) result format, this option will
37
+ - When set to V(true) and used with the V(yaml) result format, this option will
38
38
  modify module responses in an attempt to produce a more human friendly output at the expense
39
39
  of correctness, and should not be relied upon to aid in writing variable manipulations
40
- or conditionals. For correctness, set this option to V(False) or set O(result_format) to V(json).
40
+ or conditionals. For correctness, set this option to V(false) or set O(result_format) to V(json).
41
41
  type: bool
42
42
  default: null
43
43
  env:
@@ -29,7 +29,7 @@ skipped:
29
29
  type: bool
30
30
  sample: false
31
31
  results:
32
- description: List of module results,
32
+ description: List of module results.
33
33
  returned: when using a loop.
34
34
  type: list
35
35
  sample: [{changed: True, msg: 'first item changed'}, {changed: False, msg: 'second item ok'}]
@@ -34,7 +34,7 @@ options:
34
34
  system_tmpdirs:
35
35
  description:
36
36
  - "List of valid system temporary directories on the managed machine for Ansible to validate
37
- O(remote_tmp) against, when specific permissions are needed. These must be world
37
+ O(remote_tmp) against, when specific permissions are needed. These must be world
38
38
  readable, writable, and executable. This list should only contain directories which the
39
39
  system administrator has pre-created with the proper ownership and permissions otherwise
40
40
  security issues can arise."
@@ -51,7 +51,7 @@ options:
51
51
  - name: ansible_system_tmpdirs
52
52
  async_dir:
53
53
  description:
54
- - Directory in which ansible will keep async job information
54
+ - Directory in which ansible will keep async job information.
55
55
  default: '~/.ansible_async'
56
56
  env: [{name: ANSIBLE_ASYNC_DIR}]
57
57
  ini:
@@ -59,14 +59,6 @@ options:
59
59
  key: async_dir
60
60
  vars:
61
61
  - name: ansible_async_dir
62
- environment:
63
- type: list
64
- elements: dictionary
65
- default: [{}]
66
- description:
67
- - List of dictionaries of environment variables and their values to use when executing commands.
68
- keyword:
69
- - name: environment
70
62
  admin_users:
71
63
  type: list
72
64
  elements: string
@@ -38,13 +38,4 @@ options:
38
38
  type: bool
39
39
  default: 'no'
40
40
  choices: ['no', False]
41
- environment:
42
- description:
43
- - List of dictionaries of environment variables and their values to use when
44
- executing commands.
45
- keyword:
46
- - name: environment
47
- type: list
48
- elements: dictionary
49
- default: [{}]
50
41
  """
@@ -38,7 +38,7 @@ options:
38
38
  url_username:
39
39
  description:
40
40
  - The username for use in HTTP basic authentication.
41
- - This parameter can be used without O(url_password) for sites that allow empty passwords
41
+ - This parameter can be used without O(url_password) for sites that allow empty passwords.
42
42
  type: str
43
43
  url_password:
44
44
  description:
@@ -66,7 +66,7 @@ options:
66
66
  authentication.
67
67
  - Requires the Python library L(gssapi,https://github.com/pythongssapi/python-gssapi) to be installed.
68
68
  - Credentials for GSSAPI can be specified with O(url_username)/O(url_password) or with the GSSAPI env var
69
- C(KRB5CCNAME) that specified a custom Kerberos credential cache.
69
+ E(KRB5CCNAME) that specified a custom Kerberos credential cache.
70
70
  - NTLM authentication is B(not) supported even if the GSSAPI mech for NTLM has been installed.
71
71
  type: bool
72
72
  default: no
@@ -47,7 +47,7 @@ options:
47
47
  description:
48
48
  - Specify how many times the module will redirect a connection to an
49
49
  alternative URI before the connection fails.
50
- - If set to V(0) or O(follow_redirects) is set to V(none), or V(safe) when
50
+ - If set to V(0) or O(follow_redirects) is set to V(null), or V(safe) when
51
51
  not doing a C(GET) or C(HEAD) it prevents all redirection.
52
52
  default: 50
53
53
  type: int
@@ -67,8 +67,8 @@ options:
67
67
  type: bool
68
68
  client_cert:
69
69
  description:
70
- - The path to the client certificate (.pfx) that is used for X509
71
- authentication. This path can either be the path to the C(pfx) on the
70
+ - The path to the client certificate C(.pfx) that is used for X509
71
+ authentication. This path can either be the path to the C(.pfx) on the
72
72
  filesystem or the PowerShell certificate path
73
73
  C(Cert:\CurrentUser\My\<thumbprint>).
74
74
  - The WinRM connection must be authenticated with C(CredSSP) or C(become)
@@ -119,8 +119,7 @@ options:
119
119
  proxy_url:
120
120
  description:
121
121
  - An explicit proxy to use for the request.
122
- - By default, the request will use the IE defined proxy unless O(use_proxy)
123
- is set to V(no).
122
+ - By default, the request will use the IE defined proxy unless O(use_proxy=no).
124
123
  type: str
125
124
  proxy_username:
126
125
  description:
@@ -12,7 +12,7 @@ options:
12
12
  validate:
13
13
  description:
14
14
  - The validation command to run before copying the updated file into the final destination.
15
- - A temporary file path is used to validate, passed in through '%s' which must be present as in the examples below.
15
+ - A temporary file path is used to validate, passed in through C(%s) which must be present as in the examples below.
16
16
  - Also, the command is passed securely so shell features such as expansion and pipes will not work.
17
17
  - For an example on how to handle more complex validation than what this
18
18
  option provides, see R(handling complex validation,complex_configuration_validation).
@@ -76,6 +76,8 @@ def to_json(a, *args, **kw):
76
76
 
77
77
  def to_nice_json(a, indent=4, sort_keys=True, *args, **kw):
78
78
  '''Make verbose, human-readable JSON'''
79
+ # TODO separators can be potentially exposed to the user as well
80
+ kw.pop('separators', None)
79
81
  return to_json(a, indent=indent, sort_keys=sort_keys, separators=(',', ': '), *args, **kw)
80
82
 
81
83
 
@@ -27,6 +27,15 @@ EXAMPLES: |
27
27
 
28
28
  # this is an error, wants bits, got bytes
29
29
  ERROR: '{{ "1.15 GB" | human_to_bytes(isbits=true) }}'
30
+
31
+ # size => 2684354560
32
+ size: '{{ "2.5 gigabyte" | human_to_bytes }}'
33
+
34
+ # size => 1234803098
35
+ size: '{{ "1 Gigabyte" | human_to_bytes }}'
36
+
37
+ # this is an error, because gigggabyte is not a valid unit
38
+ size: '{{ "1 gigggabyte" | human_to_bytes }}'
30
39
 
31
40
  RETURN:
32
41
  _value:
@@ -17,7 +17,7 @@ DOCUMENTATION:
17
17
  description: Hashing algorithm to use.
18
18
  type: string
19
19
  default: sha512
20
- choices: [ md5, blowfish, sha256, sha512 ]
20
+ choices: [ md5, blowfish, sha256, sha512, bcrypt ]
21
21
  salt:
22
22
  description: Secret string used for the hashing. If none is provided a random one can be generated. Use only numbers and letters (characters matching V([./0-9A-Za-z]+)).
23
23
  type: string
@@ -3,7 +3,7 @@ DOCUMENTATION:
3
3
  version_added: "2.4"
4
4
  short_description: date formating
5
5
  description:
6
- - Using Python's C(strftime) function, take a data formating string and a date/time to create a formated date.
6
+ - Using Python's C(strftime) function, take a data formating string and a date/time to create a formatted date.
7
7
  notes:
8
8
  - This is a passthrough to Python's C(stftime), for a complete set of formatting options go to https://strftime.org/.
9
9
  positional: _input, second, utc
@@ -40,12 +40,16 @@ DOCUMENTATION:
40
40
  default: False
41
41
  type: bool
42
42
  sort_keys:
43
- description: Affects sorting of dictionary keys.
43
+ description: Affects sorting of dictionary keys. Passed to an underlying C(json.dumps) call.
44
44
  default: True
45
- type: bool
45
+ type: bool
46
+ indent:
47
+ description: Specifies an indentation level. Passed to an underlying C(json.dumps) call.
48
+ default: 4
49
+ type: int
46
50
  notes:
47
51
  - Both O(vault_to_text) and O(preprocess_unsafe) defaulted to V(False) between Ansible 2.9 and 2.12.
48
- - 'These parameters to C(json.dumps) will be ignored, they are overridden for internal use: I(cls), I(default), I(indent), I(separators), I(sort_keys).'
52
+ - 'These parameters to C(json.dumps) will be ignored, they are overridden for internal use: I(cls), I(default), I(separators).'
49
53
 
50
54
  EXAMPLES: |
51
55
  # dump variable in a template to create a nicely formatted JSON document
@@ -3,7 +3,7 @@ DOCUMENTATION:
3
3
  version_added: "2.9"
4
4
  short_description: namespaced UUID generator
5
5
  description:
6
- - Use to generate namespeced Universal Unique ID.
6
+ - Use to generate namespaced Universal Unique ID.
7
7
  positional: _input, namespace
8
8
  options:
9
9
  _input: