ansible-core 2.16.6__py3-none-any.whl → 2.17.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 (596) hide show
  1. ansible/__init__.py +1 -3
  2. ansible/__main__.py +1 -0
  3. ansible/_vendor/__init__.py +1 -2
  4. ansible/cli/__init__.py +7 -8
  5. ansible/cli/adhoc.py +1 -2
  6. ansible/cli/arguments/__init__.py +1 -2
  7. ansible/cli/arguments/option_helpers.py +1 -2
  8. ansible/cli/config.py +1 -2
  9. ansible/cli/console.py +1 -2
  10. ansible/cli/doc.py +320 -198
  11. ansible/cli/galaxy.py +9 -3
  12. ansible/cli/inventory.py +4 -6
  13. ansible/cli/playbook.py +1 -2
  14. ansible/cli/pull.py +4 -5
  15. ansible/cli/scripts/ansible_connection_cli_stub.py +1 -4
  16. ansible/cli/vault.py +1 -2
  17. ansible/collections/list.py +1 -0
  18. ansible/compat/__init__.py +1 -4
  19. ansible/compat/importlib_resources.py +1 -2
  20. ansible/compat/{selectors/__init__.py → selectors.py} +12 -12
  21. ansible/config/ansible_builtin_runtime.yml +2 -0
  22. ansible/config/base.yml +154 -149
  23. ansible/config/manager.py +33 -25
  24. ansible/constants.py +1 -2
  25. ansible/context.py +1 -4
  26. ansible/errors/__init__.py +1 -3
  27. ansible/errors/yaml_strings.py +1 -3
  28. ansible/executor/__init__.py +1 -3
  29. ansible/executor/discovery/python_target.py +1 -2
  30. ansible/executor/interpreter_discovery.py +9 -8
  31. ansible/executor/module_common.py +1 -3
  32. ansible/executor/play_iterator.py +2 -4
  33. ansible/executor/playbook_executor.py +1 -3
  34. ansible/executor/powershell/module_manifest.py +2 -3
  35. ansible/executor/process/__init__.py +1 -3
  36. ansible/executor/process/worker.py +1 -3
  37. ansible/executor/stats.py +1 -3
  38. ansible/executor/task_executor.py +2 -3
  39. ansible/executor/task_queue_manager.py +1 -3
  40. ansible/executor/task_result.py +2 -3
  41. ansible/galaxy/__init__.py +1 -2
  42. ansible/galaxy/api.py +10 -2
  43. ansible/galaxy/collection/__init__.py +38 -24
  44. ansible/galaxy/collection/concrete_artifact_manager.py +1 -2
  45. ansible/galaxy/collection/galaxy_api_proxy.py +1 -2
  46. ansible/galaxy/collection/gpg.py +4 -2
  47. ansible/galaxy/data/apb/meta/main.yml.j2 +0 -15
  48. ansible/galaxy/data/container/meta/main.yml.j2 +0 -18
  49. ansible/galaxy/data/default/role/meta/main.yml.j2 +0 -18
  50. ansible/galaxy/data/network/cliconf_plugins/example.py.j2 +1 -2
  51. ansible/galaxy/data/network/library/example_command.py.j2 +1 -2
  52. ansible/galaxy/data/network/library/example_config.py.j2 +1 -2
  53. ansible/galaxy/data/network/library/example_facts.py.j2 +1 -2
  54. ansible/galaxy/data/network/meta/main.yml.j2 +0 -15
  55. ansible/galaxy/data/network/module_utils/example.py.j2 +1 -2
  56. ansible/galaxy/data/network/netconf_plugins/example.py.j2 +1 -2
  57. ansible/galaxy/data/network/terminal_plugins/example.py.j2 +1 -2
  58. ansible/galaxy/dependency_resolution/__init__.py +1 -2
  59. ansible/galaxy/dependency_resolution/dataclasses.py +5 -6
  60. ansible/galaxy/dependency_resolution/errors.py +1 -2
  61. ansible/galaxy/dependency_resolution/providers.py +3 -4
  62. ansible/galaxy/dependency_resolution/reporters.py +2 -3
  63. ansible/galaxy/dependency_resolution/resolvers.py +1 -2
  64. ansible/galaxy/dependency_resolution/versioning.py +1 -2
  65. ansible/galaxy/role.py +12 -15
  66. ansible/galaxy/token.py +1 -2
  67. ansible/galaxy/user_agent.py +1 -2
  68. ansible/inventory/data.py +1 -2
  69. ansible/inventory/group.py +1 -2
  70. ansible/inventory/helpers.py +1 -2
  71. ansible/inventory/host.py +1 -3
  72. ansible/inventory/manager.py +1 -2
  73. ansible/module_utils/_text.py +1 -2
  74. ansible/module_utils/ansible_release.py +3 -5
  75. ansible/module_utils/api.py +1 -2
  76. ansible/module_utils/basic.py +113 -158
  77. ansible/module_utils/common/_collections_compat.py +1 -2
  78. ansible/module_utils/common/_utils.py +1 -3
  79. ansible/module_utils/common/arg_spec.py +1 -2
  80. ansible/module_utils/common/collections.py +1 -2
  81. ansible/module_utils/common/dict_transformations.py +1 -2
  82. ansible/module_utils/common/file.py +10 -5
  83. ansible/module_utils/common/json.py +1 -3
  84. ansible/module_utils/common/locale.py +1 -2
  85. ansible/module_utils/common/network.py +2 -3
  86. ansible/module_utils/common/parameters.py +9 -9
  87. ansible/module_utils/common/process.py +12 -5
  88. ansible/module_utils/common/respawn.py +2 -3
  89. ansible/module_utils/common/sys_info.py +1 -2
  90. ansible/module_utils/common/text/converters.py +1 -2
  91. ansible/module_utils/common/text/formatters.py +1 -2
  92. ansible/module_utils/common/validation.py +5 -6
  93. ansible/module_utils/common/warnings.py +1 -2
  94. ansible/module_utils/common/yaml.py +1 -2
  95. ansible/module_utils/compat/datetime.py +1 -3
  96. ansible/module_utils/compat/importlib.py +21 -13
  97. ansible/module_utils/compat/paramiko.py +1 -2
  98. ansible/module_utils/compat/selectors.py +10 -34
  99. ansible/module_utils/compat/selinux.py +1 -2
  100. ansible/module_utils/compat/typing.py +1 -2
  101. ansible/module_utils/compat/version.py +1 -2
  102. ansible/module_utils/connection.py +1 -2
  103. ansible/module_utils/csharp/Ansible.Basic.cs +20 -3
  104. ansible/module_utils/distro/__init__.py +3 -4
  105. ansible/module_utils/distro/_distro.py +230 -234
  106. ansible/module_utils/errors.py +1 -2
  107. ansible/module_utils/facts/__init__.py +1 -2
  108. ansible/module_utils/facts/ansible_collector.py +1 -2
  109. ansible/module_utils/facts/collector.py +1 -2
  110. ansible/module_utils/facts/compat.py +1 -2
  111. ansible/module_utils/facts/default_collectors.py +1 -2
  112. ansible/module_utils/facts/hardware/aix.py +1 -2
  113. ansible/module_utils/facts/hardware/base.py +1 -2
  114. ansible/module_utils/facts/hardware/darwin.py +1 -2
  115. ansible/module_utils/facts/hardware/dragonfly.py +1 -2
  116. ansible/module_utils/facts/hardware/freebsd.py +1 -2
  117. ansible/module_utils/facts/hardware/hpux.py +1 -2
  118. ansible/module_utils/facts/hardware/hurd.py +1 -2
  119. ansible/module_utils/facts/hardware/linux.py +8 -6
  120. ansible/module_utils/facts/hardware/netbsd.py +1 -2
  121. ansible/module_utils/facts/hardware/openbsd.py +1 -2
  122. ansible/module_utils/facts/hardware/sunos.py +2 -3
  123. ansible/module_utils/facts/namespace.py +1 -2
  124. ansible/module_utils/facts/network/aix.py +1 -2
  125. ansible/module_utils/facts/network/base.py +1 -2
  126. ansible/module_utils/facts/network/darwin.py +1 -2
  127. ansible/module_utils/facts/network/dragonfly.py +1 -2
  128. ansible/module_utils/facts/network/fc_wwn.py +1 -2
  129. ansible/module_utils/facts/network/freebsd.py +1 -2
  130. ansible/module_utils/facts/network/generic_bsd.py +1 -2
  131. ansible/module_utils/facts/network/hpux.py +1 -2
  132. ansible/module_utils/facts/network/hurd.py +1 -2
  133. ansible/module_utils/facts/network/iscsi.py +1 -2
  134. ansible/module_utils/facts/network/linux.py +1 -2
  135. ansible/module_utils/facts/network/netbsd.py +1 -2
  136. ansible/module_utils/facts/network/nvme.py +1 -2
  137. ansible/module_utils/facts/network/openbsd.py +1 -2
  138. ansible/module_utils/facts/network/sunos.py +1 -2
  139. ansible/module_utils/facts/other/facter.py +1 -2
  140. ansible/module_utils/facts/other/ohai.py +1 -2
  141. ansible/module_utils/facts/packages.py +1 -2
  142. ansible/module_utils/facts/sysctl.py +1 -2
  143. ansible/module_utils/facts/system/apparmor.py +1 -2
  144. ansible/module_utils/facts/system/caps.py +1 -2
  145. ansible/module_utils/facts/system/chroot.py +1 -2
  146. ansible/module_utils/facts/system/cmdline.py +1 -2
  147. ansible/module_utils/facts/system/date_time.py +1 -2
  148. ansible/module_utils/facts/system/distribution.py +4 -5
  149. ansible/module_utils/facts/system/dns.py +1 -2
  150. ansible/module_utils/facts/system/env.py +1 -2
  151. ansible/module_utils/facts/system/fips.py +1 -2
  152. ansible/module_utils/facts/system/loadavg.py +1 -2
  153. ansible/module_utils/facts/system/local.py +1 -2
  154. ansible/module_utils/facts/system/lsb.py +1 -2
  155. ansible/module_utils/facts/system/pkg_mgr.py +7 -30
  156. ansible/module_utils/facts/system/platform.py +1 -2
  157. ansible/module_utils/facts/system/python.py +1 -2
  158. ansible/module_utils/facts/system/selinux.py +1 -2
  159. ansible/module_utils/facts/system/service_mgr.py +1 -2
  160. ansible/module_utils/facts/system/ssh_pub_keys.py +1 -2
  161. ansible/module_utils/facts/system/user.py +1 -2
  162. ansible/module_utils/facts/timeout.py +1 -2
  163. ansible/module_utils/facts/utils.py +1 -2
  164. ansible/module_utils/facts/virtual/base.py +1 -2
  165. ansible/module_utils/facts/virtual/dragonfly.py +1 -2
  166. ansible/module_utils/facts/virtual/freebsd.py +1 -2
  167. ansible/module_utils/facts/virtual/hpux.py +1 -2
  168. ansible/module_utils/facts/virtual/linux.py +1 -2
  169. ansible/module_utils/facts/virtual/netbsd.py +1 -2
  170. ansible/module_utils/facts/virtual/openbsd.py +1 -2
  171. ansible/module_utils/facts/virtual/sunos.py +1 -2
  172. ansible/module_utils/facts/virtual/sysctl.py +1 -2
  173. ansible/module_utils/json_utils.py +1 -2
  174. ansible/module_utils/parsing/convert_bool.py +1 -2
  175. ansible/module_utils/powershell/Ansible.ModuleUtils.Legacy.psm1 +5 -2
  176. ansible/module_utils/powershell/Ansible.ModuleUtils.WebRequest.psm1 +1 -1
  177. ansible/module_utils/pycompat24.py +24 -4
  178. ansible/module_utils/service.py +31 -5
  179. ansible/module_utils/six/__init__.py +1 -1
  180. ansible/module_utils/splitter.py +1 -2
  181. ansible/module_utils/urls.py +335 -1052
  182. ansible/module_utils/yumdnf.py +13 -35
  183. ansible/modules/add_host.py +1 -2
  184. ansible/modules/apt.py +38 -22
  185. ansible/modules/apt_key.py +1 -2
  186. ansible/modules/apt_repository.py +18 -10
  187. ansible/modules/assemble.py +1 -2
  188. ansible/modules/assert.py +8 -4
  189. ansible/modules/async_status.py +17 -14
  190. ansible/modules/async_wrapper.py +11 -9
  191. ansible/modules/blockinfile.py +2 -3
  192. ansible/modules/command.py +1 -2
  193. ansible/modules/copy.py +4 -76
  194. ansible/modules/cron.py +3 -3
  195. ansible/modules/deb822_repository.py +5 -5
  196. ansible/modules/debconf.py +19 -8
  197. ansible/modules/debug.py +1 -2
  198. ansible/modules/dnf.py +59 -186
  199. ansible/modules/dnf5.py +57 -43
  200. ansible/modules/dpkg_selections.py +1 -2
  201. ansible/modules/expect.py +23 -15
  202. ansible/modules/fail.py +1 -2
  203. ansible/modules/fetch.py +1 -2
  204. ansible/modules/file.py +4 -3
  205. ansible/modules/find.py +18 -5
  206. ansible/modules/gather_facts.py +1 -2
  207. ansible/modules/get_url.py +2 -3
  208. ansible/modules/getent.py +2 -3
  209. ansible/modules/git.py +28 -17
  210. ansible/modules/group.py +1 -2
  211. ansible/modules/group_by.py +1 -2
  212. ansible/modules/hostname.py +2 -19
  213. ansible/modules/import_playbook.py +1 -2
  214. ansible/modules/import_role.py +9 -2
  215. ansible/modules/import_tasks.py +1 -2
  216. ansible/modules/include_role.py +1 -2
  217. ansible/modules/include_tasks.py +1 -2
  218. ansible/modules/include_vars.py +1 -2
  219. ansible/modules/iptables.py +38 -21
  220. ansible/modules/known_hosts.py +15 -8
  221. ansible/modules/lineinfile.py +1 -6
  222. ansible/modules/meta.py +3 -2
  223. ansible/modules/package.py +6 -5
  224. ansible/modules/package_facts.py +1 -2
  225. ansible/modules/pause.py +2 -3
  226. ansible/modules/ping.py +1 -2
  227. ansible/modules/pip.py +40 -20
  228. ansible/modules/raw.py +1 -2
  229. ansible/modules/reboot.py +1 -2
  230. ansible/modules/replace.py +7 -5
  231. ansible/modules/rpm_key.py +1 -2
  232. ansible/modules/script.py +1 -2
  233. ansible/modules/service.py +3 -21
  234. ansible/modules/service_facts.py +3 -12
  235. ansible/modules/set_fact.py +1 -2
  236. ansible/modules/set_stats.py +1 -2
  237. ansible/modules/setup.py +1 -2
  238. ansible/modules/shell.py +1 -2
  239. ansible/modules/slurp.py +1 -2
  240. ansible/modules/stat.py +1 -2
  241. ansible/modules/subversion.py +2 -3
  242. ansible/modules/systemd.py +12 -9
  243. ansible/modules/systemd_service.py +12 -9
  244. ansible/modules/sysvinit.py +7 -2
  245. ansible/modules/tempfile.py +7 -2
  246. ansible/modules/template.py +2 -3
  247. ansible/modules/unarchive.py +13 -3
  248. ansible/modules/uri.py +5 -8
  249. ansible/modules/user.py +11 -10
  250. ansible/modules/validate_argument_spec.py +15 -16
  251. ansible/modules/wait_for.py +1 -2
  252. ansible/modules/wait_for_connection.py +1 -2
  253. ansible/modules/yum_repository.py +2 -3
  254. ansible/parsing/__init__.py +1 -3
  255. ansible/parsing/ajson.py +1 -3
  256. ansible/parsing/dataloader.py +23 -12
  257. ansible/parsing/mod_args.py +14 -8
  258. ansible/parsing/plugin_docs.py +1 -2
  259. ansible/parsing/quoting.py +1 -3
  260. ansible/parsing/splitter.py +1 -3
  261. ansible/parsing/utils/__init__.py +1 -3
  262. ansible/parsing/utils/addresses.py +1 -3
  263. ansible/parsing/utils/jsonify.py +1 -3
  264. ansible/parsing/utils/yaml.py +1 -3
  265. ansible/parsing/vault/__init__.py +6 -8
  266. ansible/parsing/yaml/__init__.py +1 -3
  267. ansible/parsing/yaml/constructor.py +1 -3
  268. ansible/parsing/yaml/dumper.py +1 -3
  269. ansible/parsing/yaml/loader.py +1 -3
  270. ansible/parsing/yaml/objects.py +1 -3
  271. ansible/playbook/__init__.py +1 -3
  272. ansible/playbook/attribute.py +1 -3
  273. ansible/playbook/base.py +2 -3
  274. ansible/playbook/block.py +1 -3
  275. ansible/playbook/collectionsearch.py +1 -2
  276. ansible/playbook/conditional.py +1 -3
  277. ansible/playbook/delegatable.py +1 -0
  278. ansible/playbook/handler.py +2 -4
  279. ansible/playbook/handler_task_include.py +1 -3
  280. ansible/playbook/helpers.py +1 -4
  281. ansible/playbook/included_file.py +4 -4
  282. ansible/playbook/loop_control.py +1 -3
  283. ansible/playbook/notifiable.py +1 -0
  284. ansible/playbook/play.py +1 -3
  285. ansible/playbook/play_context.py +1 -3
  286. ansible/playbook/playbook_include.py +1 -3
  287. ansible/playbook/role/__init__.py +1 -3
  288. ansible/playbook/role/definition.py +1 -3
  289. ansible/playbook/role/include.py +1 -3
  290. ansible/playbook/role/metadata.py +1 -3
  291. ansible/playbook/role/requirement.py +1 -3
  292. ansible/playbook/role_include.py +2 -10
  293. ansible/playbook/taggable.py +1 -3
  294. ansible/playbook/task.py +2 -4
  295. ansible/playbook/task_include.py +1 -3
  296. ansible/plugins/__init__.py +4 -5
  297. ansible/plugins/action/__init__.py +20 -14
  298. ansible/plugins/action/add_host.py +2 -4
  299. ansible/plugins/action/assemble.py +2 -3
  300. ansible/plugins/action/assert.py +1 -2
  301. ansible/plugins/action/async_status.py +1 -2
  302. ansible/plugins/action/command.py +1 -2
  303. ansible/plugins/action/copy.py +12 -9
  304. ansible/plugins/action/debug.py +1 -2
  305. ansible/plugins/action/dnf.py +4 -4
  306. ansible/plugins/action/fail.py +1 -2
  307. ansible/plugins/action/fetch.py +2 -3
  308. ansible/plugins/action/gather_facts.py +3 -4
  309. ansible/plugins/action/group_by.py +1 -2
  310. ansible/plugins/action/include_vars.py +1 -2
  311. ansible/plugins/action/normal.py +1 -2
  312. ansible/plugins/action/package.py +36 -21
  313. ansible/plugins/action/pause.py +1 -2
  314. ansible/plugins/action/raw.py +2 -3
  315. ansible/plugins/action/reboot.py +30 -15
  316. ansible/plugins/action/script.py +3 -4
  317. ansible/plugins/action/service.py +1 -2
  318. ansible/plugins/action/set_fact.py +1 -2
  319. ansible/plugins/action/set_stats.py +1 -2
  320. ansible/plugins/action/shell.py +1 -2
  321. ansible/plugins/action/template.py +1 -2
  322. ansible/plugins/action/unarchive.py +1 -2
  323. ansible/plugins/action/uri.py +2 -3
  324. ansible/plugins/action/validate_argument_spec.py +1 -2
  325. ansible/plugins/action/wait_for_connection.py +2 -3
  326. ansible/plugins/become/__init__.py +1 -2
  327. ansible/plugins/become/runas.py +1 -2
  328. ansible/plugins/become/su.py +1 -2
  329. ansible/plugins/become/sudo.py +1 -2
  330. ansible/plugins/cache/__init__.py +3 -3
  331. ansible/plugins/cache/base.py +1 -2
  332. ansible/plugins/cache/jsonfile.py +1 -3
  333. ansible/plugins/cache/memory.py +1 -2
  334. ansible/plugins/callback/__init__.py +2 -4
  335. ansible/plugins/callback/default.py +2 -3
  336. ansible/plugins/callback/junit.py +1 -2
  337. ansible/plugins/callback/minimal.py +1 -3
  338. ansible/plugins/callback/oneline.py +1 -3
  339. ansible/plugins/callback/tree.py +1 -2
  340. ansible/plugins/cliconf/__init__.py +1 -2
  341. ansible/plugins/connection/__init__.py +4 -5
  342. ansible/plugins/connection/local.py +3 -4
  343. ansible/plugins/connection/paramiko_ssh.py +1 -2
  344. ansible/plugins/connection/psrp.py +1 -2
  345. ansible/plugins/connection/ssh.py +18 -54
  346. ansible/plugins/connection/winrm.py +3 -4
  347. ansible/plugins/doc_fragments/action_common_attributes.py +2 -3
  348. ansible/plugins/doc_fragments/action_core.py +3 -4
  349. ansible/plugins/doc_fragments/backup.py +1 -2
  350. ansible/plugins/doc_fragments/connection_pipelining.py +1 -2
  351. ansible/plugins/doc_fragments/constructed.py +1 -2
  352. ansible/plugins/doc_fragments/decrypt.py +2 -3
  353. ansible/plugins/doc_fragments/default_callback.py +1 -2
  354. ansible/plugins/doc_fragments/files.py +1 -2
  355. ansible/plugins/doc_fragments/inventory_cache.py +1 -2
  356. ansible/plugins/doc_fragments/result_format_callback.py +1 -2
  357. ansible/plugins/doc_fragments/return_common.py +1 -2
  358. ansible/plugins/doc_fragments/shell_common.py +1 -2
  359. ansible/plugins/doc_fragments/shell_windows.py +1 -2
  360. ansible/plugins/doc_fragments/template_common.py +1 -2
  361. ansible/plugins/doc_fragments/url.py +1 -2
  362. ansible/plugins/doc_fragments/url_windows.py +1 -2
  363. ansible/plugins/doc_fragments/validate.py +1 -2
  364. ansible/plugins/doc_fragments/vars_plugin_staging.py +1 -2
  365. ansible/plugins/filter/__init__.py +1 -2
  366. ansible/plugins/filter/b64decode.yml +8 -8
  367. ansible/plugins/filter/b64encode.yml +4 -4
  368. ansible/plugins/filter/comment.yml +1 -1
  369. ansible/plugins/filter/core.py +11 -9
  370. ansible/plugins/filter/encryption.py +1 -3
  371. ansible/plugins/filter/extract.yml +1 -1
  372. ansible/plugins/filter/from_yaml_all.yml +1 -1
  373. ansible/plugins/filter/human_readable.yml +3 -3
  374. ansible/plugins/filter/human_to_bytes.yml +2 -2
  375. ansible/plugins/filter/mandatory.yml +1 -1
  376. ansible/plugins/filter/mathstuff.py +2 -2
  377. ansible/plugins/filter/password_hash.yml +3 -2
  378. ansible/plugins/filter/regex_replace.yml +15 -0
  379. ansible/plugins/filter/regex_search.yml +12 -0
  380. ansible/plugins/filter/strftime.yml +2 -9
  381. ansible/plugins/filter/to_datetime.yml +17 -2
  382. ansible/plugins/filter/to_nice_json.yml +4 -0
  383. ansible/plugins/filter/union.yml +1 -1
  384. ansible/plugins/filter/urls.py +1 -2
  385. ansible/plugins/filter/urlsplit.py +1 -2
  386. ansible/plugins/filter/zip.yml +2 -2
  387. ansible/plugins/filter/zip_longest.yml +1 -1
  388. ansible/plugins/httpapi/__init__.py +1 -2
  389. ansible/plugins/inventory/__init__.py +2 -4
  390. ansible/plugins/inventory/advanced_host_list.py +1 -2
  391. ansible/plugins/inventory/auto.py +2 -3
  392. ansible/plugins/inventory/constructed.py +3 -2
  393. ansible/plugins/inventory/generator.py +1 -2
  394. ansible/plugins/inventory/host_list.py +1 -2
  395. ansible/plugins/inventory/ini.py +1 -2
  396. ansible/plugins/inventory/script.py +122 -3
  397. ansible/plugins/inventory/toml.py +1 -2
  398. ansible/plugins/inventory/yaml.py +3 -4
  399. ansible/plugins/list.py +2 -3
  400. ansible/plugins/loader.py +10 -11
  401. ansible/plugins/lookup/__init__.py +1 -3
  402. ansible/plugins/lookup/config.py +19 -15
  403. ansible/plugins/lookup/csvfile.py +16 -7
  404. ansible/plugins/lookup/dict.py +2 -3
  405. ansible/plugins/lookup/env.py +4 -4
  406. ansible/plugins/lookup/file.py +1 -2
  407. ansible/plugins/lookup/fileglob.py +1 -2
  408. ansible/plugins/lookup/first_found.py +8 -7
  409. ansible/plugins/lookup/indexed_items.py +1 -2
  410. ansible/plugins/lookup/ini.py +6 -3
  411. ansible/plugins/lookup/inventory_hostnames.py +1 -2
  412. ansible/plugins/lookup/items.py +1 -2
  413. ansible/plugins/lookup/lines.py +1 -2
  414. ansible/plugins/lookup/list.py +1 -3
  415. ansible/plugins/lookup/nested.py +1 -2
  416. ansible/plugins/lookup/password.py +16 -14
  417. ansible/plugins/lookup/pipe.py +1 -2
  418. ansible/plugins/lookup/random_choice.py +1 -2
  419. ansible/plugins/lookup/sequence.py +21 -52
  420. ansible/plugins/lookup/subelements.py +1 -2
  421. ansible/plugins/lookup/template.py +1 -2
  422. ansible/plugins/lookup/together.py +1 -2
  423. ansible/plugins/lookup/unvault.py +1 -2
  424. ansible/plugins/lookup/url.py +9 -3
  425. ansible/plugins/lookup/varnames.py +1 -2
  426. ansible/plugins/lookup/vars.py +1 -2
  427. ansible/plugins/netconf/__init__.py +1 -2
  428. ansible/plugins/shell/__init__.py +3 -4
  429. ansible/plugins/shell/cmd.py +1 -2
  430. ansible/plugins/shell/powershell.py +1 -2
  431. ansible/plugins/shell/sh.py +1 -2
  432. ansible/plugins/strategy/__init__.py +33 -21
  433. ansible/plugins/strategy/debug.py +1 -2
  434. ansible/plugins/strategy/free.py +17 -7
  435. ansible/plugins/strategy/host_pinned.py +1 -3
  436. ansible/plugins/strategy/linear.py +22 -22
  437. ansible/plugins/terminal/__init__.py +2 -3
  438. ansible/plugins/test/__init__.py +1 -2
  439. ansible/plugins/test/change.yml +1 -1
  440. ansible/plugins/test/changed.yml +1 -1
  441. ansible/plugins/test/contains.yml +1 -1
  442. ansible/plugins/test/core.py +2 -4
  443. ansible/plugins/test/exists.yml +1 -1
  444. ansible/plugins/test/failed.yml +1 -1
  445. ansible/plugins/test/failure.yml +1 -1
  446. ansible/plugins/test/files.py +1 -3
  447. ansible/plugins/test/finished.yml +3 -3
  448. ansible/plugins/test/issuperset.yml +1 -1
  449. ansible/plugins/test/match.yml +1 -1
  450. ansible/plugins/test/mathstuff.py +1 -2
  451. ansible/plugins/test/reachable.yml +1 -1
  452. ansible/plugins/test/regex.yml +1 -1
  453. ansible/plugins/test/search.yml +1 -1
  454. ansible/plugins/test/skip.yml +1 -1
  455. ansible/plugins/test/skipped.yml +1 -1
  456. ansible/plugins/test/started.yml +1 -1
  457. ansible/plugins/test/succeeded.yml +1 -1
  458. ansible/plugins/test/success.yml +1 -1
  459. ansible/plugins/test/successful.yml +1 -1
  460. ansible/plugins/test/superset.yml +1 -1
  461. ansible/plugins/test/unreachable.yml +1 -1
  462. ansible/plugins/test/uri.py +1 -3
  463. ansible/plugins/vars/__init__.py +1 -2
  464. ansible/plugins/vars/host_group_vars.py +2 -3
  465. ansible/release.py +3 -5
  466. ansible/template/__init__.py +24 -37
  467. ansible/template/native_helpers.py +1 -3
  468. ansible/template/template.py +1 -3
  469. ansible/template/vars.py +1 -0
  470. ansible/utils/__init__.py +1 -3
  471. ansible/utils/cmd_functions.py +1 -2
  472. ansible/utils/collection_loader/__init__.py +1 -2
  473. ansible/utils/collection_loader/_collection_config.py +1 -2
  474. ansible/utils/collection_loader/_collection_finder.py +1 -2
  475. ansible/utils/collection_loader/_collection_meta.py +1 -2
  476. ansible/utils/color.py +1 -2
  477. ansible/utils/context_objects.py +1 -4
  478. ansible/utils/display.py +88 -30
  479. ansible/utils/encrypt.py +4 -105
  480. ansible/utils/fqcn.py +1 -2
  481. ansible/utils/galaxy.py +1 -3
  482. ansible/utils/hashing.py +1 -3
  483. ansible/utils/helpers.py +1 -3
  484. ansible/utils/jsonrpc.py +1 -2
  485. ansible/utils/listify.py +1 -3
  486. ansible/utils/lock.py +1 -3
  487. ansible/utils/multiprocessing.py +1 -3
  488. ansible/utils/native_jinja.py +1 -3
  489. ansible/utils/path.py +1 -2
  490. ansible/utils/plugin_docs.py +7 -6
  491. ansible/utils/py3compat.py +17 -55
  492. ansible/utils/sentinel.py +1 -3
  493. ansible/utils/shlex.py +1 -3
  494. ansible/utils/singleton.py +1 -3
  495. ansible/utils/ssh_functions.py +1 -3
  496. ansible/utils/unicode.py +1 -3
  497. ansible/utils/unsafe_proxy.py +1 -2
  498. ansible/utils/vars.py +6 -8
  499. ansible/utils/version.py +1 -3
  500. ansible/vars/clean.py +1 -3
  501. ansible/vars/fact_cache.py +1 -2
  502. ansible/vars/hostvars.py +3 -7
  503. ansible/vars/manager.py +24 -6
  504. ansible/vars/reserved.py +1 -3
  505. {ansible_core-2.16.6.data → ansible_core-2.17.0rc1.data}/scripts/ansible-test +1 -2
  506. {ansible_core-2.16.6.dist-info → ansible_core-2.17.0rc1.dist-info}/METADATA +3 -3
  507. ansible_core-2.17.0rc1.dist-info/RECORD +987 -0
  508. ansible_test/__init__.py +1 -2
  509. ansible_test/_data/completion/docker.txt +7 -9
  510. ansible_test/_data/completion/remote.txt +6 -7
  511. ansible_test/_data/requirements/ansible-test.txt +0 -2
  512. ansible_test/_data/requirements/constraints.txt +1 -6
  513. ansible_test/_data/requirements/sanity.ansible-doc.txt +3 -3
  514. ansible_test/_data/requirements/sanity.changelog.txt +3 -3
  515. ansible_test/_data/requirements/sanity.import.plugin.txt +2 -2
  516. ansible_test/_data/requirements/sanity.mypy.txt +12 -12
  517. ansible_test/_data/requirements/sanity.pep8.txt +1 -1
  518. ansible_test/_data/requirements/sanity.pylint.txt +7 -7
  519. ansible_test/_data/requirements/sanity.runtime-metadata.txt +1 -1
  520. ansible_test/_data/requirements/sanity.validate-modules.txt +3 -3
  521. ansible_test/_data/requirements/sanity.yamllint.txt +2 -2
  522. ansible_test/_internal/bootstrap.py +2 -2
  523. ansible_test/_internal/classification/__init__.py +0 -5
  524. ansible_test/_internal/commands/integration/cloud/cs.py +1 -1
  525. ansible_test/_internal/commands/integration/cloud/nios.py +1 -1
  526. ansible_test/_internal/commands/sanity/__init__.py +1 -27
  527. ansible_test/_internal/commands/sanity/import.py +0 -18
  528. ansible_test/_internal/commands/sanity/mypy.py +7 -10
  529. ansible_test/_internal/commands/units/__init__.py +1 -1
  530. ansible_test/_internal/config.py +0 -1
  531. ansible_test/_internal/content_config.py +0 -5
  532. ansible_test/_internal/coverage_util.py +0 -1
  533. ansible_test/_internal/docker_util.py +1 -1
  534. ansible_test/_internal/host_profiles.py +5 -4
  535. ansible_test/_internal/python_requirements.py +1 -119
  536. ansible_test/_internal/ssh.py +1 -0
  537. ansible_test/_internal/util.py +1 -1
  538. ansible_test/_internal/util_common.py +1 -1
  539. ansible_test/_internal/venv.py +10 -108
  540. ansible_test/_util/__init__.py +1 -2
  541. ansible_test/_util/controller/sanity/mypy/ansible-core.ini +0 -6
  542. ansible_test/_util/controller/sanity/mypy/modules.ini +0 -6
  543. ansible_test/_util/controller/sanity/pylint/config/ansible-test-target.cfg +0 -1
  544. ansible_test/_util/controller/sanity/pylint/config/ansible-test.cfg +0 -1
  545. ansible_test/_util/controller/sanity/pylint/config/code-smell.cfg +0 -1
  546. ansible_test/_util/controller/sanity/pylint/config/collection.cfg +0 -1
  547. ansible_test/_util/controller/sanity/pylint/config/default.cfg +0 -1
  548. ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py +1 -2
  549. ansible_test/_util/controller/sanity/shellcheck/exclude.txt +0 -1
  550. ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py +31 -59
  551. ansible_test/_util/controller/sanity/validate-modules/validate_modules/module_args.py +0 -7
  552. ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py +10 -2
  553. ansible_test/_util/controller/sanity/validate-modules/validate_modules/utils.py +1 -1
  554. ansible_test/_util/controller/sanity/yamllint/yamllinter.py +16 -4
  555. ansible_test/_util/target/__init__.py +1 -2
  556. ansible_test/_util/target/cli/ansible_test_cli_stub.py +1 -2
  557. ansible_test/_util/target/common/constants.py +1 -4
  558. ansible_test/_util/target/injector/python.py +4 -19
  559. ansible_test/_util/target/pytest/plugins/ansible_forked.py +2 -9
  560. ansible_test/_util/target/pytest/plugins/ansible_pytest_collections.py +1 -5
  561. ansible_test/_util/target/pytest/plugins/ansible_pytest_coverage.py +1 -2
  562. ansible_test/_util/target/sanity/compile/compile.py +3 -12
  563. ansible_test/_util/target/sanity/import/importer.py +1 -12
  564. ansible_test/_util/target/setup/bootstrap.sh +49 -105
  565. ansible_test/_util/target/setup/probe_cgroups.py +1 -2
  566. ansible_test/_util/target/setup/quiet_pip.py +1 -16
  567. ansible_test/_util/target/setup/requirements.py +9 -2
  568. ansible_test/_util/target/tools/virtualenvcheck.py +1 -2
  569. ansible_test/_util/target/tools/yamlcheck.py +1 -2
  570. ansible/module_utils/common/_json_compat.py +0 -16
  571. ansible/module_utils/compat/_selectors2.py +0 -655
  572. ansible/modules/yum.py +0 -1821
  573. ansible/plugins/action/yum.py +0 -111
  574. ansible_core-2.16.6.dist-info/RECORD +0 -1009
  575. ansible_test/_util/controller/sanity/code-smell/future-import-boilerplate.json +0 -7
  576. ansible_test/_util/controller/sanity/code-smell/future-import-boilerplate.py +0 -46
  577. ansible_test/_util/controller/sanity/code-smell/metaclass-boilerplate.json +0 -7
  578. ansible_test/_util/controller/sanity/code-smell/metaclass-boilerplate.py +0 -44
  579. ansible_test/_util/controller/sanity/code-smell/no-basestring.json +0 -7
  580. ansible_test/_util/controller/sanity/code-smell/no-basestring.py +0 -21
  581. ansible_test/_util/controller/sanity/code-smell/no-dict-iteritems.json +0 -7
  582. ansible_test/_util/controller/sanity/code-smell/no-dict-iteritems.py +0 -21
  583. ansible_test/_util/controller/sanity/code-smell/no-dict-iterkeys.json +0 -7
  584. ansible_test/_util/controller/sanity/code-smell/no-dict-iterkeys.py +0 -21
  585. ansible_test/_util/controller/sanity/code-smell/no-dict-itervalues.json +0 -7
  586. ansible_test/_util/controller/sanity/code-smell/no-dict-itervalues.py +0 -21
  587. ansible_test/_util/controller/sanity/code-smell/no-main-display.json +0 -10
  588. ansible_test/_util/controller/sanity/code-smell/no-main-display.py +0 -21
  589. ansible_test/_util/controller/sanity/code-smell/no-unicode-literals.json +0 -7
  590. ansible_test/_util/controller/sanity/code-smell/no-unicode-literals.py +0 -21
  591. ansible_test/_util/controller/tools/sslcheck.py +0 -22
  592. ansible_test/_util/target/common/__init__.py +0 -2
  593. {ansible_core-2.16.6.dist-info → ansible_core-2.17.0rc1.dist-info}/COPYING +0 -0
  594. {ansible_core-2.16.6.dist-info → ansible_core-2.17.0rc1.dist-info}/WHEEL +0 -0
  595. {ansible_core-2.16.6.dist-info → ansible_core-2.17.0rc1.dist-info}/entry_points.txt +0 -0
  596. {ansible_core-2.16.6.dist-info → ansible_core-2.17.0rc1.dist-info}/top_level.txt +0 -0
@@ -1,8 +1,7 @@
1
1
  # (c) 2015, Yannig Perre <yannig.perre(at)gmail.com>
2
2
  # (c) 2017 Ansible Project
3
3
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
- from __future__ import (absolute_import, division, print_function)
5
- __metaclass__ = type
4
+ from __future__ import annotations
6
5
 
7
6
  DOCUMENTATION = """
8
7
  name: ini
@@ -155,16 +154,20 @@ class LookupModule(LookupBase):
155
154
  params = _parse_params(term, paramvals)
156
155
  try:
157
156
  updated_key = False
157
+ updated_options = False
158
158
  for param in params:
159
159
  if '=' in param:
160
160
  name, value = param.split('=')
161
161
  if name not in paramvals:
162
162
  raise AnsibleLookupError('%s is not a valid option.' % name)
163
- paramvals[name] = value
163
+ self.set_option(name, value)
164
+ updated_options = True
164
165
  elif key == term:
165
166
  # only take first, this format never supported multiple keys inline
166
167
  key = param
167
168
  updated_key = True
169
+ if updated_options:
170
+ paramvals = self.get_options()
168
171
  except ValueError as e:
169
172
  # bad params passed
170
173
  raise AnsibleLookupError("Could not use '%s' from '%s': %s" % (param, params, to_native(e)), orig_exc=e)
@@ -3,8 +3,7 @@
3
3
  # (c) 2017 Ansible Project
4
4
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
5
5
 
6
- from __future__ import (absolute_import, division, print_function)
7
- __metaclass__ = type
6
+ from __future__ import annotations
8
7
 
9
8
  DOCUMENTATION = """
10
9
  name: inventory_hostnames
@@ -1,8 +1,7 @@
1
1
  # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
2
2
  # (c) 2017 Ansible Project
3
3
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
- from __future__ import (absolute_import, division, print_function)
5
- __metaclass__ = type
4
+ from __future__ import annotations
6
5
 
7
6
  DOCUMENTATION = """
8
7
  name: items
@@ -2,8 +2,7 @@
2
2
  # (c) 2017 Ansible Project
3
3
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
 
5
- from __future__ import (absolute_import, division, print_function)
6
- __metaclass__ = type
5
+ from __future__ import annotations
7
6
 
8
7
  DOCUMENTATION = """
9
8
  name: lines
@@ -1,10 +1,8 @@
1
1
  # (c) 2012-17 Ansible Project
2
2
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
3
3
 
4
- # Make coding more python3-ish
5
- from __future__ import (absolute_import, division, print_function)
4
+ from __future__ import annotations
6
5
 
7
- __metaclass__ = type
8
6
 
9
7
  DOCUMENTATION = """
10
8
  name: list
@@ -1,8 +1,7 @@
1
1
  # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
2
2
  # (c) 2017 Ansible Project
3
3
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
- from __future__ import (absolute_import, division, print_function)
5
- __metaclass__ = type
4
+ from __future__ import annotations
6
5
 
7
6
  DOCUMENTATION = """
8
7
  name: nested
@@ -3,8 +3,7 @@
3
3
  # (c) 2013, Maykel Moya <mmoya@speedyrails.com>
4
4
  # (c) 2017 Ansible Project
5
5
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
6
- from __future__ import (absolute_import, division, print_function)
7
- __metaclass__ = type
6
+ from __future__ import annotations
8
7
 
9
8
  DOCUMENTATION = """
10
9
  name: password
@@ -332,29 +331,32 @@ class LookupModule(LookupBase):
332
331
  if invalid_params:
333
332
  raise AnsibleError('Unrecognized parameter(s) given to password lookup: %s' % ', '.join(invalid_params))
334
333
 
335
- # Set defaults
336
- params['length'] = int(params.get('length', self.get_option('length')))
337
- params['encrypt'] = params.get('encrypt', self.get_option('encrypt'))
338
- params['ident'] = params.get('ident', self.get_option('ident'))
339
- params['seed'] = params.get('seed', self.get_option('seed'))
334
+ # update options with what we got
335
+ if params:
336
+ self.set_options(direct=params)
340
337
 
341
- params['chars'] = params.get('chars', self.get_option('chars'))
342
- if params['chars'] and isinstance(params['chars'], string_types):
338
+ # chars still might need more
339
+ chars = params.get('chars', self.get_option('chars'))
340
+ if chars and isinstance(chars, string_types):
343
341
  tmp_chars = []
344
- if u',,' in params['chars']:
342
+ if u',,' in chars:
345
343
  tmp_chars.append(u',')
346
- tmp_chars.extend(c for c in params['chars'].replace(u',,', u',').split(u',') if c)
347
- params['chars'] = tmp_chars
344
+ tmp_chars.extend(c for c in chars.replace(u',,', u',').split(u',') if c)
345
+ self.set_option('chars', tmp_chars)
346
+
347
+ # return processed params
348
+ for field in VALID_PARAMS:
349
+ params[field] = self.get_option(field)
348
350
 
349
351
  return relpath, params
350
352
 
351
353
  def run(self, terms, variables, **kwargs):
352
354
  ret = []
353
355
 
354
- self.set_options(var_options=variables, direct=kwargs)
355
-
356
356
  for term in terms:
357
357
 
358
+ self.set_options(var_options=variables, direct=kwargs)
359
+
358
360
  changed = None
359
361
  relpath, params = self._parse_parameters(term)
360
362
  path = self._loader.path_dwim(relpath)
@@ -1,8 +1,7 @@
1
1
  # (c) 2012, Daniel Hokka Zakrisson <daniel@hozac.com>
2
2
  # (c) 2017 Ansible Project
3
3
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
- from __future__ import (absolute_import, division, print_function)
5
- __metaclass__ = type
4
+ from __future__ import annotations
6
5
 
7
6
  DOCUMENTATION = r"""
8
7
  name: pipe
@@ -1,8 +1,7 @@
1
1
  # (c) 2013, Michael DeHaan <michael.dehaan@gmail.com>
2
2
  # (c) 2017 Ansible Project
3
3
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
- from __future__ import (absolute_import, division, print_function)
5
- __metaclass__ = type
4
+ from __future__ import annotations
6
5
 
7
6
  DOCUMENTATION = """
8
7
  name: random_choice
@@ -1,8 +1,7 @@
1
1
  # (c) 2013, Jayson Vantuyl <jayson@aggressive.ly>
2
2
  # (c) 2012-17 Ansible Project
3
3
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
- from __future__ import (absolute_import, division, print_function)
5
- __metaclass__ = type
4
+ from __future__ import annotations
6
5
 
7
6
  DOCUMENTATION = """
8
7
  name: sequence
@@ -20,21 +19,21 @@ DOCUMENTATION = """
20
19
  options:
21
20
  start:
22
21
  description: number at which to start the sequence
23
- default: 0
22
+ default: 1
24
23
  type: integer
25
24
  end:
26
25
  description: number at which to end the sequence, dont use this with count
27
26
  type: integer
28
- default: 0
29
27
  count:
30
28
  description: number of elements in the sequence, this is not to be used with end
31
29
  type: integer
32
- default: 0
33
30
  stride:
34
31
  description: increments between sequence numbers, the default is 1 unless the end is less than the start, then it is -1.
35
32
  type: integer
33
+ default: 1
36
34
  format:
37
35
  description: return a string with the generated number formatted in
36
+ default: "%d"
38
37
  """
39
38
 
40
39
  EXAMPLES = """
@@ -98,6 +97,7 @@ SHORTCUT = re_compile(
98
97
  "(:(.+))?$", # Group 5, Group 6: Format String
99
98
  IGNORECASE
100
99
  )
100
+ FIELDS = frozenset(('start', 'end', 'stride', 'count', 'format'))
101
101
 
102
102
 
103
103
  class LookupModule(LookupBase):
@@ -139,30 +139,12 @@ class LookupModule(LookupBase):
139
139
  calculating the number of entries in a sequence when a stride is specified.
140
140
  """
141
141
 
142
- def reset(self):
143
- """set sensible defaults"""
144
- self.start = 1
145
- self.count = None
146
- self.end = None
147
- self.stride = 1
148
- self.format = "%d"
149
-
150
142
  def parse_kv_args(self, args):
151
143
  """parse key-value style arguments"""
152
- for arg in ["start", "end", "count", "stride"]:
153
- try:
154
- arg_raw = args.pop(arg, None)
155
- if arg_raw is None:
156
- continue
157
- arg_cooked = int(arg_raw, 0)
158
- setattr(self, arg, arg_cooked)
159
- except ValueError:
160
- raise AnsibleError(
161
- "can't parse %s=%s as integer"
162
- % (arg, arg_raw)
163
- )
164
- if 'format' in args:
165
- self.format = args.pop("format")
144
+ for arg in FIELDS:
145
+ value = args.pop(arg, None)
146
+ if value is not None:
147
+ self.set_option(arg, value)
166
148
  if args:
167
149
  raise AnsibleError(
168
150
  "unrecognized arguments to with_sequence: %s"
@@ -177,33 +159,17 @@ class LookupModule(LookupBase):
177
159
 
178
160
  dummy, start, end, dummy, stride, dummy, format = match.groups()
179
161
 
180
- if start is not None:
181
- try:
182
- start = int(start, 0)
183
- except ValueError:
184
- raise AnsibleError("can't parse start=%s as integer" % start)
185
- if end is not None:
186
- try:
187
- end = int(end, 0)
188
- except ValueError:
189
- raise AnsibleError("can't parse end=%s as integer" % end)
190
- if stride is not None:
191
- try:
192
- stride = int(stride, 0)
193
- except ValueError:
194
- raise AnsibleError("can't parse stride=%s as integer" % stride)
195
-
196
- if start is not None:
197
- self.start = start
198
- if end is not None:
199
- self.end = end
200
- if stride is not None:
201
- self.stride = stride
202
- if format is not None:
203
- self.format = format
162
+ for key in FIELDS:
163
+ value = locals().get(key, None)
164
+ if value is not None:
165
+ self.set_option(key, value)
204
166
 
205
167
  return True
206
168
 
169
+ def set_fields(self):
170
+ for f in FIELDS:
171
+ setattr(self, f, self.get_option(f))
172
+
207
173
  def sanity_check(self):
208
174
  if self.count is None and self.end is None:
209
175
  raise AnsibleError("must specify count or end in with_sequence")
@@ -246,7 +212,8 @@ class LookupModule(LookupBase):
246
212
 
247
213
  for term in terms:
248
214
  try:
249
- self.reset() # clear out things for this iteration
215
+ # set defaults/global
216
+ self.set_options(direct=kwargs)
250
217
  try:
251
218
  if not self.parse_simple_args(term):
252
219
  self.parse_kv_args(parse_kv(term))
@@ -255,7 +222,9 @@ class LookupModule(LookupBase):
255
222
  except Exception as e:
256
223
  raise AnsibleError("unknown error parsing with_sequence arguments: %r. Error was: %s" % (term, e))
257
224
 
225
+ self.set_fields()
258
226
  self.sanity_check()
227
+
259
228
  if self.stride != 0:
260
229
  results.extend(self.generate_sequence())
261
230
  except AnsibleError:
@@ -1,8 +1,7 @@
1
1
  # (c) 2013, Serge van Ginderachter <serge@vanginderachter.be>
2
2
  # (c) 2012-17 Ansible Project
3
3
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
- from __future__ import (absolute_import, division, print_function)
5
- __metaclass__ = type
4
+ from __future__ import annotations
6
5
 
7
6
  DOCUMENTATION = """
8
7
  name: subelements
@@ -2,8 +2,7 @@
2
2
  # Copyright: (c) 2012-17, Ansible Project
3
3
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
4
 
5
- from __future__ import (absolute_import, division, print_function)
6
- __metaclass__ = type
5
+ from __future__ import annotations
7
6
 
8
7
  DOCUMENTATION = """
9
8
  name: template
@@ -1,8 +1,7 @@
1
1
  # (c) 2013, Bradley Young <young.bradley@gmail.com>
2
2
  # (c) 2012-17 Ansible Project
3
3
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
- from __future__ import (absolute_import, division, print_function)
5
- __metaclass__ = type
4
+ from __future__ import annotations
6
5
 
7
6
  DOCUMENTATION = """
8
7
  name: together
@@ -1,7 +1,6 @@
1
1
  # (c) 2020 Ansible Project
2
2
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
3
- from __future__ import (absolute_import, division, print_function)
4
- __metaclass__ = type
3
+ from __future__ import annotations
5
4
 
6
5
  DOCUMENTATION = """
7
6
  name: unvault
@@ -1,8 +1,7 @@
1
1
  # (c) 2015, Brian Coca <bcoca@ansible.com>
2
2
  # (c) 2012-17 Ansible Project
3
3
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
- from __future__ import (absolute_import, division, print_function)
5
- __metaclass__ = type
4
+ from __future__ import annotations
6
5
 
7
6
  DOCUMENTATION = """
8
7
  name: url
@@ -88,7 +87,7 @@ options:
88
87
  - section: url_lookup
89
88
  key: force_basic_auth
90
89
  follow_redirects:
91
- description: String of urllib2, all/yes, safe, none to determine how redirects are followed, see RedirectHandlerFactory for more information
90
+ description: String of urllib2, all/yes, safe, none to determine how redirects are followed
92
91
  type: string
93
92
  version_added: "2.10"
94
93
  default: 'urllib2'
@@ -99,6 +98,13 @@ options:
99
98
  ini:
100
99
  - section: url_lookup
101
100
  key: follow_redirects
101
+ choices:
102
+ - urllib2
103
+ - all
104
+ - 'yes'
105
+ - safe
106
+ - none
107
+ - 'no'
102
108
  use_gssapi:
103
109
  description:
104
110
  - Use GSSAPI handler of requests
@@ -1,7 +1,6 @@
1
1
  # (c) 2017 Ansible Project
2
2
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
3
- from __future__ import (absolute_import, division, print_function)
4
- __metaclass__ = type
3
+ from __future__ import annotations
5
4
 
6
5
  DOCUMENTATION = """
7
6
  name: varnames
@@ -1,7 +1,6 @@
1
1
  # (c) 2017 Ansible Project
2
2
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
3
- from __future__ import (absolute_import, division, print_function)
4
- __metaclass__ = type
3
+ from __future__ import annotations
5
4
 
6
5
  DOCUMENTATION = """
7
6
  name: vars
@@ -16,8 +16,7 @@
16
16
  # You should have received a copy of the GNU General Public License
17
17
  # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
18
18
  #
19
- from __future__ import (absolute_import, division, print_function)
20
- __metaclass__ = type
19
+ from __future__ import annotations
21
20
 
22
21
  from abc import abstractmethod
23
22
  from functools import wraps
@@ -14,8 +14,7 @@
14
14
  #
15
15
  # You should have received a copy of the GNU General Public License
16
16
  # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
17
- from __future__ import (absolute_import, division, print_function)
18
- __metaclass__ = type
17
+ from __future__ import annotations
19
18
 
20
19
  import os
21
20
  import os.path
@@ -65,12 +64,12 @@ class ShellBase(AnsiblePlugin):
65
64
  # TODO: config system should already resolve this so we should be able to just iterate over dicts
66
65
  env = self.get_option('environment')
67
66
  if isinstance(env, string_types):
68
- raise AnsibleError('The "envirionment" keyword takes a list of dictionaries or a dictionary, not a string')
67
+ raise AnsibleError('The "environment" keyword takes a list of dictionaries or a dictionary, not a string')
69
68
  if not isinstance(env, Sequence):
70
69
  env = [env]
71
70
  for env_dict in env:
72
71
  if not isinstance(env_dict, Mapping):
73
- raise AnsibleError('The "envirionment" keyword takes a list of dictionaries (or single dictionary), but got a "%s" instead' % type(env_dict))
72
+ raise AnsibleError('The "environment" keyword takes a list of dictionaries (or single dictionary), but got a "%s" instead' % type(env_dict))
74
73
  self.env.update(env_dict)
75
74
 
76
75
  # We can remove the try: except in the future when we make ShellBase a proper subset of
@@ -1,7 +1,6 @@
1
1
  # Copyright (c) 2019 Ansible Project
2
2
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
3
- from __future__ import (absolute_import, division, print_function)
4
- __metaclass__ = type
3
+ from __future__ import annotations
5
4
 
6
5
  DOCUMENTATION = '''
7
6
  name: cmd
@@ -1,8 +1,7 @@
1
1
  # Copyright (c) 2014, Chris Church <chris@ninemoreminutes.com>
2
2
  # Copyright (c) 2017 Ansible Project
3
3
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
- from __future__ import (absolute_import, division, print_function)
5
- __metaclass__ = type
4
+ from __future__ import annotations
6
5
 
7
6
  DOCUMENTATION = '''
8
7
  name: powershell
@@ -1,8 +1,7 @@
1
1
  # Copyright (c) 2014, Chris Church <chris@ninemoreminutes.com>
2
2
  # Copyright (c) 2017 Ansible Project
3
3
  # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
4
- from __future__ import (absolute_import, division, print_function)
5
- __metaclass__ = type
4
+ from __future__ import annotations
6
5
 
7
6
  DOCUMENTATION = '''
8
7
  name: sh
@@ -15,9 +15,7 @@
15
15
  # You should have received a copy of the GNU General Public License
16
16
  # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
17
17
 
18
- # Make coding more python3-ish
19
- from __future__ import (absolute_import, division, print_function)
20
- __metaclass__ = type
18
+ from __future__ import annotations
21
19
 
22
20
  import cmd
23
21
  import functools
@@ -555,12 +553,19 @@ class StrategyBase:
555
553
  seen = []
556
554
  for handler in handlers:
557
555
  if listeners := handler.listen:
558
- if notification in handler.get_validated_value(
556
+ listeners = handler.get_validated_value(
559
557
  'listen',
560
558
  handler.fattributes.get('listen'),
561
559
  listeners,
562
560
  templar,
563
- ):
561
+ )
562
+ if handler._role is not None:
563
+ for listener in listeners.copy():
564
+ listeners.extend([
565
+ handler._role.get_name(include_role_fqcn=True) + ' : ' + listener,
566
+ handler._role.get_name(include_role_fqcn=False) + ' : ' + listener
567
+ ])
568
+ if notification in listeners:
564
569
  if handler.name and handler.name in seen:
565
570
  continue
566
571
  seen.append(handler.name)
@@ -845,7 +850,7 @@ class StrategyBase:
845
850
 
846
851
  return ti_copy
847
852
 
848
- def _load_included_file(self, included_file, iterator, is_handler=False):
853
+ def _load_included_file(self, included_file, iterator, is_handler=False, handle_stats_and_callbacks=True):
849
854
  '''
850
855
  Loads an included YAML file of tasks, applying the optional set of variables.
851
856
 
@@ -853,6 +858,15 @@ class StrategyBase:
853
858
  in such case the caller is responsible for marking the host(s) as failed
854
859
  using PlayIterator.mark_host_failed().
855
860
  '''
861
+ if handle_stats_and_callbacks:
862
+ display.deprecated(
863
+ "Reporting play recap stats and running callbacks functionality for "
864
+ "``include_tasks`` in ``StrategyBase._load_included_file`` is deprecated. "
865
+ "See ``https://github.com/ansible/ansible/pull/79260`` for guidance on how to "
866
+ "move the reporting into specific strategy plugins to account for "
867
+ "``include_role`` tasks as well.",
868
+ version="2.21"
869
+ )
856
870
  display.debug("loading included file: %s" % included_file._filename)
857
871
  try:
858
872
  data = self._loader.load_from_file(included_file._filename)
@@ -872,11 +886,9 @@ class StrategyBase:
872
886
  loader=self._loader,
873
887
  variable_manager=self._variable_manager,
874
888
  )
875
-
876
- # since we skip incrementing the stats when the task result is
877
- # first processed, we do so now for each host in the list
878
- for host in included_file._hosts:
879
- self._tqm._stats.increment('ok', host.name)
889
+ if handle_stats_and_callbacks:
890
+ for host in included_file._hosts:
891
+ self._tqm._stats.increment('ok', host.name)
880
892
  except AnsibleParserError:
881
893
  raise
882
894
  except AnsibleError as e:
@@ -884,18 +896,18 @@ class StrategyBase:
884
896
  reason = "Could not find or access '%s' on the Ansible Controller." % to_text(e.file_name)
885
897
  else:
886
898
  reason = to_text(e)
887
-
888
- for r in included_file._results:
889
- r._result['failed'] = True
890
-
891
- for host in included_file._hosts:
892
- tr = TaskResult(host=host, task=included_file._task, return_data=dict(failed=True, reason=reason))
893
- self._tqm._stats.increment('failures', host.name)
894
- self._tqm.send_callback('v2_runner_on_failed', tr)
899
+ if handle_stats_and_callbacks:
900
+ for r in included_file._results:
901
+ r._result['failed'] = True
902
+
903
+ for host in included_file._hosts:
904
+ tr = TaskResult(host=host, task=included_file._task, return_data=dict(failed=True, reason=reason))
905
+ self._tqm._stats.increment('failures', host.name)
906
+ self._tqm.send_callback('v2_runner_on_failed', tr)
895
907
  raise AnsibleError(reason) from e
896
908
 
897
- # finally, send the callback and return the list of blocks loaded
898
- self._tqm.send_callback('v2_playbook_on_include', included_file)
909
+ if handle_stats_and_callbacks:
910
+ self._tqm.send_callback('v2_playbook_on_include', included_file)
899
911
  display.debug("done processing included file")
900
912
  return block_list
901
913
 
@@ -12,8 +12,7 @@
12
12
  #
13
13
  # You should have received a copy of the GNU General Public License
14
14
  # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
15
- from __future__ import (absolute_import, division, print_function)
16
- __metaclass__ = type
15
+ from __future__ import annotations
17
16
 
18
17
  DOCUMENTATION = '''
19
18
  name: debug
@@ -14,9 +14,7 @@
14
14
  #
15
15
  # You should have received a copy of the GNU General Public License
16
16
  # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
17
- # Make coding more python3-ish
18
- from __future__ import (absolute_import, division, print_function)
19
- __metaclass__ = type
17
+ from __future__ import annotations
20
18
 
21
19
  DOCUMENTATION = '''
22
20
  name: free
@@ -250,7 +248,12 @@ class StrategyModule(StrategyBase):
250
248
  )
251
249
  else:
252
250
  is_handler = isinstance(included_file._task, Handler)
253
- new_blocks = self._load_included_file(included_file, iterator=iterator, is_handler=is_handler)
251
+ new_blocks = self._load_included_file(
252
+ included_file,
253
+ iterator=iterator,
254
+ is_handler=is_handler,
255
+ handle_stats_and_callbacks=False,
256
+ )
254
257
 
255
258
  # let PlayIterator know about any new handlers included via include_role or
256
259
  # import_role within include_role/include_taks
@@ -258,13 +261,20 @@ class StrategyModule(StrategyBase):
258
261
  except AnsibleParserError:
259
262
  raise
260
263
  except AnsibleError as e:
261
- if included_file._is_role:
262
- # include_role does not have on_include callback so display the error
263
- display.error(to_text(e), wrap_text=False)
264
+ display.error(to_text(e), wrap_text=False)
264
265
  for r in included_file._results:
265
266
  r._result['failed'] = True
267
+ r._result['reason'] = str(e)
268
+ self._tqm._stats.increment('failures', r._host.name)
269
+ self._tqm.send_callback('v2_runner_on_failed', r)
266
270
  failed_includes_hosts.add(r._host)
267
271
  continue
272
+ else:
273
+ # since we skip incrementing the stats when the task result is
274
+ # first processed, we do so now for each host in the list
275
+ for host in included_file._hosts:
276
+ self._tqm._stats.increment('ok', host.name)
277
+ self._tqm.send_callback('v2_playbook_on_include', included_file)
268
278
 
269
279
  for new_block in new_blocks:
270
280
  if is_handler:
@@ -14,9 +14,7 @@
14
14
  #
15
15
  # You should have received a copy of the GNU General Public License
16
16
  # along with Ansible. If not, see <http://www.gnu.org/licenses/>.
17
- # Make coding more python3-ish
18
- from __future__ import (absolute_import, division, print_function)
19
- __metaclass__ = type
17
+ from __future__ import annotations
20
18
 
21
19
  DOCUMENTATION = '''
22
20
  name: host_pinned