ansible-core 2.15.4rc1__py3-none-any.whl → 2.16.0b2__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 (427) hide show
  1. ansible/cli/__init__.py +3 -3
  2. ansible/cli/adhoc.py +1 -1
  3. ansible/cli/arguments/option_helpers.py +15 -5
  4. ansible/cli/config.py +2 -2
  5. ansible/cli/console.py +21 -17
  6. ansible/cli/doc.py +8 -9
  7. ansible/cli/galaxy.py +60 -27
  8. ansible/cli/inventory.py +1 -1
  9. ansible/cli/playbook.py +1 -1
  10. ansible/cli/pull.py +2 -2
  11. ansible/cli/scripts/ansible_connection_cli_stub.py +1 -1
  12. ansible/cli/vault.py +11 -6
  13. ansible/collections/__init__.py +0 -29
  14. ansible/collections/list.py +23 -44
  15. ansible/config/ansible_builtin_runtime.yml +8 -4
  16. ansible/config/base.yml +34 -22
  17. ansible/config/manager.py +1 -1
  18. ansible/constants.py +3 -5
  19. ansible/errors/__init__.py +1 -1
  20. ansible/executor/interpreter_discovery.py +1 -1
  21. ansible/executor/module_common.py +39 -32
  22. ansible/executor/play_iterator.py +0 -15
  23. ansible/executor/playbook_executor.py +3 -3
  24. ansible/executor/powershell/module_manifest.py +1 -1
  25. ansible/executor/powershell/module_wrapper.ps1 +4 -1
  26. ansible/executor/process/worker.py +22 -7
  27. ansible/executor/task_executor.py +39 -40
  28. ansible/executor/task_queue_manager.py +8 -11
  29. ansible/galaxy/__init__.py +1 -1
  30. ansible/galaxy/api.py +8 -11
  31. ansible/galaxy/collection/__init__.py +17 -4
  32. ansible/galaxy/collection/concrete_artifact_manager.py +7 -2
  33. ansible/galaxy/collection/galaxy_api_proxy.py +1 -1
  34. ansible/galaxy/data/container/README.md +3 -5
  35. ansible/galaxy/dependency_resolution/__init__.py +1 -6
  36. ansible/galaxy/dependency_resolution/dataclasses.py +22 -1
  37. ansible/galaxy/dependency_resolution/providers.py +61 -69
  38. ansible/galaxy/role.py +31 -13
  39. ansible/galaxy/token.py +2 -2
  40. ansible/inventory/group.py +1 -1
  41. ansible/inventory/manager.py +1 -1
  42. ansible/module_utils/ansible_release.py +2 -2
  43. ansible/module_utils/basic.py +11 -41
  44. ansible/module_utils/common/file.py +0 -100
  45. ansible/module_utils/common/json.py +1 -1
  46. ansible/module_utils/common/locale.py +1 -1
  47. ansible/module_utils/common/text/converters.py +2 -2
  48. ansible/module_utils/common/validation.py +1 -1
  49. ansible/module_utils/compat/_selectors2.py +4 -4
  50. ansible/module_utils/compat/datetime.py +40 -0
  51. ansible/module_utils/compat/selinux.py +1 -1
  52. ansible/module_utils/compat/typing.py +1 -1
  53. ansible/module_utils/connection.py +1 -1
  54. ansible/module_utils/facts/hardware/linux.py +2 -2
  55. ansible/module_utils/facts/hardware/openbsd.py +1 -1
  56. ansible/module_utils/facts/network/linux.py +3 -3
  57. ansible/module_utils/facts/other/facter.py +8 -15
  58. ansible/module_utils/facts/sysctl.py +1 -1
  59. ansible/module_utils/facts/system/date_time.py +2 -2
  60. ansible/module_utils/facts/system/distribution.py +1 -1
  61. ansible/module_utils/facts/system/local.py +6 -2
  62. ansible/module_utils/facts/system/pkg_mgr.py +6 -1
  63. ansible/module_utils/facts/system/service_mgr.py +4 -2
  64. ansible/module_utils/parsing/convert_bool.py +1 -1
  65. ansible/module_utils/service.py +9 -6
  66. ansible/module_utils/urls.py +40 -22
  67. ansible/modules/add_host.py +2 -2
  68. ansible/modules/apt.py +48 -31
  69. ansible/modules/apt_key.py +4 -4
  70. ansible/modules/apt_repository.py +5 -5
  71. ansible/modules/assemble.py +7 -7
  72. ansible/modules/assert.py +1 -1
  73. ansible/modules/async_status.py +11 -7
  74. ansible/modules/async_wrapper.py +1 -1
  75. ansible/modules/blockinfile.py +60 -17
  76. ansible/modules/command.py +37 -15
  77. ansible/modules/copy.py +35 -30
  78. ansible/modules/cron.py +14 -14
  79. ansible/modules/deb822_repository.py +4 -3
  80. ansible/modules/debconf.py +35 -14
  81. ansible/modules/debug.py +1 -1
  82. ansible/modules/dnf.py +29 -27
  83. ansible/modules/dnf5.py +22 -22
  84. ansible/modules/dpkg_selections.py +9 -2
  85. ansible/modules/expect.py +4 -4
  86. ansible/modules/fetch.py +7 -7
  87. ansible/modules/file.py +30 -30
  88. ansible/modules/find.py +82 -22
  89. ansible/modules/gather_facts.py +6 -2
  90. ansible/modules/get_url.py +29 -29
  91. ansible/modules/getent.py +4 -4
  92. ansible/modules/git.py +27 -27
  93. ansible/modules/group.py +5 -12
  94. ansible/modules/hostname.py +21 -2
  95. ansible/modules/include_role.py +5 -5
  96. ansible/modules/include_tasks.py +2 -2
  97. ansible/modules/include_vars.py +5 -5
  98. ansible/modules/iptables.py +70 -65
  99. ansible/modules/known_hosts.py +7 -7
  100. ansible/modules/lineinfile.py +33 -33
  101. ansible/modules/meta.py +13 -13
  102. ansible/modules/package.py +8 -8
  103. ansible/modules/package_facts.py +3 -3
  104. ansible/modules/pause.py +2 -2
  105. ansible/modules/ping.py +5 -5
  106. ansible/modules/pip.py +80 -46
  107. ansible/modules/reboot.py +8 -4
  108. ansible/modules/replace.py +20 -15
  109. ansible/modules/rpm_key.py +2 -2
  110. ansible/modules/script.py +16 -10
  111. ansible/modules/service.py +26 -98
  112. ansible/modules/service_facts.py +36 -12
  113. ansible/modules/set_fact.py +2 -2
  114. ansible/modules/set_stats.py +2 -2
  115. ansible/modules/setup.py +18 -18
  116. ansible/modules/shell.py +3 -3
  117. ansible/modules/stat.py +9 -30
  118. ansible/modules/subversion.py +9 -9
  119. ansible/modules/systemd.py +20 -19
  120. ansible/modules/systemd_service.py +20 -19
  121. ansible/modules/sysvinit.py +26 -21
  122. ansible/modules/tempfile.py +5 -4
  123. ansible/modules/template.py +60 -6
  124. ansible/modules/unarchive.py +21 -18
  125. ansible/modules/uri.py +39 -39
  126. ansible/modules/user.py +81 -53
  127. ansible/modules/wait_for.py +22 -21
  128. ansible/modules/wait_for_connection.py +4 -4
  129. ansible/modules/yum.py +38 -38
  130. ansible/modules/yum_repository.py +58 -80
  131. ansible/parsing/dataloader.py +27 -27
  132. ansible/parsing/mod_args.py +1 -1
  133. ansible/parsing/plugin_docs.py +3 -3
  134. ansible/parsing/splitter.py +14 -16
  135. ansible/parsing/utils/yaml.py +1 -1
  136. ansible/parsing/vault/__init__.py +8 -6
  137. ansible/parsing/yaml/constructor.py +1 -1
  138. ansible/parsing/yaml/objects.py +1 -1
  139. ansible/playbook/__init__.py +1 -1
  140. ansible/playbook/base.py +2 -2
  141. ansible/playbook/block.py +0 -1
  142. ansible/playbook/conditional.py +40 -114
  143. ansible/playbook/helpers.py +5 -28
  144. ansible/playbook/included_file.py +8 -7
  145. ansible/playbook/play.py +1 -1
  146. ansible/playbook/play_context.py +2 -2
  147. ansible/playbook/playbook_include.py +2 -2
  148. ansible/playbook/role/__init__.py +1 -1
  149. ansible/playbook/role/include.py +1 -1
  150. ansible/playbook/role/metadata.py +1 -1
  151. ansible/playbook/role_include.py +1 -1
  152. ansible/playbook/task.py +2 -2
  153. ansible/playbook/task_include.py +1 -24
  154. ansible/plugins/__init__.py +13 -5
  155. ansible/plugins/action/__init__.py +17 -43
  156. ansible/plugins/action/add_host.py +2 -3
  157. ansible/plugins/action/assemble.py +1 -1
  158. ansible/plugins/action/assert.py +2 -1
  159. ansible/plugins/action/copy.py +2 -2
  160. ansible/plugins/action/debug.py +2 -1
  161. ansible/plugins/action/fail.py +1 -0
  162. ansible/plugins/action/fetch.py +3 -1
  163. ansible/plugins/action/gather_facts.py +37 -13
  164. ansible/plugins/action/group_by.py +1 -0
  165. ansible/plugins/action/include_vars.py +3 -2
  166. ansible/plugins/action/normal.py +3 -3
  167. ansible/plugins/action/pause.py +1 -1
  168. ansible/plugins/action/reboot.py +21 -16
  169. ansible/plugins/action/script.py +23 -8
  170. ansible/plugins/action/set_fact.py +1 -0
  171. ansible/plugins/action/set_stats.py +1 -0
  172. ansible/plugins/action/shell.py +6 -0
  173. ansible/plugins/action/template.py +1 -1
  174. ansible/plugins/action/unarchive.py +1 -1
  175. ansible/plugins/action/uri.py +1 -1
  176. ansible/plugins/action/validate_argument_spec.py +1 -0
  177. ansible/plugins/action/wait_for_connection.py +4 -4
  178. ansible/plugins/become/__init__.py +1 -1
  179. ansible/plugins/become/su.py +1 -1
  180. ansible/plugins/cache/__init__.py +1 -1
  181. ansible/plugins/callback/junit.py +1 -1
  182. ansible/plugins/callback/oneline.py +1 -1
  183. ansible/plugins/callback/tree.py +1 -1
  184. ansible/plugins/cliconf/__init__.py +2 -2
  185. ansible/plugins/connection/__init__.py +65 -37
  186. ansible/plugins/connection/local.py +9 -8
  187. ansible/plugins/connection/paramiko_ssh.py +34 -28
  188. ansible/plugins/connection/psrp.py +56 -43
  189. ansible/plugins/connection/ssh.py +67 -43
  190. ansible/plugins/connection/winrm.py +77 -30
  191. ansible/plugins/doc_fragments/constructed.py +4 -4
  192. ansible/plugins/doc_fragments/files.py +12 -12
  193. ansible/plugins/doc_fragments/inventory_cache.py +0 -6
  194. ansible/plugins/doc_fragments/result_format_callback.py +5 -5
  195. ansible/plugins/doc_fragments/shell_common.py +2 -2
  196. ansible/plugins/doc_fragments/shell_windows.py +1 -1
  197. ansible/plugins/doc_fragments/template_common.py +6 -6
  198. ansible/plugins/doc_fragments/url.py +10 -10
  199. ansible/plugins/doc_fragments/url_windows.py +15 -15
  200. ansible/plugins/doc_fragments/vars_plugin_staging.py +4 -4
  201. ansible/plugins/filter/b64decode.yml +1 -1
  202. ansible/plugins/filter/b64encode.yml +2 -2
  203. ansible/plugins/filter/bool.yml +5 -5
  204. ansible/plugins/filter/combine.yml +1 -1
  205. ansible/plugins/filter/commonpath.yml +2 -1
  206. ansible/plugins/filter/core.py +6 -8
  207. ansible/plugins/filter/dict2items.yml +11 -1
  208. ansible/plugins/filter/difference.yml +1 -0
  209. ansible/plugins/filter/encryption.py +1 -1
  210. ansible/plugins/filter/extract.yml +1 -1
  211. ansible/plugins/filter/flatten.yml +1 -1
  212. ansible/plugins/filter/from_yaml.yml +1 -1
  213. ansible/plugins/filter/from_yaml_all.yml +2 -2
  214. ansible/plugins/filter/hash.yml +1 -1
  215. ansible/plugins/filter/human_readable.yml +1 -1
  216. ansible/plugins/filter/human_to_bytes.yml +2 -2
  217. ansible/plugins/filter/intersect.yml +1 -0
  218. ansible/plugins/filter/mandatory.yml +7 -0
  219. ansible/plugins/filter/mathstuff.py +15 -17
  220. ansible/plugins/filter/normpath.yml +1 -1
  221. ansible/plugins/filter/path_join.yml +8 -1
  222. ansible/plugins/filter/realpath.yml +3 -2
  223. ansible/plugins/filter/regex_findall.yml +8 -2
  224. ansible/plugins/filter/regex_replace.yml +9 -3
  225. ansible/plugins/filter/regex_search.yml +8 -2
  226. ansible/plugins/filter/relpath.yml +2 -2
  227. ansible/plugins/filter/root.yml +1 -1
  228. ansible/plugins/filter/splitext.yml +1 -1
  229. ansible/plugins/filter/subelements.yml +2 -2
  230. ansible/plugins/filter/symmetric_difference.yml +1 -0
  231. ansible/plugins/filter/ternary.yml +5 -5
  232. ansible/plugins/filter/to_json.yml +7 -7
  233. ansible/plugins/filter/to_nice_json.yml +5 -5
  234. ansible/plugins/filter/to_yaml.yml +2 -2
  235. ansible/plugins/filter/type_debug.yml +1 -1
  236. ansible/plugins/filter/union.yml +1 -0
  237. ansible/plugins/filter/unvault.yml +2 -2
  238. ansible/plugins/filter/urldecode.yml +13 -32
  239. ansible/plugins/filter/urlsplit.py +1 -1
  240. ansible/plugins/filter/vault.yml +1 -1
  241. ansible/plugins/filter/zip.yml +1 -1
  242. ansible/plugins/filter/zip_longest.yml +1 -1
  243. ansible/plugins/inventory/__init__.py +1 -1
  244. ansible/plugins/inventory/advanced_host_list.py +1 -1
  245. ansible/plugins/inventory/constructed.py +2 -2
  246. ansible/plugins/inventory/host_list.py +1 -1
  247. ansible/plugins/inventory/ini.py +6 -3
  248. ansible/plugins/inventory/script.py +8 -2
  249. ansible/plugins/inventory/toml.py +1 -1
  250. ansible/plugins/inventory/yaml.py +1 -1
  251. ansible/plugins/list.py +21 -17
  252. ansible/plugins/loader.py +66 -88
  253. ansible/plugins/lookup/__init__.py +1 -1
  254. ansible/plugins/lookup/config.py +16 -6
  255. ansible/plugins/lookup/csvfile.py +7 -4
  256. ansible/plugins/lookup/env.py +1 -1
  257. ansible/plugins/lookup/file.py +5 -2
  258. ansible/plugins/lookup/fileglob.py +5 -2
  259. ansible/plugins/lookup/first_found.py +20 -14
  260. ansible/plugins/lookup/ini.py +6 -3
  261. ansible/plugins/lookup/lines.py +2 -1
  262. ansible/plugins/lookup/password.py +7 -7
  263. ansible/plugins/lookup/pipe.py +1 -0
  264. ansible/plugins/lookup/random_choice.py +2 -2
  265. ansible/plugins/lookup/sequence.py +1 -1
  266. ansible/plugins/lookup/subelements.py +2 -2
  267. ansible/plugins/lookup/template.py +4 -1
  268. ansible/plugins/lookup/unvault.py +4 -1
  269. ansible/plugins/lookup/url.py +6 -6
  270. ansible/plugins/lookup/varnames.py +1 -1
  271. ansible/plugins/netconf/__init__.py +3 -3
  272. ansible/plugins/shell/__init__.py +1 -1
  273. ansible/plugins/shell/cmd.py +7 -7
  274. ansible/plugins/shell/powershell.py +1 -1
  275. ansible/plugins/strategy/__init__.py +8 -10
  276. ansible/plugins/strategy/free.py +1 -1
  277. ansible/plugins/strategy/linear.py +3 -3
  278. ansible/plugins/terminal/__init__.py +2 -2
  279. ansible/plugins/test/abs.yml +1 -1
  280. ansible/plugins/test/all.yml +1 -1
  281. ansible/plugins/test/any.yml +1 -1
  282. ansible/plugins/test/change.yml +2 -2
  283. ansible/plugins/test/changed.yml +2 -2
  284. ansible/plugins/test/contains.yml +1 -1
  285. ansible/plugins/test/core.py +1 -1
  286. ansible/plugins/test/directory.yml +1 -1
  287. ansible/plugins/test/exists.yml +3 -2
  288. ansible/plugins/test/failed.yml +2 -2
  289. ansible/plugins/test/failure.yml +2 -2
  290. ansible/plugins/test/falsy.yml +2 -2
  291. ansible/plugins/test/file.yml +1 -1
  292. ansible/plugins/test/finished.yml +2 -2
  293. ansible/plugins/test/is_abs.yml +1 -1
  294. ansible/plugins/test/is_dir.yml +1 -1
  295. ansible/plugins/test/is_file.yml +1 -1
  296. ansible/plugins/test/is_link.yml +1 -1
  297. ansible/plugins/test/is_mount.yml +1 -1
  298. ansible/plugins/test/is_same_file.yml +1 -1
  299. ansible/plugins/test/isnan.yml +1 -1
  300. ansible/plugins/test/issubset.yml +1 -2
  301. ansible/plugins/test/issuperset.yml +1 -2
  302. ansible/plugins/test/link.yml +1 -1
  303. ansible/plugins/test/link_exists.yml +1 -1
  304. ansible/plugins/test/match.yml +2 -2
  305. ansible/plugins/test/mount.yml +1 -1
  306. ansible/plugins/test/nan.yml +1 -1
  307. ansible/plugins/test/reachable.yml +2 -2
  308. ansible/plugins/test/regex.yml +1 -1
  309. ansible/plugins/test/same_file.yml +1 -1
  310. ansible/plugins/test/search.yml +2 -2
  311. ansible/plugins/test/skip.yml +3 -3
  312. ansible/plugins/test/skipped.yml +3 -3
  313. ansible/plugins/test/started.yml +2 -2
  314. ansible/plugins/test/subset.yml +1 -2
  315. ansible/plugins/test/succeeded.yml +2 -2
  316. ansible/plugins/test/success.yml +2 -2
  317. ansible/plugins/test/successful.yml +2 -2
  318. ansible/plugins/test/superset.yml +1 -2
  319. ansible/plugins/test/truthy.yml +3 -3
  320. ansible/plugins/test/unreachable.yml +2 -2
  321. ansible/plugins/test/uri.yml +1 -1
  322. ansible/plugins/test/url.yml +1 -1
  323. ansible/plugins/test/urn.yml +1 -1
  324. ansible/plugins/test/vault_encrypted.yml +1 -1
  325. ansible/plugins/test/version.yml +7 -7
  326. ansible/plugins/test/version_compare.yml +7 -7
  327. ansible/plugins/vars/host_group_vars.py +1 -1
  328. ansible/release.py +2 -2
  329. ansible/template/__init__.py +24 -26
  330. ansible/template/native_helpers.py +1 -1
  331. ansible/template/vars.py +1 -1
  332. ansible/utils/_junit_xml.py +1 -1
  333. ansible/utils/cmd_functions.py +1 -1
  334. ansible/utils/collection_loader/_collection_finder.py +12 -1
  335. ansible/utils/display.py +113 -62
  336. ansible/utils/encrypt.py +11 -14
  337. ansible/utils/hashing.py +1 -1
  338. ansible/utils/jsonrpc.py +1 -1
  339. ansible/utils/path.py +1 -1
  340. ansible/utils/plugin_docs.py +1 -1
  341. ansible/utils/py3compat.py +1 -1
  342. ansible/utils/shlex.py +2 -10
  343. ansible/utils/ssh_functions.py +5 -4
  344. ansible/utils/unicode.py +1 -1
  345. ansible/utils/unsafe_proxy.py +1 -1
  346. ansible/utils/vars.py +4 -29
  347. ansible/vars/hostvars.py +1 -2
  348. ansible/vars/manager.py +13 -9
  349. ansible/vars/plugins.py +2 -2
  350. {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/COPYING +4 -5
  351. {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/METADATA +2 -4
  352. {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/RECORD +424 -425
  353. ansible_test/_data/completion/docker.txt +9 -9
  354. ansible_test/_data/completion/remote.txt +4 -7
  355. ansible_test/_data/completion/windows.txt +0 -2
  356. ansible_test/_data/requirements/ansible-test.txt +2 -1
  357. ansible_test/_data/requirements/ansible.txt +0 -3
  358. ansible_test/_data/requirements/constraints.txt +0 -2
  359. ansible_test/_data/requirements/sanity.ansible-doc.txt +3 -5
  360. ansible_test/_data/requirements/sanity.changelog.in +1 -2
  361. ansible_test/_data/requirements/sanity.changelog.txt +4 -6
  362. ansible_test/_data/requirements/sanity.import.plugin.txt +2 -4
  363. ansible_test/_data/requirements/sanity.import.txt +1 -3
  364. ansible_test/_data/requirements/sanity.integration-aliases.txt +1 -3
  365. ansible_test/_data/requirements/sanity.mypy.txt +12 -12
  366. ansible_test/_data/requirements/sanity.pep8.txt +1 -1
  367. ansible_test/_data/requirements/sanity.pylint.txt +6 -12
  368. ansible_test/_data/requirements/sanity.runtime-metadata.txt +1 -3
  369. ansible_test/_data/requirements/sanity.validate-modules.in +1 -1
  370. ansible_test/_data/requirements/sanity.validate-modules.txt +3 -5
  371. ansible_test/_data/requirements/sanity.yamllint.txt +3 -5
  372. ansible_test/_data/requirements/units.txt +0 -1
  373. ansible_test/_internal/ci/azp.py +4 -4
  374. ansible_test/_internal/cli/environments.py +0 -13
  375. ansible_test/_internal/commands/coverage/analyze/targets/__init__.py +4 -4
  376. ansible_test/_internal/commands/coverage/combine.py +1 -1
  377. ansible_test/_internal/commands/integration/cloud/acme.py +6 -8
  378. ansible_test/_internal/commands/integration/cloud/cs.py +4 -9
  379. ansible_test/_internal/commands/integration/cloud/galaxy.py +103 -96
  380. ansible_test/_internal/commands/integration/cloud/httptester.py +0 -3
  381. ansible_test/_internal/commands/integration/cloud/nios.py +7 -9
  382. ansible_test/_internal/commands/integration/cloud/openshift.py +2 -7
  383. ansible_test/_internal/commands/integration/cloud/vcenter.py +11 -95
  384. ansible_test/_internal/commands/sanity/__init__.py +10 -0
  385. ansible_test/_internal/commands/sanity/import.py +8 -2
  386. ansible_test/_internal/commands/sanity/pylint.py +27 -1
  387. ansible_test/_internal/commands/units/__init__.py +2 -1
  388. ansible_test/_internal/config.py +0 -7
  389. ansible_test/_internal/containers.py +11 -56
  390. ansible_test/_internal/core_ci.py +0 -7
  391. ansible_test/_internal/coverage_util.py +8 -3
  392. ansible_test/_internal/delegation.py +0 -1
  393. ansible_test/_internal/diff.py +1 -1
  394. ansible_test/_internal/docker_util.py +9 -2
  395. ansible_test/_internal/host_profiles.py +6 -6
  396. ansible_test/_internal/http.py +1 -1
  397. ansible_test/_internal/junit_xml.py +1 -1
  398. ansible_test/_internal/pypi_proxy.py +1 -1
  399. ansible_test/_internal/python_requirements.py +3 -8
  400. ansible_test/_internal/util.py +1 -6
  401. ansible_test/_util/controller/sanity/code-smell/no-get-exception.json +4 -0
  402. ansible_test/_util/controller/sanity/code-smell/replace-urlopen.json +4 -0
  403. ansible_test/_util/controller/sanity/code-smell/use-compat-six.json +4 -0
  404. ansible_test/_util/controller/sanity/mypy/ansible-core.ini +3 -0
  405. ansible_test/_util/controller/sanity/pylint/config/ansible-test-target.cfg +2 -0
  406. ansible_test/_util/controller/sanity/pylint/config/ansible-test.cfg +0 -1
  407. ansible_test/_util/controller/sanity/pylint/config/collection.cfg +1 -0
  408. ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py +172 -10
  409. ansible_test/_util/controller/sanity/pylint/plugins/string_format.py +13 -2
  410. ansible_test/_util/controller/sanity/pylint/plugins/unwanted.py +7 -1
  411. ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py +6 -6
  412. ansible_test/_util/controller/sanity/validate-modules/validate_modules/module_args.py +1 -1
  413. ansible_test/_util/controller/sanity/validate-modules/validate_modules/utils.py +1 -1
  414. ansible_test/_util/controller/sanity/yamllint/yamllinter.py +3 -3
  415. ansible_test/_util/controller/tools/collection_detail.py +2 -2
  416. ansible_test/_util/target/common/constants.py +2 -2
  417. ansible_test/_util/target/pytest/plugins/ansible_forked.py +103 -0
  418. ansible_test/_util/target/sanity/import/importer.py +0 -8
  419. ansible_test/_util/target/setup/bootstrap.sh +36 -16
  420. ansible_test/_util/target/setup/quiet_pip.py +0 -4
  421. ansible/modules/_include.py +0 -80
  422. ansible_test/_internal/commands/integration/cloud/foreman.py +0 -102
  423. ansible_test/_util/target/setup/ConfigureRemotingForAnsible.ps1 +0 -435
  424. {ansible_core-2.15.4rc1.data → ansible_core-2.16.0b2.data}/scripts/ansible-test +0 -0
  425. {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/WHEEL +0 -0
  426. {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/entry_points.txt +0 -0
  427. {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/top_level.txt +0 -0
@@ -12,7 +12,7 @@ class ModuleDocFragment(object):
12
12
  options:
13
13
  strict:
14
14
  description:
15
- - If C(yes) make invalid entries a fatal error, otherwise skip and continue.
15
+ - If V(yes) make invalid entries a fatal error, otherwise skip and continue.
16
16
  - Since it is possible to use facts in the expressions they might not always be available
17
17
  and we ignore those errors by default.
18
18
  type: bool
@@ -49,13 +49,13 @@ options:
49
49
  default_value:
50
50
  description:
51
51
  - The default value when the host variable's value is an empty string.
52
- - This option is mutually exclusive with C(trailing_separator).
52
+ - This option is mutually exclusive with O(keyed_groups[].trailing_separator).
53
53
  type: str
54
54
  version_added: '2.12'
55
55
  trailing_separator:
56
56
  description:
57
- - Set this option to I(False) to omit the C(separator) after the host variable when the value is an empty string.
58
- - This option is mutually exclusive with C(default_value).
57
+ - Set this option to V(False) to omit the O(keyed_groups[].separator) after the host variable when the value is an empty string.
58
+ - This option is mutually exclusive with O(keyed_groups[].default_value).
59
59
  type: bool
60
60
  default: True
61
61
  version_added: '2.12'
@@ -19,17 +19,17 @@ options:
19
19
  - The permissions the resulting filesystem object should have.
20
20
  - For those used to I(/usr/bin/chmod) remember that modes are actually octal numbers.
21
21
  You must give Ansible enough information to parse them correctly.
22
- For consistent results, quote octal numbers (for example, C('644') or C('1777')) so Ansible receives
22
+ For consistent results, quote octal numbers (for example, V('644') or V('1777')) so Ansible receives
23
23
  a string and can do its own conversion from string into number.
24
- Adding a leading zero (for example, C(0755)) works sometimes, but can fail in loops and some other circumstances.
24
+ Adding a leading zero (for example, V(0755)) works sometimes, but can fail in loops and some other circumstances.
25
25
  - Giving Ansible a number without following either of these rules will end up with a decimal
26
26
  number which will have unexpected results.
27
- - As of Ansible 1.8, the mode may be specified as a symbolic mode (for example, C(u+rwx) or
28
- C(u=rw,g=r,o=r)).
29
- - If C(mode) is not specified and the destination filesystem object B(does not) exist, the default C(umask) on the system will be used
27
+ - As of Ansible 1.8, the mode may be specified as a symbolic mode (for example, V(u+rwx) or
28
+ V(u=rw,g=r,o=r)).
29
+ - If O(mode) is not specified and the destination filesystem object B(does not) exist, the default C(umask) on the system will be used
30
30
  when setting the mode for the newly created filesystem object.
31
- - If C(mode) is not specified and the destination filesystem object B(does) exist, the mode of the existing filesystem object will be used.
32
- - Specifying C(mode) is the best way to ensure filesystem objects are created with the correct permissions.
31
+ - If O(mode) is not specified and the destination filesystem object B(does) exist, the mode of the existing filesystem object will be used.
32
+ - Specifying O(mode) is the best way to ensure filesystem objects are created with the correct permissions.
33
33
  See CVE-2020-1736 for further details.
34
34
  type: raw
35
35
  owner:
@@ -49,24 +49,24 @@ options:
49
49
  seuser:
50
50
  description:
51
51
  - The user part of the SELinux filesystem object context.
52
- - By default it uses the C(system) policy, where applicable.
53
- - When set to C(_default), it will use the C(user) portion of the policy if available.
52
+ - By default it uses the V(system) policy, where applicable.
53
+ - When set to V(_default), it will use the C(user) portion of the policy if available.
54
54
  type: str
55
55
  serole:
56
56
  description:
57
57
  - The role part of the SELinux filesystem object context.
58
- - When set to C(_default), it will use the C(role) portion of the policy if available.
58
+ - When set to V(_default), it will use the C(role) portion of the policy if available.
59
59
  type: str
60
60
  setype:
61
61
  description:
62
62
  - The type part of the SELinux filesystem object context.
63
- - When set to C(_default), it will use the C(type) portion of the policy if available.
63
+ - When set to V(_default), it will use the C(type) portion of the policy if available.
64
64
  type: str
65
65
  selevel:
66
66
  description:
67
67
  - The level part of the SELinux filesystem object context.
68
68
  - This is the MLS/MCS attribute, sometimes known as the C(range).
69
- - When set to C(_default), it will use the C(level) portion of the policy if available.
69
+ - When set to V(_default), it will use the C(level) portion of the policy if available.
70
70
  type: str
71
71
  unsafe_writes:
72
72
  description:
@@ -67,12 +67,6 @@ options:
67
67
  - name: ANSIBLE_CACHE_PLUGIN_PREFIX
68
68
  - name: ANSIBLE_INVENTORY_CACHE_PLUGIN_PREFIX
69
69
  ini:
70
- - section: default
71
- key: fact_caching_prefix
72
- deprecated:
73
- alternatives: Use the 'defaults' section instead
74
- why: Fixes typing error in INI section name
75
- version: '2.16'
76
70
  - section: defaults
77
71
  key: fact_caching_prefix
78
72
  - section: inventory
@@ -31,14 +31,14 @@ class ModuleDocFragment(object):
31
31
  name: Configure output for readability
32
32
  description:
33
33
  - Configure the result format to be more readable
34
- - When the result format is set to C(yaml) this option defaults to C(True), and defaults
35
- to C(False) when configured to C(json).
36
- - Setting this option to C(True) will force C(json) and C(yaml) results to always be pretty
34
+ - When O(result_format) is set to V(yaml) this option defaults to V(True), and defaults
35
+ to V(False) when configured to V(json).
36
+ - Setting this option to V(True) will force V(json) and V(yaml) results to always be pretty
37
37
  printed regardless of verbosity.
38
- - When set to C(True) and used with the C(yaml) result format, this option will
38
+ - When set to V(True) and used with the V(yaml) result format, this option will
39
39
  modify module responses in an attempt to produce a more human friendly output at the expense
40
40
  of correctness, and should not be relied upon to aid in writing variable manipulations
41
- or conditionals. For correctness, set this option to C(False) or set the result format to C(json).
41
+ or conditionals. For correctness, set this option to V(False) or set O(result_format) to V(json).
42
42
  type: bool
43
43
  default: null
44
44
  env:
@@ -35,11 +35,11 @@ options:
35
35
  system_tmpdirs:
36
36
  description:
37
37
  - "List of valid system temporary directories on the managed machine for Ansible to validate
38
- C(remote_tmp) against, when specific permissions are needed. These must be world
38
+ O(remote_tmp) against, when specific permissions are needed. These must be world
39
39
  readable, writable, and executable. This list should only contain directories which the
40
40
  system administrator has pre-created with the proper ownership and permissions otherwise
41
41
  security issues can arise."
42
- - When C(remote_tmp) is required to be a system temp dir and it does not match any in the list,
42
+ - When O(remote_tmp) is required to be a system temp dir and it does not match any in the list,
43
43
  the first one from the list will be used instead.
44
44
  default: [ /var/tmp, /tmp ]
45
45
  type: list
@@ -35,7 +35,7 @@ options:
35
35
  description:
36
36
  - Controls if we set the locale for modules when executing on the
37
37
  target.
38
- - Windows only supports C(no) as an option.
38
+ - Windows only supports V(no) as an option.
39
39
  type: bool
40
40
  default: 'no'
41
41
  choices: ['no', False]
@@ -29,7 +29,7 @@ options:
29
29
  description:
30
30
  - Path of a Jinja2 formatted template on the Ansible controller.
31
31
  - This can be a relative or an absolute path.
32
- - The file must be encoded with C(utf-8) but I(output_encoding) can be used to control the encoding of the output
32
+ - The file must be encoded with C(utf-8) but O(output_encoding) can be used to control the encoding of the output
33
33
  template.
34
34
  type: path
35
35
  required: yes
@@ -82,14 +82,14 @@ options:
82
82
  trim_blocks:
83
83
  description:
84
84
  - Determine when newlines should be removed from blocks.
85
- - When set to C(yes) the first newline after a block is removed (block, not variable tag!).
85
+ - When set to V(yes) the first newline after a block is removed (block, not variable tag!).
86
86
  type: bool
87
87
  default: yes
88
88
  version_added: '2.4'
89
89
  lstrip_blocks:
90
90
  description:
91
91
  - Determine when leading spaces and tabs should be stripped.
92
- - When set to C(yes) leading spaces and tabs are stripped from the start of a line to a block.
92
+ - When set to V(yes) leading spaces and tabs are stripped from the start of a line to a block.
93
93
  type: bool
94
94
  default: no
95
95
  version_added: '2.6'
@@ -102,7 +102,7 @@ options:
102
102
  default: yes
103
103
  output_encoding:
104
104
  description:
105
- - Overrides the encoding used to write the template file defined by C(dest).
105
+ - Overrides the encoding used to write the template file defined by O(dest).
106
106
  - It defaults to C(utf-8), but any encoding supported by python can be used.
107
107
  - The source template file must always be encoded using C(utf-8), for homogeneity.
108
108
  type: str
@@ -110,10 +110,10 @@ options:
110
110
  version_added: '2.7'
111
111
  notes:
112
112
  - Including a string that uses a date in the template will result in the template being marked 'changed' each time.
113
- - Since Ansible 0.9, templates are loaded with C(trim_blocks=True).
113
+ - Since Ansible 0.9, templates are loaded with O(trim_blocks=True).
114
114
  - >
115
115
  Also, you can override jinja2 settings by adding a special header to template file.
116
- i.e. C(#jinja2:variable_start_string:'[%', variable_end_string:'%]', trim_blocks: False)
116
+ that is C(#jinja2:variable_start_string:'[%', variable_end_string:'%]', trim_blocks: False)
117
117
  which changes the variable interpolation markers to C([% var %]) instead of C({{ var }}).
118
118
  This is the best way to prevent evaluation of things that look like, but should not be Jinja2.
119
119
  - To find Byte Order Marks in files, use C(Format-Hex <file> -Count 16) on Windows, and use C(od -a -t x1 -N 16 <file>)
@@ -17,7 +17,7 @@ options:
17
17
  type: str
18
18
  force:
19
19
  description:
20
- - If C(yes) do not get a cached copy.
20
+ - If V(yes) do not get a cached copy.
21
21
  type: bool
22
22
  default: no
23
23
  http_agent:
@@ -27,48 +27,48 @@ options:
27
27
  default: ansible-httpget
28
28
  use_proxy:
29
29
  description:
30
- - If C(no), it will not use a proxy, even if one is defined in an environment variable on the target hosts.
30
+ - If V(no), it will not use a proxy, even if one is defined in an environment variable on the target hosts.
31
31
  type: bool
32
32
  default: yes
33
33
  validate_certs:
34
34
  description:
35
- - If C(no), SSL certificates will not be validated.
35
+ - If V(no), SSL certificates will not be validated.
36
36
  - This should only be used on personally controlled sites using self-signed certificates.
37
37
  type: bool
38
38
  default: yes
39
39
  url_username:
40
40
  description:
41
41
  - The username for use in HTTP basic authentication.
42
- - This parameter can be used without I(url_password) for sites that allow empty passwords
42
+ - This parameter can be used without O(url_password) for sites that allow empty passwords
43
43
  type: str
44
44
  url_password:
45
45
  description:
46
46
  - The password for use in HTTP basic authentication.
47
- - If the I(url_username) parameter is not specified, the I(url_password) parameter will not be used.
47
+ - If the O(url_username) parameter is not specified, the O(url_password) parameter will not be used.
48
48
  type: str
49
49
  force_basic_auth:
50
50
  description:
51
- - Credentials specified with I(url_username) and I(url_password) should be passed in HTTP Header.
51
+ - Credentials specified with O(url_username) and O(url_password) should be passed in HTTP Header.
52
52
  type: bool
53
53
  default: no
54
54
  client_cert:
55
55
  description:
56
56
  - PEM formatted certificate chain file to be used for SSL client authentication.
57
- - This file can also include the key as well, and if the key is included, C(client_key) is not required.
57
+ - This file can also include the key as well, and if the key is included, O(client_key) is not required.
58
58
  type: path
59
59
  client_key:
60
60
  description:
61
61
  - PEM formatted file that contains your private key to be used for SSL client authentication.
62
- - If C(client_cert) contains both the certificate and key, this option is not required.
62
+ - If O(client_cert) contains both the certificate and key, this option is not required.
63
63
  type: path
64
64
  use_gssapi:
65
65
  description:
66
66
  - Use GSSAPI to perform the authentication, typically this is for Kerberos or Kerberos through Negotiate
67
67
  authentication.
68
68
  - Requires the Python library L(gssapi,https://github.com/pythongssapi/python-gssapi) to be installed.
69
- - Credentials for GSSAPI can be specified with I(url_username)/I(url_password) or with the GSSAPI env var
69
+ - Credentials for GSSAPI can be specified with O(url_username)/O(url_password) or with the GSSAPI env var
70
70
  C(KRB5CCNAME) that specified a custom Kerberos credential cache.
71
- - NTLM authentication is C(not) supported even if the GSSAPI mech for NTLM has been installed.
71
+ - NTLM authentication is B(not) supported even if the GSSAPI mech for NTLM has been installed.
72
72
  type: bool
73
73
  default: no
74
74
  version_added: '2.11'
@@ -19,9 +19,9 @@ options:
19
19
  follow_redirects:
20
20
  description:
21
21
  - Whether or the module should follow redirects.
22
- - C(all) will follow all redirect.
23
- - C(none) will not follow any redirect.
24
- - C(safe) will follow only "safe" redirects, where "safe" means that the
22
+ - V(all) will follow all redirect.
23
+ - V(none) will not follow any redirect.
24
+ - V(safe) will follow only "safe" redirects, where "safe" means that the
25
25
  client is only doing a C(GET) or C(HEAD) on the URI to which it is being
26
26
  redirected.
27
27
  - When following a redirected URL, the C(Authorization) header and any
@@ -48,7 +48,7 @@ options:
48
48
  description:
49
49
  - Specify how many times the module will redirect a connection to an
50
50
  alternative URI before the connection fails.
51
- - If set to C(0) or I(follow_redirects) is set to C(none), or C(safe) when
51
+ - If set to V(0) or O(follow_redirects) is set to V(none), or V(safe) when
52
52
  not doing a C(GET) or C(HEAD) it prevents all redirection.
53
53
  default: 50
54
54
  type: int
@@ -56,12 +56,12 @@ options:
56
56
  description:
57
57
  - Specifies how long the request can be pending before it times out (in
58
58
  seconds).
59
- - Set to C(0) to specify an infinite timeout.
59
+ - Set to V(0) to specify an infinite timeout.
60
60
  default: 30
61
61
  type: int
62
62
  validate_certs:
63
63
  description:
64
- - If C(no), SSL certificates will not be validated.
64
+ - If V(no), SSL certificates will not be validated.
65
65
  - This should only be used on personally controlled sites using self-signed
66
66
  certificates.
67
67
  default: yes
@@ -74,12 +74,12 @@ options:
74
74
  C(Cert:\CurrentUser\My\<thumbprint>).
75
75
  - The WinRM connection must be authenticated with C(CredSSP) or C(become)
76
76
  is used on the task if the certificate file is not password protected.
77
- - Other authentication types can set I(client_cert_password) when the cert
77
+ - Other authentication types can set O(client_cert_password) when the cert
78
78
  is password protected.
79
79
  type: str
80
80
  client_cert_password:
81
81
  description:
82
- - The password for I(client_cert) if the cert is password protected.
82
+ - The password for O(client_cert) if the cert is password protected.
83
83
  type: str
84
84
  force_basic_auth:
85
85
  description:
@@ -96,14 +96,14 @@ options:
96
96
  type: str
97
97
  url_password:
98
98
  description:
99
- - The password for I(url_username).
99
+ - The password for O(url_username).
100
100
  type: str
101
101
  use_default_credential:
102
102
  description:
103
103
  - Uses the current user's credentials when authenticating with a server
104
104
  protected with C(NTLM), C(Kerberos), or C(Negotiate) authentication.
105
105
  - Sites that use C(Basic) auth will still require explicit credentials
106
- through the I(url_username) and I(url_password) options.
106
+ through the O(url_username) and O(url_password) options.
107
107
  - The module will only have access to the user's credentials if using
108
108
  C(become) with a password, you are connecting with SSH using a password,
109
109
  or connecting with WinRM using C(CredSSP) or C(Kerberos with delegation).
@@ -114,14 +114,14 @@ options:
114
114
  type: bool
115
115
  use_proxy:
116
116
  description:
117
- - If C(no), it will not use the proxy defined in IE for the current user.
117
+ - If V(no), it will not use the proxy defined in IE for the current user.
118
118
  default: yes
119
119
  type: bool
120
120
  proxy_url:
121
121
  description:
122
122
  - An explicit proxy to use for the request.
123
- - By default, the request will use the IE defined proxy unless I(use_proxy)
124
- is set to C(no).
123
+ - By default, the request will use the IE defined proxy unless O(use_proxy)
124
+ is set to V(no).
125
125
  type: str
126
126
  proxy_username:
127
127
  description:
@@ -129,14 +129,14 @@ options:
129
129
  type: str
130
130
  proxy_password:
131
131
  description:
132
- - The password for I(proxy_username).
132
+ - The password for O(proxy_username).
133
133
  type: str
134
134
  proxy_use_default_credential:
135
135
  description:
136
136
  - Uses the current user's credentials when authenticating with a proxy host
137
137
  protected with C(NTLM), C(Kerberos), or C(Negotiate) authentication.
138
138
  - Proxies that use C(Basic) auth will still require explicit credentials
139
- through the I(proxy_username) and I(proxy_password) options.
139
+ through the O(proxy_username) and O(proxy_password) options.
140
140
  - The module will only have access to the user's credentials if using
141
141
  C(become) with a password, you are connecting with SSH using a password,
142
142
  or connecting with WinRM using C(CredSSP) or C(Kerberos with delegation).
@@ -14,10 +14,10 @@ options:
14
14
  stage:
15
15
  description:
16
16
  - Control when this vars plugin may be executed.
17
- - Setting this option to C(all) will run the vars plugin after importing inventory and whenever it is demanded by a task.
18
- - Setting this option to C(task) will only run the vars plugin whenever it is demanded by a task.
19
- - Setting this option to C(inventory) will only run the vars plugin after parsing inventory.
20
- - If this option is omitted, the global I(RUN_VARS_PLUGINS) configuration is used to determine when to execute the vars plugin.
17
+ - Setting this option to V(all) will run the vars plugin after importing inventory and whenever it is demanded by a task.
18
+ - Setting this option to V(task) will only run the vars plugin whenever it is demanded by a task.
19
+ - Setting this option to V(inventory) will only run the vars plugin after parsing inventory.
20
+ - If this option is omitted, the global C(RUN_VARS_PLUGINS) configuration is used to determine when to execute the vars plugin.
21
21
  choices: ['all', 'task', 'inventory']
22
22
  version_added: "2.10"
23
23
  type: str
@@ -21,7 +21,7 @@ EXAMPLES: |
21
21
  lola: "{{ 'bG9sYQ==' | b64decode }}"
22
22
 
23
23
  # b64 decode the content of 'b64stuff' variable
24
- stuff: "{{ b64stuff | b64encode }}"
24
+ stuff: "{{ b64stuff | b64decode }}"
25
25
 
26
26
  RETURN:
27
27
  _value:
@@ -14,10 +14,10 @@ DOCUMENTATION:
14
14
 
15
15
  EXAMPLES: |
16
16
  # b64 encode a string
17
- b64lola: "{{ 'lola'|b64encode }}"
17
+ b64lola: "{{ 'lola'| b64encode }}"
18
18
 
19
19
  # b64 encode the content of 'stuff' variable
20
- b64stuff: "{{ stuff|b64encode }}"
20
+ b64stuff: "{{ stuff | b64encode }}"
21
21
 
22
22
  RETURN:
23
23
  _value:
@@ -3,7 +3,7 @@ DOCUMENTATION:
3
3
  version_added: "historical"
4
4
  short_description: cast into a boolean
5
5
  description:
6
- - Attempt to cast the input into a boolean (C(True) or C(False)) value.
6
+ - Attempt to cast the input into a boolean (V(True) or V(False)) value.
7
7
  positional: _input
8
8
  options:
9
9
  _input:
@@ -13,10 +13,10 @@ DOCUMENTATION:
13
13
 
14
14
  EXAMPLES: |
15
15
 
16
- # simply encrypt my key in a vault
16
+ # in vars
17
17
  vars:
18
- isbool: "{{ (a == b)|bool }} "
19
- otherbool: "{{ anothervar|bool }} "
18
+ isbool: "{{ (a == b) | bool }} "
19
+ otherbool: "{{ anothervar | bool }} "
20
20
 
21
21
  # in a task
22
22
  ...
@@ -24,5 +24,5 @@ EXAMPLES: |
24
24
 
25
25
  RETURN:
26
26
  _value:
27
- description: The boolean resulting of casting the input expression into a C(True) or C(False) value.
27
+ description: The boolean resulting of casting the input expression into a V(True) or V(False) value.
28
28
  type: bool
@@ -16,7 +16,7 @@ DOCUMENTATION:
16
16
  elements: dictionary
17
17
  required: true
18
18
  recursive:
19
- description: If C(True), merge elements recursively.
19
+ description: If V(True), merge elements recursively.
20
20
  type: bool
21
21
  default: false
22
22
  list_merge:
@@ -16,7 +16,8 @@ DOCUMENTATION:
16
16
  plugin_type: filter
17
17
  EXAMPLES: |
18
18
 
19
- # To get the longest common path (ex. '/foo/bar') from the given list of paths (ex. ['/foo/bar/foobar','/foo/bar'])
19
+ # To get the longest common path (for example - '/foo/bar') from the given list of paths
20
+ # (for example - ['/foo/bar/foobar','/foo/bar'])
20
21
  {{ listofpaths | commonpath }}
21
22
 
22
23
  RETURN:
@@ -27,14 +27,14 @@ from jinja2.filters import pass_environment
27
27
 
28
28
  from ansible.errors import AnsibleError, AnsibleFilterError, AnsibleFilterTypeError
29
29
  from ansible.module_utils.six import string_types, integer_types, reraise, text_type
30
- from ansible.module_utils._text import to_bytes, to_native, to_text
30
+ from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text
31
31
  from ansible.module_utils.common.collections import is_sequence
32
32
  from ansible.module_utils.common.yaml import yaml_load, yaml_load_all
33
33
  from ansible.parsing.ajson import AnsibleJSONEncoder
34
34
  from ansible.parsing.yaml.dumper import AnsibleDumper
35
35
  from ansible.template import recursive_check_defined
36
36
  from ansible.utils.display import Display
37
- from ansible.utils.encrypt import passlib_or_crypt, PASSLIB_AVAILABLE
37
+ from ansible.utils.encrypt import do_encrypt, PASSLIB_AVAILABLE
38
38
  from ansible.utils.hashing import md5s, checksum_s
39
39
  from ansible.utils.unicode import unicode_wrap
40
40
  from ansible.utils.vars import merge_hash
@@ -292,7 +292,7 @@ def get_encrypted_password(password, hashtype='sha512', salt=None, salt_size=Non
292
292
  )
293
293
 
294
294
  try:
295
- return passlib_or_crypt(password, hashtype, salt=salt, salt_size=salt_size, rounds=rounds, ident=ident)
295
+ return do_encrypt(password, hashtype, salt=salt, salt_size=salt_size, rounds=rounds, ident=ident)
296
296
  except AnsibleError as e:
297
297
  reraise(AnsibleFilterError, AnsibleFilterError(to_native(e), orig_exc=e), sys.exc_info()[2])
298
298
  except Exception as e:
@@ -327,8 +327,7 @@ def mandatory(a, msg=None):
327
327
 
328
328
  if msg is not None:
329
329
  raise AnsibleFilterError(to_native(msg))
330
- else:
331
- raise AnsibleFilterError("Mandatory variable %s not defined." % name)
330
+ raise AnsibleFilterError("Mandatory variable %s not defined." % name)
332
331
 
333
332
  return a
334
333
 
@@ -576,10 +575,9 @@ def path_join(paths):
576
575
  of the different members '''
577
576
  if isinstance(paths, string_types):
578
577
  return os.path.join(paths)
579
- elif is_sequence(paths):
578
+ if is_sequence(paths):
580
579
  return os.path.join(*paths)
581
- else:
582
- raise AnsibleFilterTypeError("|path_join expects string or sequence, got %s instead." % type(paths))
580
+ raise AnsibleFilterTypeError("|path_join expects string or sequence, got %s instead." % type(paths))
583
581
 
584
582
 
585
583
  def commonpath(paths):
@@ -30,8 +30,18 @@ DOCUMENTATION:
30
30
  EXAMPLES: |
31
31
 
32
32
  # items => [ { "key": "a", "value": 1 }, { "key": "b", "value": 2 } ]
33
- items: "{{ {'a': 1, 'b': 2}| dict2items}}"
33
+ items: "{{ {'a': 1, 'b': 2}| dict2items }}"
34
34
 
35
+ # files_dicts: [
36
+ # {
37
+ # "file": "users",
38
+ # "path": "/etc/passwd"
39
+ # },
40
+ # {
41
+ # "file": "groups",
42
+ # "path": "/etc/group"
43
+ # }
44
+ # ]
35
45
  vars:
36
46
  files:
37
47
  users: /etc/passwd
@@ -5,6 +5,7 @@ DOCUMENTATION:
5
5
  short_description: the difference of one list from another
6
6
  description:
7
7
  - Provide a unique list of all the elements of the first list that do not appear in the second one.
8
+ - Items in the resulting list are returned in arbitrary order.
8
9
  options:
9
10
  _input:
10
11
  description: A list.
@@ -8,7 +8,7 @@ from jinja2.runtime import Undefined
8
8
  from jinja2.exceptions import UndefinedError
9
9
 
10
10
  from ansible.errors import AnsibleFilterError, AnsibleFilterTypeError
11
- from ansible.module_utils._text import to_native, to_bytes
11
+ from ansible.module_utils.common.text.converters import to_native, to_bytes
12
12
  from ansible.module_utils.six import string_types, binary_type
13
13
  from ansible.parsing.yaml.objects import AnsibleVaultEncryptedUnicode
14
14
  from ansible.parsing.vault import is_encrypted, VaultSecret, VaultLib
@@ -12,7 +12,7 @@ DOCUMENTATION:
12
12
  description: Index or key to extract.
13
13
  type: raw
14
14
  required: true
15
- contianer:
15
+ container:
16
16
  description: Dictionary or list from which to extract a value.
17
17
  type: raw
18
18
  required: true
@@ -14,7 +14,7 @@ DOCUMENTATION:
14
14
  description: Number of recursive list depths to flatten.
15
15
  type: int
16
16
  skip_nulls:
17
- description: Skip C(null)/C(None) elements when inserting into the top list.
17
+ description: Skip V(null)/V(None) elements when inserting into the top list.
18
18
  type: bool
19
19
  default: true
20
20
 
@@ -14,7 +14,7 @@ DOCUMENTATION:
14
14
  required: true
15
15
  EXAMPLES: |
16
16
  # variable from string variable containing a YAML document
17
- {{ github_workflow | from_yaml}}
17
+ {{ github_workflow | from_yaml }}
18
18
 
19
19
  # variable from string JSON document
20
20
  {{ '{"a": true, "b": 54, "c": [1,2,3]}' | from_yaml }}
@@ -8,7 +8,7 @@ DOCUMENTATION:
8
8
  - If multiple YAML documents are not supplied, this is the equivalend of using C(from_yaml).
9
9
  notes:
10
10
  - This filter functions as a wrapper to the Python C(yaml.safe_load_all) function, part of the L(pyyaml Python library, https://pypi.org/project/PyYAML/).
11
- - Possible conflicts in variable names from the mulitple documents are resolved directly by the pyyaml library.
11
+ - Possible conflicts in variable names from the multiple documents are resolved directly by the pyyaml library.
12
12
  options:
13
13
  _input:
14
14
  description: A YAML string.
@@ -20,7 +20,7 @@ EXAMPLES: |
20
20
  {{ multidoc_yaml_string | from_yaml_all }}
21
21
 
22
22
  # variable from multidocument YAML string
23
- {{ '---\n{"a": true, "b": 54, "c": [1,2,3]}\n...\n---{"x": 1}\n...\n' | from_yaml_all}}
23
+ {{ '---\n{"a": true, "b": 54, "c": [1,2,3]}\n...\n---{"x": 1}\n...\n' | from_yaml_all }}
24
24
 
25
25
  RETURN:
26
26
  _value:
@@ -24,5 +24,5 @@ EXAMPLES: |
24
24
 
25
25
  RETURN:
26
26
  _value:
27
- description: The checksum of the input, as configured in I(hashtype).
27
+ description: The checksum of the input, as configured in O(hashtype).
28
28
  type: string
@@ -7,7 +7,7 @@ DOCUMENTATION:
7
7
  positional: _input, isbits, unit
8
8
  options:
9
9
  _input:
10
- description: Number of bytes, or bits. Depends on I(isbits).
10
+ description: Number of bytes, or bits. Depends on O(isbits).
11
11
  type: int
12
12
  required: true
13
13
  isbits:
@@ -15,7 +15,7 @@ DOCUMENTATION:
15
15
  type: str
16
16
  choices: ['Y', 'Z', 'E', 'P', 'T', 'G', 'M', 'K', 'B']
17
17
  isbits:
18
- description: If C(True), force to interpret only bit input; if C(False), force bytes. Otherwise use the notation to guess.
18
+ description: If V(True), force to interpret only bit input; if V(False), force bytes. Otherwise use the notation to guess.
19
19
  type: bool
20
20
  EXAMPLES: |
21
21
 
@@ -23,7 +23,7 @@ EXAMPLES: |
23
23
  size: '{{ "1.15 GB" | human_to_bytes }}'
24
24
 
25
25
  # size => 1234803098
26
- size: '{{ "1.15" | human_to_bytes(deafult_unit="G") }}'
26
+ size: '{{ "1.15" | human_to_bytes(default_unit="G") }}'
27
27
 
28
28
  # this is an error, wants bits, got bytes
29
29
  ERROR: '{{ "1.15 GB" | human_to_bytes(isbits=true) }}'
@@ -5,6 +5,7 @@ DOCUMENTATION:
5
5
  short_description: intersection of lists
6
6
  description:
7
7
  - Provide a list with the common elements from other lists.
8
+ - Items in the resulting list are returned in arbitrary order.
8
9
  options:
9
10
  _input:
10
11
  description: A list.