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
ansible/modules/dnf.py CHANGED
@@ -29,7 +29,7 @@ options:
29
29
  description:
30
30
  - "A package name or package specifier with version, like C(name-1.0).
31
31
  When using state=latest, this can be '*' which means run: dnf -y update.
32
- You can also pass a url or a local path to a rpm file.
32
+ You can also pass a url or a local path to an rpm file.
33
33
  To operate on several packages this can accept a comma separated string of packages or a list of packages."
34
34
  - Comparison operators for package version are valid here C(>), C(<), C(>=), C(<=). Example - C(name >= 1.0).
35
35
  Spaces around the operator are required.
@@ -44,14 +44,14 @@ options:
44
44
  list:
45
45
  description:
46
46
  - Various (non-idempotent) commands for usage with C(/usr/bin/ansible) and I(not) playbooks.
47
- Use M(ansible.builtin.package_facts) instead of the C(list) argument as a best practice.
47
+ Use M(ansible.builtin.package_facts) instead of the O(list) argument as a best practice.
48
48
  type: str
49
49
 
50
50
  state:
51
51
  description:
52
- - Whether to install (C(present), C(latest)), or remove (C(absent)) a package.
53
- - Default is C(None), however in effect the default action is C(present) unless the C(autoremove) option is
54
- enabled for this module, then C(absent) is inferred.
52
+ - Whether to install (V(present), V(latest)), or remove (V(absent)) a package.
53
+ - Default is V(None), however in effect the default action is V(present) unless the O(autoremove) option is
54
+ enabled for this module, then V(absent) is inferred.
55
55
  choices: ['absent', 'present', 'installed', 'removed', 'latest']
56
56
  type: str
57
57
 
@@ -81,7 +81,7 @@ options:
81
81
  disable_gpg_check:
82
82
  description:
83
83
  - Whether to disable the GPG checking of signatures of packages being
84
- installed. Has an effect only if state is I(present) or I(latest).
84
+ installed. Has an effect only if O(state) is V(present) or V(latest).
85
85
  - This setting affects packages installed from a repository as well as
86
86
  "local" packages installed from the filesystem or a URL.
87
87
  type: bool
@@ -104,9 +104,9 @@ options:
104
104
 
105
105
  autoremove:
106
106
  description:
107
- - If C(true), removes all "leaf" packages from the system that were originally
107
+ - If V(true), removes all "leaf" packages from the system that were originally
108
108
  installed as dependencies of user-installed packages but which are no longer
109
- required by any such package. Should be used alone or when state is I(absent)
109
+ required by any such package. Should be used alone or when O(state) is V(absent)
110
110
  type: bool
111
111
  default: "no"
112
112
  version_added: "2.4"
@@ -128,7 +128,7 @@ options:
128
128
  update_cache:
129
129
  description:
130
130
  - Force dnf to check if cache is out of date and redownload if needed.
131
- Has an effect only if state is I(present) or I(latest).
131
+ Has an effect only if O(state) is V(present) or V(latest).
132
132
  type: bool
133
133
  default: "no"
134
134
  aliases: [ expire-cache ]
@@ -136,20 +136,20 @@ options:
136
136
  update_only:
137
137
  description:
138
138
  - When using latest, only update installed packages. Do not install packages.
139
- - Has an effect only if state is I(latest)
139
+ - Has an effect only if O(state) is V(latest)
140
140
  default: "no"
141
141
  type: bool
142
142
  version_added: "2.7"
143
143
  security:
144
144
  description:
145
- - If set to C(true), and C(state=latest) then only installs updates that have been marked security related.
145
+ - If set to V(true), and O(state=latest) then only installs updates that have been marked security related.
146
146
  - Note that, similar to C(dnf upgrade-minimal), this filter applies to dependencies as well.
147
147
  type: bool
148
148
  default: "no"
149
149
  version_added: "2.7"
150
150
  bugfix:
151
151
  description:
152
- - If set to C(true), and C(state=latest) then only installs updates that have been marked bugfix related.
152
+ - If set to V(true), and O(state=latest) then only installs updates that have been marked bugfix related.
153
153
  - Note that, similar to C(dnf upgrade-minimal), this filter applies to dependencies as well.
154
154
  default: "no"
155
155
  type: bool
@@ -173,22 +173,22 @@ options:
173
173
  disable_excludes:
174
174
  description:
175
175
  - Disable the excludes defined in DNF config files.
176
- - If set to C(all), disables all excludes.
177
- - If set to C(main), disable excludes defined in [main] in dnf.conf.
178
- - If set to C(repoid), disable excludes defined for given repo id.
176
+ - If set to V(all), disables all excludes.
177
+ - If set to V(main), disable excludes defined in [main] in dnf.conf.
178
+ - If set to V(repoid), disable excludes defined for given repo id.
179
179
  version_added: "2.7"
180
180
  type: str
181
181
  validate_certs:
182
182
  description:
183
- - This only applies if using a https url as the source of the rpm. e.g. for localinstall. If set to C(false), the SSL certificates will not be validated.
184
- - This should only set to C(false) used on personally controlled sites using self-signed certificates as it avoids verifying the source site.
183
+ - This only applies if using a https url as the source of the rpm. e.g. for localinstall. If set to V(false), the SSL certificates will not be validated.
184
+ - This should only set to V(false) used on personally controlled sites using self-signed certificates as it avoids verifying the source site.
185
185
  type: bool
186
186
  default: "yes"
187
187
  version_added: "2.7"
188
188
  sslverify:
189
189
  description:
190
190
  - Disables SSL validation of the repository server for this transaction.
191
- - This should be set to C(false) if one of the configured repositories is using an untrusted or self-signed certificate.
191
+ - This should be set to V(false) if one of the configured repositories is using an untrusted or self-signed certificate.
192
192
  type: bool
193
193
  default: "yes"
194
194
  version_added: "2.13"
@@ -208,7 +208,7 @@ options:
208
208
  install_repoquery:
209
209
  description:
210
210
  - This is effectively a no-op in DNF as it is not needed with DNF, but is an accepted parameter for feature
211
- parity/compatibility with the I(yum) module.
211
+ parity/compatibility with the M(ansible.builtin.yum) module.
212
212
  type: bool
213
213
  default: "yes"
214
214
  version_added: "2.7"
@@ -234,12 +234,12 @@ options:
234
234
  download_dir:
235
235
  description:
236
236
  - Specifies an alternate directory to store packages.
237
- - Has an effect only if I(download_only) is specified.
237
+ - Has an effect only if O(download_only) is specified.
238
238
  type: str
239
239
  version_added: "2.8"
240
240
  allowerasing:
241
241
  description:
242
- - If C(true) it allows erasing of installed packages to resolve dependencies.
242
+ - If V(true) it allows erasing of installed packages to resolve dependencies.
243
243
  required: false
244
244
  type: bool
245
245
  default: "no"
@@ -383,9 +383,8 @@ import os
383
383
  import re
384
384
  import sys
385
385
 
386
- from ansible.module_utils._text import to_native, to_text
386
+ from ansible.module_utils.common.text.converters import to_native, to_text
387
387
  from ansible.module_utils.urls import fetch_file
388
- from ansible.module_utils.six import text_type
389
388
  from ansible.module_utils.compat.version import LooseVersion
390
389
 
391
390
  from ansible.module_utils.basic import AnsibleModule
@@ -582,6 +581,7 @@ class DnfModule(YumDnf):
582
581
  import dnf.cli
583
582
  import dnf.const
584
583
  import dnf.exceptions
584
+ import dnf.package
585
585
  import dnf.subject
586
586
  import dnf.util
587
587
  HAS_DNF = True
@@ -966,12 +966,14 @@ class DnfModule(YumDnf):
966
966
  def _update_only(self, pkgs):
967
967
  not_installed = []
968
968
  for pkg in pkgs:
969
- if self._is_installed(pkg):
969
+ if self._is_installed(
970
+ self._package_dict(pkg)["nevra"] if isinstance(pkg, dnf.package.Package) else pkg
971
+ ):
970
972
  try:
971
- if isinstance(to_text(pkg), text_type):
972
- self.base.upgrade(pkg)
973
- else:
973
+ if isinstance(pkg, dnf.package.Package):
974
974
  self.base.package_upgrade(pkg)
975
+ else:
976
+ self.base.upgrade(pkg)
975
977
  except Exception as e:
976
978
  self.module.fail_json(
977
979
  msg="Error occurred attempting update_only operation: {0}".format(to_native(e)),
ansible/modules/dnf5.py CHANGED
@@ -11,15 +11,15 @@ module: dnf5
11
11
  author: Ansible Core Team
12
12
  description:
13
13
  - Installs, upgrade, removes, and lists packages and groups with the I(dnf5) package manager.
14
- - "WARNING: The I(dnf5) package manager is still under development and not all features that the existing I(dnf) module
15
- provides are implemented in I(dnf5), please consult specific options for more information."
14
+ - "WARNING: The I(dnf5) package manager is still under development and not all features that the existing M(ansible.builtin.dnf) module
15
+ provides are implemented in M(ansible.builtin.dnf5), please consult specific options for more information."
16
16
  short_description: Manages packages with the I(dnf5) package manager
17
17
  options:
18
18
  name:
19
19
  description:
20
20
  - "A package name or package specifier with version, like C(name-1.0).
21
21
  When using state=latest, this can be '*' which means run: dnf -y update.
22
- You can also pass a url or a local path to a rpm file.
22
+ You can also pass a url or a local path to an rpm file.
23
23
  To operate on several packages this can accept a comma separated string of packages or a list of packages."
24
24
  - Comparison operators for package version are valid here C(>), C(<), C(>=), C(<=). Example - C(name >= 1.0).
25
25
  Spaces around the operator are required.
@@ -33,13 +33,13 @@ options:
33
33
  list:
34
34
  description:
35
35
  - Various (non-idempotent) commands for usage with C(/usr/bin/ansible) and I(not) playbooks.
36
- Use M(ansible.builtin.package_facts) instead of the C(list) argument as a best practice.
36
+ Use M(ansible.builtin.package_facts) instead of the O(list) argument as a best practice.
37
37
  type: str
38
38
  state:
39
39
  description:
40
- - Whether to install (C(present), C(latest)), or remove (C(absent)) a package.
41
- - Default is C(None), however in effect the default action is C(present) unless the C(autoremove) option is
42
- enabled for this module, then C(absent) is inferred.
40
+ - Whether to install (V(present), V(latest)), or remove (V(absent)) a package.
41
+ - Default is V(None), however in effect the default action is V(present) unless the V(autoremove) option is
42
+ enabled for this module, then V(absent) is inferred.
43
43
  choices: ['absent', 'present', 'installed', 'removed', 'latest']
44
44
  type: str
45
45
  enablerepo:
@@ -65,7 +65,7 @@ options:
65
65
  disable_gpg_check:
66
66
  description:
67
67
  - Whether to disable the GPG checking of signatures of packages being
68
- installed. Has an effect only if state is I(present) or I(latest).
68
+ installed. Has an effect only if O(state) is V(present) or V(latest).
69
69
  - This setting affects packages installed from a repository as well as
70
70
  "local" packages installed from the filesystem or a URL.
71
71
  type: bool
@@ -83,9 +83,9 @@ options:
83
83
  type: str
84
84
  autoremove:
85
85
  description:
86
- - If C(true), removes all "leaf" packages from the system that were originally
86
+ - If V(true), removes all "leaf" packages from the system that were originally
87
87
  installed as dependencies of user-installed packages but which are no longer
88
- required by any such package. Should be used alone or when state is I(absent)
88
+ required by any such package. Should be used alone or when O(state) is V(absent)
89
89
  type: bool
90
90
  default: "no"
91
91
  exclude:
@@ -104,25 +104,25 @@ options:
104
104
  update_cache:
105
105
  description:
106
106
  - Force dnf to check if cache is out of date and redownload if needed.
107
- Has an effect only if state is I(present) or I(latest).
107
+ Has an effect only if O(state) is V(present) or V(latest).
108
108
  type: bool
109
109
  default: "no"
110
110
  aliases: [ expire-cache ]
111
111
  update_only:
112
112
  description:
113
113
  - When using latest, only update installed packages. Do not install packages.
114
- - Has an effect only if state is I(latest)
114
+ - Has an effect only if O(state) is V(latest)
115
115
  default: "no"
116
116
  type: bool
117
117
  security:
118
118
  description:
119
- - If set to C(true), and C(state=latest) then only installs updates that have been marked security related.
119
+ - If set to V(true), and O(state=latest) then only installs updates that have been marked security related.
120
120
  - Note that, similar to C(dnf upgrade-minimal), this filter applies to dependencies as well.
121
121
  type: bool
122
122
  default: "no"
123
123
  bugfix:
124
124
  description:
125
- - If set to C(true), and C(state=latest) then only installs updates that have been marked bugfix related.
125
+ - If set to V(true), and O(state=latest) then only installs updates that have been marked bugfix related.
126
126
  - Note that, similar to C(dnf upgrade-minimal), this filter applies to dependencies as well.
127
127
  default: "no"
128
128
  type: bool
@@ -145,20 +145,20 @@ options:
145
145
  disable_excludes:
146
146
  description:
147
147
  - Disable the excludes defined in DNF config files.
148
- - If set to C(all), disables all excludes.
149
- - If set to C(main), disable excludes defined in [main] in dnf.conf.
150
- - If set to C(repoid), disable excludes defined for given repo id.
148
+ - If set to V(all), disables all excludes.
149
+ - If set to V(main), disable excludes defined in [main] in dnf.conf.
150
+ - If set to V(repoid), disable excludes defined for given repo id.
151
151
  type: str
152
152
  validate_certs:
153
153
  description:
154
154
  - This is effectively a no-op in the dnf5 module as dnf5 itself handles downloading a https url as the source of the rpm,
155
- but is an accepted parameter for feature parity/compatibility with the I(yum) module.
155
+ but is an accepted parameter for feature parity/compatibility with the M(ansible.builtin.yum) module.
156
156
  type: bool
157
157
  default: "yes"
158
158
  sslverify:
159
159
  description:
160
160
  - Disables SSL validation of the repository server for this transaction.
161
- - This should be set to C(false) if one of the configured repositories is using an untrusted or self-signed certificate.
161
+ - This should be set to V(false) if one of the configured repositories is using an untrusted or self-signed certificate.
162
162
  type: bool
163
163
  default: "yes"
164
164
  allow_downgrade:
@@ -176,7 +176,7 @@ options:
176
176
  install_repoquery:
177
177
  description:
178
178
  - This is effectively a no-op in DNF as it is not needed with DNF, but is an accepted parameter for feature
179
- parity/compatibility with the I(yum) module.
179
+ parity/compatibility with the M(ansible.builtin.yum) module.
180
180
  type: bool
181
181
  default: "yes"
182
182
  download_only:
@@ -199,11 +199,11 @@ options:
199
199
  download_dir:
200
200
  description:
201
201
  - Specifies an alternate directory to store packages.
202
- - Has an effect only if I(download_only) is specified.
202
+ - Has an effect only if O(download_only) is specified.
203
203
  type: str
204
204
  allowerasing:
205
205
  description:
206
- - If C(true) it allows erasing of installed packages to resolve dependencies.
206
+ - If V(true) it allows erasing of installed packages to resolve dependencies.
207
207
  required: false
208
208
  type: bool
209
209
  default: "no"
@@ -39,7 +39,7 @@ attributes:
39
39
  support: full
40
40
  platforms: debian
41
41
  notes:
42
- - This module won't cause any packages to be installed/removed/purged, use the C(apt) module for that.
42
+ - This module will not cause any packages to be installed/removed/purged, use the M(ansible.builtin.apt) module for that.
43
43
  '''
44
44
  EXAMPLES = '''
45
45
  - name: Prevent python from being upgraded
@@ -54,6 +54,7 @@ EXAMPLES = '''
54
54
  '''
55
55
 
56
56
  from ansible.module_utils.basic import AnsibleModule
57
+ from ansible.module_utils.common.locale import get_best_parsable_locale
57
58
 
58
59
 
59
60
  def main():
@@ -67,12 +68,18 @@ def main():
67
68
 
68
69
  dpkg = module.get_bin_path('dpkg', True)
69
70
 
71
+ locale = get_best_parsable_locale(module)
72
+ DPKG_ENV = dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale, LC_CTYPE=locale)
73
+ module.run_command_environ_update = DPKG_ENV
74
+
70
75
  name = module.params['name']
71
76
  selection = module.params['selection']
72
77
 
73
78
  # Get current settings.
74
79
  rc, out, err = module.run_command([dpkg, '--get-selections', name], check_rc=True)
75
- if not out:
80
+ if 'no packages found matching' in err:
81
+ module.fail_json(msg="Failed to find package '%s' to perform selection '%s'." % (name, selection))
82
+ elif not out:
76
83
  current = 'not present'
77
84
  else:
78
85
  current = out.split()[1]
ansible/modules/expect.py CHANGED
@@ -13,7 +13,7 @@ module: expect
13
13
  version_added: '2.0'
14
14
  short_description: Executes a command and responds to prompts
15
15
  description:
16
- - The C(expect) module executes a command and responds to prompts.
16
+ - The M(ansible.builtin.expect) module executes a command and responds to prompts.
17
17
  - The given command will be executed on all selected nodes. It will not be
18
18
  processed through the shell, so variables like C($HOME) and operations
19
19
  like C("<"), C(">"), C("|"), and C("&") will not work.
@@ -46,7 +46,7 @@ options:
46
46
  type: int
47
47
  description:
48
48
  - Amount of time in seconds to wait for the expected strings. Use
49
- C(null) to disable timeout.
49
+ V(null) to disable timeout.
50
50
  default: 30
51
51
  echo:
52
52
  description:
@@ -69,7 +69,7 @@ notes:
69
69
  - If you want to run a command through the shell (say you are using C(<),
70
70
  C(>), C(|), and so on), you must specify a shell in the command such as
71
71
  C(/bin/bash -c "/path/to/something | grep else").
72
- - The question, or key, under I(responses) is a python regex match. Case
72
+ - The question, or key, under O(responses) is a python regex match. Case
73
73
  insensitive searches are indicated with a prefix of C(?i).
74
74
  - The C(pexpect) library used by this module operates with a search window
75
75
  of 2000 bytes, and does not use a multiline regex match. To perform a
@@ -121,7 +121,7 @@ except ImportError:
121
121
  HAS_PEXPECT = False
122
122
 
123
123
  from ansible.module_utils.basic import AnsibleModule, missing_required_lib
124
- from ansible.module_utils._text import to_bytes, to_native
124
+ from ansible.module_utils.common.text.converters import to_bytes, to_native
125
125
 
126
126
 
127
127
  def response_closure(module, question, responses):
ansible/modules/fetch.py CHANGED
@@ -16,7 +16,7 @@ short_description: Fetch files from remote nodes
16
16
  description:
17
17
  - This module works like M(ansible.builtin.copy), but in reverse.
18
18
  - It is used for fetching files from remote machines and storing them locally in a file tree, organized by hostname.
19
- - Files that already exist at I(dest) will be overwritten if they are different than the I(src).
19
+ - Files that already exist at O(dest) will be overwritten if they are different than the O(src).
20
20
  - This module is also supported for Windows targets.
21
21
  version_added: '0.2'
22
22
  options:
@@ -29,16 +29,16 @@ options:
29
29
  dest:
30
30
  description:
31
31
  - A directory to save the file into.
32
- - For example, if the I(dest) directory is C(/backup) a I(src) file named C(/etc/profile) on host
32
+ - For example, if the O(dest) directory is C(/backup) a O(src) file named C(/etc/profile) on host
33
33
  C(host.example.com), would be saved into C(/backup/host.example.com/etc/profile).
34
34
  The host name is based on the inventory name.
35
35
  required: yes
36
36
  fail_on_missing:
37
37
  version_added: '1.1'
38
38
  description:
39
- - When set to C(true), the task will fail if the remote file cannot be read for any reason.
39
+ - When set to V(true), the task will fail if the remote file cannot be read for any reason.
40
40
  - Prior to Ansible 2.5, setting this would only fail if the source file was missing.
41
- - The default was changed to C(true) in Ansible 2.5.
41
+ - The default was changed to V(true) in Ansible 2.5.
42
42
  type: bool
43
43
  default: yes
44
44
  validate_checksum:
@@ -51,7 +51,7 @@ options:
51
51
  version_added: '1.2'
52
52
  description:
53
53
  - Allows you to override the default behavior of appending hostname/path/to/file to the destination.
54
- - If C(dest) ends with '/', it will use the basename of the source file, similar to the copy module.
54
+ - If O(dest) ends with '/', it will use the basename of the source file, similar to the copy module.
55
55
  - This can be useful if working with a single host, or if retrieving files that are uniquely named per host.
56
56
  - If using multiple hosts with the same filename, the file will be overwritten for each host.
57
57
  type: bool
@@ -85,10 +85,10 @@ notes:
85
85
  remote or local hosts causing a C(MemoryError). Due to this it is
86
86
  advisable to run this module without C(become) whenever possible.
87
87
  - Prior to Ansible 2.5 this module would not fail if reading the remote
88
- file was impossible unless C(fail_on_missing) was set.
88
+ file was impossible unless O(fail_on_missing) was set.
89
89
  - In Ansible 2.5 or later, playbook authors are encouraged to use
90
90
  C(fail_when) or C(ignore_errors) to get this ability. They may
91
- also explicitly set C(fail_on_missing) to C(false) to get the
91
+ also explicitly set O(fail_on_missing) to V(false) to get the
92
92
  non-failing behaviour.
93
93
  seealso:
94
94
  - module: ansible.builtin.copy
ansible/modules/file.py CHANGED
@@ -17,7 +17,7 @@ extends_documentation_fragment: [files, action_common_attributes]
17
17
  description:
18
18
  - Set attributes of files, directories, or symlinks and their targets.
19
19
  - Alternatively, remove files, symlinks or directories.
20
- - Many other modules support the same options as the C(file) module - including M(ansible.builtin.copy),
20
+ - Many other modules support the same options as the M(ansible.builtin.file) module - including M(ansible.builtin.copy),
21
21
  M(ansible.builtin.template), and M(ansible.builtin.assemble).
22
22
  - For Windows targets, use the M(ansible.windows.win_file) module instead.
23
23
  options:
@@ -29,35 +29,35 @@ options:
29
29
  aliases: [ dest, name ]
30
30
  state:
31
31
  description:
32
- - If C(absent), directories will be recursively deleted, and files or symlinks will
32
+ - If V(absent), directories will be recursively deleted, and files or symlinks will
33
33
  be unlinked. In the case of a directory, if C(diff) is declared, you will see the files and folders deleted listed
34
- under C(path_contents). Note that C(absent) will not cause C(file) to fail if the C(path) does
34
+ under C(path_contents). Note that V(absent) will not cause M(ansible.builtin.file) to fail if the O(path) does
35
35
  not exist as the state did not change.
36
- - If C(directory), all intermediate subdirectories will be created if they
36
+ - If V(directory), all intermediate subdirectories will be created if they
37
37
  do not exist. Since Ansible 1.7 they will be created with the supplied permissions.
38
- - If C(file), with no other options, returns the current state of C(path).
39
- - If C(file), even with other options (such as C(mode)), the file will be modified if it exists but will NOT be created if it does not exist.
40
- Set to C(touch) or use the M(ansible.builtin.copy) or M(ansible.builtin.template) module if you want to create the file if it does not exist.
41
- - If C(hard), the hard link will be created or changed.
42
- - If C(link), the symbolic link will be created or changed.
43
- - If C(touch) (new in 1.4), an empty file will be created if the file does not
38
+ - If V(file), with no other options, returns the current state of C(path).
39
+ - If V(file), even with other options (such as O(mode)), the file will be modified if it exists but will NOT be created if it does not exist.
40
+ Set to V(touch) or use the M(ansible.builtin.copy) or M(ansible.builtin.template) module if you want to create the file if it does not exist.
41
+ - If V(hard), the hard link will be created or changed.
42
+ - If V(link), the symbolic link will be created or changed.
43
+ - If V(touch) (new in 1.4), an empty file will be created if the file does not
44
44
  exist, while an existing file or directory will receive updated file access and
45
- modification times (similar to the way C(touch) works from the command line).
46
- - Default is the current state of the file if it exists, C(directory) if C(recurse=yes), or C(file) otherwise.
45
+ modification times (similar to the way V(touch) works from the command line).
46
+ - Default is the current state of the file if it exists, V(directory) if O(recurse=yes), or V(file) otherwise.
47
47
  type: str
48
48
  choices: [ absent, directory, file, hard, link, touch ]
49
49
  src:
50
50
  description:
51
51
  - Path of the file to link to.
52
- - This applies only to C(state=link) and C(state=hard).
53
- - For C(state=link), this will also accept a non-existing path.
54
- - Relative paths are relative to the file being created (C(path)) which is how
52
+ - This applies only to O(state=link) and O(state=hard).
53
+ - For O(state=link), this will also accept a non-existing path.
54
+ - Relative paths are relative to the file being created (O(path)) which is how
55
55
  the Unix command C(ln -s SRC DEST) treats relative paths.
56
56
  type: path
57
57
  recurse:
58
58
  description:
59
59
  - Recursively set the specified file attributes on directory contents.
60
- - This applies only when C(state) is set to C(directory).
60
+ - This applies only when O(state) is set to V(directory).
61
61
  type: bool
62
62
  default: no
63
63
  version_added: '1.1'
@@ -66,27 +66,27 @@ options:
66
66
  - >
67
67
  Force the creation of the symlinks in two cases: the source file does
68
68
  not exist (but will appear later); the destination exists and is a file (so, we need to unlink the
69
- C(path) file and create symlink to the C(src) file in place of it).
69
+ O(path) file and create symlink to the O(src) file in place of it).
70
70
  type: bool
71
71
  default: no
72
72
  follow:
73
73
  description:
74
74
  - This flag indicates that filesystem links, if they exist, should be followed.
75
- - I(follow=yes) and I(state=link) can modify I(src) when combined with parameters such as I(mode).
76
- - Previous to Ansible 2.5, this was C(false) by default.
75
+ - O(follow=yes) and O(state=link) can modify O(src) when combined with parameters such as O(mode).
76
+ - Previous to Ansible 2.5, this was V(false) by default.
77
77
  type: bool
78
78
  default: yes
79
79
  version_added: '1.8'
80
80
  modification_time:
81
81
  description:
82
82
  - This parameter indicates the time the file's modification time should be set to.
83
- - Should be C(preserve) when no modification is required, C(YYYYMMDDHHMM.SS) when using default time format, or C(now).
84
- - Default is None meaning that C(preserve) is the default for C(state=[file,directory,link,hard]) and C(now) is default for C(state=touch).
83
+ - Should be V(preserve) when no modification is required, C(YYYYMMDDHHMM.SS) when using default time format, or V(now).
84
+ - Default is None meaning that V(preserve) is the default for O(state=[file,directory,link,hard]) and V(now) is default for O(state=touch).
85
85
  type: str
86
86
  version_added: "2.7"
87
87
  modification_time_format:
88
88
  description:
89
- - When used with C(modification_time), indicates the time format that must be used.
89
+ - When used with O(modification_time), indicates the time format that must be used.
90
90
  - Based on default Python format (see time.strftime doc).
91
91
  type: str
92
92
  default: "%Y%m%d%H%M.%S"
@@ -94,13 +94,13 @@ options:
94
94
  access_time:
95
95
  description:
96
96
  - This parameter indicates the time the file's access time should be set to.
97
- - Should be C(preserve) when no modification is required, C(YYYYMMDDHHMM.SS) when using default time format, or C(now).
98
- - Default is C(None) meaning that C(preserve) is the default for C(state=[file,directory,link,hard]) and C(now) is default for C(state=touch).
97
+ - Should be V(preserve) when no modification is required, C(YYYYMMDDHHMM.SS) when using default time format, or V(now).
98
+ - Default is V(None) meaning that V(preserve) is the default for O(state=[file,directory,link,hard]) and V(now) is default for O(state=touch).
99
99
  type: str
100
100
  version_added: '2.7'
101
101
  access_time_format:
102
102
  description:
103
- - When used with C(access_time), indicates the time format that must be used.
103
+ - When used with O(access_time), indicates the time format that must be used.
104
104
  - Based on default Python format (see time.strftime doc).
105
105
  type: str
106
106
  default: "%Y%m%d%H%M.%S"
@@ -216,13 +216,13 @@ EXAMPLES = r'''
216
216
  '''
217
217
  RETURN = r'''
218
218
  dest:
219
- description: Destination file/path, equal to the value passed to I(path).
220
- returned: state=touch, state=hard, state=link
219
+ description: Destination file/path, equal to the value passed to O(path).
220
+ returned: O(state=touch), O(state=hard), O(state=link)
221
221
  type: str
222
222
  sample: /path/to/file.txt
223
223
  path:
224
- description: Destination file/path, equal to the value passed to I(path).
225
- returned: state=absent, state=directory, state=file
224
+ description: Destination file/path, equal to the value passed to O(path).
225
+ returned: O(state=absent), O(state=directory), O(state=file)
226
226
  type: str
227
227
  sample: /path/to/file.txt
228
228
  '''
@@ -237,7 +237,7 @@ from pwd import getpwnam, getpwuid
237
237
  from grp import getgrnam, getgrgid
238
238
 
239
239
  from ansible.module_utils.basic import AnsibleModule
240
- from ansible.module_utils._text import to_bytes, to_native
240
+ from ansible.module_utils.common.text.converters import to_bytes, to_native
241
241
 
242
242
 
243
243
  # There will only be a single AnsibleModule object per module