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
@@ -39,7 +39,7 @@ options:
39
39
  path:
40
40
  description:
41
41
  - The file to modify.
42
- - Before Ansible 2.3 this option was only usable as I(dest), I(destfile) and I(name).
42
+ - Before Ansible 2.3 this option was only usable as O(dest), O(destfile) and O(name).
43
43
  type: path
44
44
  required: true
45
45
  aliases: [ dest, destfile, name ]
@@ -48,13 +48,13 @@ options:
48
48
  - The regular expression to look for in the contents of the file.
49
49
  - Uses Python regular expressions; see
50
50
  U(https://docs.python.org/3/library/re.html).
51
- - Uses MULTILINE mode, which means C(^) and C($) match the beginning
51
+ - Uses MULTILINE mode, which means V(^) and V($) match the beginning
52
52
  and end of the file, as well as the beginning and end respectively
53
53
  of I(each line) of the file.
54
- - Does not use DOTALL, which means the C(.) special character matches
54
+ - Does not use DOTALL, which means the V(.) special character matches
55
55
  any character I(except newlines). A common mistake is to assume that
56
- a negated character set like C([^#]) will also not match newlines.
57
- - In order to exclude newlines, they must be added to the set like C([^#\n]).
56
+ a negated character set like V([^#]) will also not match newlines.
57
+ - In order to exclude newlines, they must be added to the set like V([^#\\n]).
58
58
  - Note that, as of Ansible 2.0, short form tasks should have any escape
59
59
  sequences backslash-escaped in order to prevent them being parsed
60
60
  as string literal escapes. See the examples.
@@ -65,25 +65,25 @@ options:
65
65
  - The string to replace regexp matches.
66
66
  - May contain backreferences that will get expanded with the regexp capture groups if the regexp matches.
67
67
  - If not set, matches are removed entirely.
68
- - Backreferences can be used ambiguously like C(\1), or explicitly like C(\g<1>).
68
+ - Backreferences can be used ambiguously like V(\\1), or explicitly like V(\\g<1>).
69
69
  type: str
70
70
  default: ''
71
71
  after:
72
72
  description:
73
73
  - If specified, only content after this match will be replaced/removed.
74
- - Can be used in combination with C(before).
74
+ - Can be used in combination with O(before).
75
75
  - Uses Python regular expressions; see
76
76
  U(https://docs.python.org/3/library/re.html).
77
- - Uses DOTALL, which means the C(.) special character I(can match newlines).
77
+ - Uses DOTALL, which means the V(.) special character I(can match newlines).
78
78
  type: str
79
79
  version_added: "2.4"
80
80
  before:
81
81
  description:
82
82
  - If specified, only content before this match will be replaced/removed.
83
- - Can be used in combination with C(after).
83
+ - Can be used in combination with O(after).
84
84
  - Uses Python regular expressions; see
85
85
  U(https://docs.python.org/3/library/re.html).
86
- - Uses DOTALL, which means the C(.) special character I(can match newlines).
86
+ - Uses DOTALL, which means the V(.) special character I(can match newlines).
87
87
  type: str
88
88
  version_added: "2.4"
89
89
  backup:
@@ -103,11 +103,12 @@ options:
103
103
  default: utf-8
104
104
  version_added: "2.4"
105
105
  notes:
106
- - As of Ansible 2.3, the I(dest) option has been changed to I(path) as default, but I(dest) still works as well.
107
- - As of Ansible 2.7.10, the combined use of I(before) and I(after) works properly. If you were relying on the
106
+ - As of Ansible 2.3, the O(dest) option has been changed to O(path) as default, but O(dest) still works as well.
107
+ - As of Ansible 2.7.10, the combined use of O(before) and O(after) works properly. If you were relying on the
108
108
  previous incorrect behavior, you may be need to adjust your tasks.
109
109
  See U(https://github.com/ansible/ansible/issues/31354) for details.
110
- - Option I(follow) has been removed in Ansible 2.5, because this module modifies the contents of the file so I(follow=no) doesn't make sense.
110
+ - Option O(ignore:follow) has been removed in Ansible 2.5, because this module modifies the contents of the file
111
+ so O(ignore:follow=no) does not make sense.
111
112
  '''
112
113
 
113
114
  EXAMPLES = r'''
@@ -185,7 +186,7 @@ import re
185
186
  import tempfile
186
187
  from traceback import format_exc
187
188
 
188
- from ansible.module_utils._text import to_text, to_bytes
189
+ from ansible.module_utils.common.text.converters import to_text, to_bytes
189
190
  from ansible.module_utils.basic import AnsibleModule
190
191
 
191
192
 
@@ -284,7 +285,11 @@ def main():
284
285
  section = contents
285
286
 
286
287
  mre = re.compile(params['regexp'], re.MULTILINE)
287
- result = re.subn(mre, params['replace'], section, 0)
288
+ try:
289
+ result = re.subn(mre, params['replace'], section, 0)
290
+ except re.error as e:
291
+ module.fail_json(msg="Unable to process replace due to error: %s" % to_text(e),
292
+ exception=format_exc())
288
293
 
289
294
  if result[1] > 0 and section != result[0]:
290
295
  if pattern:
@@ -33,7 +33,7 @@ options:
33
33
  choices: [ absent, present ]
34
34
  validate_certs:
35
35
  description:
36
- - If C(false) and the C(key) is a url starting with https, SSL certificates will not be validated.
36
+ - If V(false) and the O(key) is a url starting with V(https), SSL certificates will not be validated.
37
37
  - This should only be used on personally controlled sites using self-signed certificates.
38
38
  type: bool
39
39
  default: 'yes'
@@ -85,7 +85,7 @@ import tempfile
85
85
  # import module snippets
86
86
  from ansible.module_utils.basic import AnsibleModule
87
87
  from ansible.module_utils.urls import fetch_url
88
- from ansible.module_utils._text import to_native
88
+ from ansible.module_utils.common.text.converters import to_native
89
89
 
90
90
 
91
91
  def is_pubkey(string):
ansible/modules/script.py CHANGED
@@ -11,16 +11,17 @@ module: script
11
11
  version_added: "0.9"
12
12
  short_description: Runs a local script on a remote node after transferring it
13
13
  description:
14
- - The C(script) module takes the script name followed by a list of space-delimited arguments.
15
- - Either a free form command or C(cmd) parameter is required, see the examples.
16
- - The local script at path will be transferred to the remote node and then executed.
14
+ - The M(ansible.builtin.script) module takes the script name followed by a list of space-delimited arguments.
15
+ - Either a free-form command or O(cmd) parameter is required, see the examples.
16
+ - The local script at the path will be transferred to the remote node and then executed.
17
17
  - The given script will be processed through the shell environment on the remote node.
18
- - This module does not require python on the remote system, much like the M(ansible.builtin.raw) module.
18
+ - This module does not require Python on the remote system, much like the M(ansible.builtin.raw) module.
19
19
  - This module is also supported for Windows targets.
20
20
  options:
21
21
  free_form:
22
22
  description:
23
23
  - Path to the local script file followed by optional arguments.
24
+ type: str
24
25
  cmd:
25
26
  type: str
26
27
  description:
@@ -29,25 +30,30 @@ options:
29
30
  description:
30
31
  - A filename on the remote node, when it already exists, this step will B(not) be run.
31
32
  version_added: "1.5"
33
+ type: str
32
34
  removes:
33
35
  description:
34
36
  - A filename on the remote node, when it does not exist, this step will B(not) be run.
35
37
  version_added: "1.5"
38
+ type: str
36
39
  chdir:
37
40
  description:
38
41
  - Change into this directory on the remote node before running the script.
39
42
  version_added: "2.4"
43
+ type: str
40
44
  executable:
41
45
  description:
42
- - Name or path of a executable to invoke the script with.
46
+ - Name or path of an executable to invoke the script with.
43
47
  version_added: "2.6"
48
+ type: str
44
49
  notes:
45
50
  - It is usually preferable to write Ansible modules rather than pushing scripts. Convert your script to an Ansible module for bonus points!
46
- - The C(ssh) connection plugin will force pseudo-tty allocation via C(-tt) when scripts are executed. Pseudo-ttys do not have a stderr channel and all
47
- stderr is sent to stdout. If you depend on separated stdout and stderr result keys, please switch to a copy+command set of tasks instead of using script.
51
+ - The P(ansible.builtin.ssh#connection) connection plugin will force pseudo-tty allocation via C(-tt) when scripts are executed.
52
+ Pseudo-ttys do not have a stderr channel and all stderr is sent to stdout. If you depend on separated stdout and stderr result keys,
53
+ please switch to a set of tasks that comprises M(ansible.builtin.copy) with M(ansible.builtin.command) instead of using M(ansible.builtin.script).
48
54
  - If the path to the local script contains spaces, it needs to be quoted.
49
55
  - This module is also supported for Windows targets.
50
- - If the script returns non UTF-8 data, it must be encoded to avoid issues. One option is to pipe
56
+ - If the script returns non-UTF-8 data, it must be encoded to avoid issues. One option is to pipe
51
57
  the output through C(base64).
52
58
  seealso:
53
59
  - module: ansible.builtin.shell
@@ -63,7 +69,7 @@ extends_documentation_fragment:
63
69
  attributes:
64
70
  check_mode:
65
71
  support: partial
66
- details: while the script itself is arbitrary and cannot be subject to the check mode semantics it adds C(creates)/C(removes) options as a workaround
72
+ details: while the script itself is arbitrary and cannot be subject to the check mode semantics it adds O(creates)/O(removes) options as a workaround
67
73
  diff_mode:
68
74
  support: none
69
75
  platform:
@@ -105,6 +111,6 @@ EXAMPLES = r'''
105
111
  args:
106
112
  executable: python3
107
113
 
108
- - name: Run a Powershell script on a windows host
114
+ - name: Run a Powershell script on a Windows host
109
115
  script: subdirectories/under/path/with/your/playbook/script.ps1
110
116
  '''
@@ -21,8 +21,8 @@ description:
21
21
  - This module is a proxy for multiple more specific service manager modules
22
22
  (such as M(ansible.builtin.systemd) and M(ansible.builtin.sysvinit)).
23
23
  This allows management of a heterogeneous environment of machines without creating a specific task for
24
- each service manager. The module to be executed is determined by the I(use) option, which defaults to the
25
- service manager discovered by M(ansible.builtin.setup). If C(setup) was not yet run, this module may run it.
24
+ each service manager. The module to be executed is determined by the O(use) option, which defaults to the
25
+ service manager discovered by M(ansible.builtin.setup). If M(ansible.builtin.setup) was not yet run, this module may run it.
26
26
  - For Windows targets, use the M(ansible.windows.win_service) module instead.
27
27
  options:
28
28
  name:
@@ -32,10 +32,10 @@ options:
32
32
  required: true
33
33
  state:
34
34
  description:
35
- - C(started)/C(stopped) are idempotent actions that will not run
35
+ - V(started)/V(stopped) are idempotent actions that will not run
36
36
  commands unless necessary.
37
- - C(restarted) will always bounce the service.
38
- - C(reloaded) will always reload.
37
+ - V(restarted) will always bounce the service.
38
+ - V(reloaded) will always reload.
39
39
  - B(At least one of state and enabled are required.)
40
40
  - Note that reloaded will start the service if it is not already started,
41
41
  even if your chosen init system wouldn't normally.
@@ -43,7 +43,7 @@ options:
43
43
  choices: [ reloaded, restarted, started, stopped ]
44
44
  sleep:
45
45
  description:
46
- - If the service is being C(restarted) then sleep this many seconds
46
+ - If the service is being V(restarted) then sleep this many seconds
47
47
  between the stop and start command.
48
48
  - This helps to work around badly-behaving init scripts that exit immediately
49
49
  after signaling a process to stop.
@@ -82,6 +82,7 @@ options:
82
82
  description:
83
83
  - The service module actually uses system specific modules, normally through auto detection, this setting can force a specific module.
84
84
  - Normally it uses the value of the 'ansible_service_mgr' fact and falls back to the old 'service' module when none matching is found.
85
+ - The 'old service module' still uses autodetection and in no way does it correspond to the C(service) command.
85
86
  type: str
86
87
  default: auto
87
88
  version_added: 2.2
@@ -106,6 +107,9 @@ attributes:
106
107
  platforms: all
107
108
  notes:
108
109
  - For AIX, group subsystem names can be used.
110
+ - The C(service) command line utility is not part of any service manager system but a convenience.
111
+ It does not have a standard implementation across systems, and this action cannot use it directly.
112
+ Though it might be used if found in certain circumstances, the detected system service manager is normally preferred.
109
113
  seealso:
110
114
  - module: ansible.windows.win_service
111
115
  author:
@@ -172,7 +176,7 @@ import time
172
176
  if platform.system() != 'SunOS':
173
177
  from ansible.module_utils.compat.version import LooseVersion
174
178
 
175
- from ansible.module_utils._text import to_bytes, to_text
179
+ from ansible.module_utils.common.text.converters import to_bytes, to_text
176
180
  from ansible.module_utils.basic import AnsibleModule
177
181
  from ansible.module_utils.common.locale import get_best_parsable_locale
178
182
  from ansible.module_utils.common.sys_info import get_platform_subclass
@@ -1191,107 +1195,31 @@ class OpenBsdService(Service):
1191
1195
  return self.execute_command("%s -f %s" % (self.svc_cmd, self.action))
1192
1196
 
1193
1197
  def service_enable(self):
1198
+
1194
1199
  if not self.enable_cmd:
1195
1200
  return super(OpenBsdService, self).service_enable()
1196
1201
 
1197
- rc, stdout, stderr = self.execute_command("%s %s %s %s" % (self.enable_cmd, 'getdef', self.name, 'flags'))
1198
-
1199
- if stderr:
1200
- self.module.fail_json(msg=stderr)
1201
-
1202
- getdef_string = stdout.rstrip()
1203
-
1204
- # Depending on the service the string returned from 'getdef' may be
1205
- # either a set of flags or the boolean YES/NO
1206
- if getdef_string == "YES" or getdef_string == "NO":
1207
- default_flags = ''
1208
- else:
1209
- default_flags = getdef_string
1210
-
1211
- rc, stdout, stderr = self.execute_command("%s %s %s %s" % (self.enable_cmd, 'get', self.name, 'flags'))
1212
-
1213
- if stderr:
1214
- self.module.fail_json(msg=stderr)
1215
-
1216
- get_string = stdout.rstrip()
1217
-
1218
- # Depending on the service the string returned from 'get' may be
1219
- # either a set of flags or the boolean YES/NO
1220
- if get_string == "YES" or get_string == "NO":
1221
- current_flags = ''
1222
- else:
1223
- current_flags = get_string
1224
-
1225
- # If there are arguments from the user we use these as flags unless
1226
- # they are already set.
1227
- if self.arguments and self.arguments != current_flags:
1228
- changed_flags = self.arguments
1229
- # If the user has not supplied any arguments and the current flags
1230
- # differ from the default we reset them.
1231
- elif not self.arguments and current_flags != default_flags:
1232
- changed_flags = ' '
1233
- # Otherwise there is no need to modify flags.
1234
- else:
1235
- changed_flags = ''
1236
-
1237
1202
  rc, stdout, stderr = self.execute_command("%s %s %s %s" % (self.enable_cmd, 'get', self.name, 'status'))
1238
1203
 
1204
+ status_action = None
1239
1205
  if self.enable:
1240
- if rc == 0 and not changed_flags:
1241
- return
1242
-
1243
1206
  if rc != 0:
1244
- status_action = "set %s status on" % (self.name)
1245
- else:
1246
- status_action = ''
1247
- if changed_flags:
1248
- flags_action = "set %s flags %s" % (self.name, changed_flags)
1249
- else:
1250
- flags_action = ''
1251
- else:
1252
- if rc == 1:
1253
- return
1254
-
1255
- status_action = "set %s status off" % self.name
1256
- flags_action = ''
1257
-
1258
- # Verify state assumption
1259
- if not status_action and not flags_action:
1260
- self.module.fail_json(msg="neither status_action or status_flags is set, this should never happen")
1261
-
1262
- if self.module.check_mode:
1263
- self.module.exit_json(changed=True, msg="changing service enablement")
1264
-
1265
- status_modified = 0
1266
- if status_action:
1267
- rc, stdout, stderr = self.execute_command("%s %s" % (self.enable_cmd, status_action))
1268
-
1269
- if rc != 0:
1270
- if stderr:
1271
- self.module.fail_json(msg=stderr)
1272
- else:
1273
- self.module.fail_json(msg="rcctl failed to modify service status")
1207
+ status_action = "on"
1208
+ elif self.enable is not None:
1209
+ # should be explicit False at this point
1210
+ if rc != 1:
1211
+ status_action = "off"
1274
1212
 
1275
- status_modified = 1
1276
-
1277
- if flags_action:
1278
- rc, stdout, stderr = self.execute_command("%s %s" % (self.enable_cmd, flags_action))
1213
+ if status_action is not None:
1214
+ self.changed = True
1215
+ if not self.module.check_mode:
1216
+ rc, stdout, stderr = self.execute_command("%s set %s status %s" % (self.enable_cmd, self.name, status_action))
1279
1217
 
1280
- if rc != 0:
1281
- if stderr:
1282
- if status_modified:
1283
- error_message = "rcctl modified service status but failed to set flags: " + stderr
1284
- else:
1285
- error_message = stderr
1286
- else:
1287
- if status_modified:
1288
- error_message = "rcctl modified service status but failed to set flags"
1218
+ if rc != 0:
1219
+ if stderr:
1220
+ self.module.fail_json(msg=stderr)
1289
1221
  else:
1290
- error_message = "rcctl failed to modify service flags"
1291
-
1292
- self.module.fail_json(msg=error_message)
1293
-
1294
- self.changed = True
1222
+ self.module.fail_json(msg="rcctl failed to modify service status")
1295
1223
 
1296
1224
 
1297
1225
  class NetBsdService(Service):
@@ -28,7 +28,7 @@ attributes:
28
28
  platform:
29
29
  platforms: posix
30
30
  notes:
31
- - When accessing the C(ansible_facts.services) facts collected by this module,
31
+ - When accessing the RV(ansible_facts.services) facts collected by this module,
32
32
  it is recommended to not use "dot notation" because services can have a C(-)
33
33
  character in their name which would result in invalid "dot notation", such as
34
34
  C(ansible_facts.services.zuul-gateway). It is instead recommended to
@@ -57,19 +57,20 @@ ansible_facts:
57
57
  services:
58
58
  description: States of the services with service name as key.
59
59
  returned: always
60
- type: complex
60
+ type: list
61
+ elements: dict
61
62
  contains:
62
63
  source:
63
64
  description:
64
65
  - Init system of the service.
65
- - One of C(rcctl), C(systemd), C(sysv), C(upstart), C(src).
66
+ - One of V(rcctl), V(systemd), V(sysv), V(upstart), V(src).
66
67
  returned: always
67
68
  type: str
68
69
  sample: sysv
69
70
  state:
70
71
  description:
71
72
  - State of the service.
72
- - 'This commonly includes (but is not limited to) the following: C(failed), C(running), C(stopped) or C(unknown).'
73
+ - 'This commonly includes (but is not limited to) the following: V(failed), V(running), V(stopped) or V(unknown).'
73
74
  - Depending on the used init system additional states might be returned.
74
75
  returned: always
75
76
  type: str
@@ -77,7 +78,7 @@ ansible_facts:
77
78
  status:
78
79
  description:
79
80
  - State of the service.
80
- - Either C(enabled), C(disabled), C(static), C(indirect) or C(unknown).
81
+ - Either V(enabled), V(disabled), V(static), V(indirect) or V(unknown).
81
82
  returned: systemd systems or RedHat/SUSE flavored sysvinit/upstart or OpenBSD
82
83
  type: str
83
84
  sample: enabled
@@ -361,14 +362,31 @@ class OpenBSDScanService(BaseService):
361
362
  svcs.append(svc)
362
363
  return svcs
363
364
 
365
+ def get_info(self, name):
366
+ info = {}
367
+ rc, stdout, stderr = self.module.run_command("%s get %s" % (self.rcctl_path, name))
368
+ if 'needs root privileges' in stderr.lower():
369
+ self.module.warn('rcctl requires root privileges')
370
+ else:
371
+ undy = '%s_' % name
372
+ for variable in stdout.split('\n'):
373
+ if variable == '' or '=' not in variable:
374
+ continue
375
+ else:
376
+ k, v = variable.replace(undy, '', 1).split('=')
377
+ info[k] = v
378
+ return info
379
+
364
380
  def gather_services(self):
365
381
 
366
382
  services = {}
367
383
  self.rcctl_path = self.module.get_bin_path("rcctl")
368
384
  if self.rcctl_path:
369
385
 
386
+ # populate services will all possible
370
387
  for svc in self.query_rcctl('all'):
371
- services[svc] = {'name': svc, 'source': 'rcctl'}
388
+ services[svc] = {'name': svc, 'source': 'rcctl', 'rogue': False}
389
+ services[svc].update(self.get_info(svc))
372
390
 
373
391
  for svc in self.query_rcctl('on'):
374
392
  services[svc].update({'status': 'enabled'})
@@ -376,16 +394,22 @@ class OpenBSDScanService(BaseService):
376
394
  for svc in self.query_rcctl('started'):
377
395
  services[svc].update({'state': 'running'})
378
396
 
379
- # Based on the list of services that are enabled, determine which are disabled
380
- [services[svc].update({'status': 'disabled'}) for svc in services if services[svc].get('status') is None]
381
-
382
- # and do the same for those are aren't running
383
- [services[svc].update({'state': 'stopped'}) for svc in services if services[svc].get('state') is None]
384
-
385
397
  # Override the state for services which are marked as 'failed'
386
398
  for svc in self.query_rcctl('failed'):
387
399
  services[svc].update({'state': 'failed'})
388
400
 
401
+ for svc in services.keys():
402
+ # Based on the list of services that are enabled/failed, determine which are disabled
403
+ if services[svc].get('status') is None:
404
+ services[svc].update({'status': 'disabled'})
405
+
406
+ # and do the same for those are aren't running
407
+ if services[svc].get('state') is None:
408
+ services[svc].update({'state': 'stopped'})
409
+
410
+ for svc in self.query_rcctl('rogue'):
411
+ services[svc]['rogue'] = True
412
+
389
413
  return services
390
414
 
391
415
 
@@ -15,13 +15,13 @@ version_added: "1.2"
15
15
  description:
16
16
  - This action allows setting variables associated to the current host.
17
17
  - These variables will be available to subsequent plays during an ansible-playbook run via the host they were set on.
18
- - Set C(cacheable) to C(true) to save variables across executions using a fact cache.
18
+ - Set O(cacheable) to V(true) to save variables across executions using a fact cache.
19
19
  Variables will keep the set_fact precedence for the current run, but will used 'cached fact' precedence for subsequent ones.
20
20
  - Per the standard Ansible variable precedence rules, other types of variables have a higher priority, so this value may be overridden.
21
21
  options:
22
22
  key_value:
23
23
  description:
24
- - "The C(set_fact) module takes C(key=value) pairs or C(key: value) (YAML notation) as variables to set in the playbook scope.
24
+ - "The M(ansible.builtin.set_fact) module takes C(key=value) pairs or C(key: value) (YAML notation) as variables to set in the playbook scope.
25
25
  The 'key' is the resulting variable name and the value is, of course, the value of said variable."
26
26
  - You can create multiple variables at once, by supplying multiple pairs, but do NOT mix notations.
27
27
  required: true
@@ -28,7 +28,7 @@ options:
28
28
  default: no
29
29
  aggregate:
30
30
  description:
31
- - Whether the provided value is aggregated to the existing stat C(true) or will replace it C(false).
31
+ - Whether the provided value is aggregated to the existing stat V(true) or will replace it V(false).
32
32
  type: bool
33
33
  default: yes
34
34
  extends_documentation_fragment:
@@ -55,7 +55,7 @@ attributes:
55
55
  support: none
56
56
  notes:
57
57
  - In order for custom stats to be displayed, you must set C(show_custom_stats) in section C([defaults]) in C(ansible.cfg)
58
- or by defining environment variable C(ANSIBLE_SHOW_CUSTOM_STATS) to C(true). See the C(default) callback plugin for details.
58
+ or by defining environment variable C(ANSIBLE_SHOW_CUSTOM_STATS) to V(true). See the P(ansible.builtin.default#callback) callback plugin for details.
59
59
  version_added: "2.3"
60
60
  '''
61
61
 
ansible/modules/setup.py CHANGED
@@ -17,24 +17,24 @@ options:
17
17
  version_added: "2.1"
18
18
  description:
19
19
  - "If supplied, restrict the additional facts collected to the given subset.
20
- Possible values: C(all), C(all_ipv4_addresses), C(all_ipv6_addresses), C(apparmor), C(architecture),
21
- C(caps), C(chroot),C(cmdline), C(date_time), C(default_ipv4), C(default_ipv6), C(devices),
22
- C(distribution), C(distribution_major_version), C(distribution_release), C(distribution_version),
23
- C(dns), C(effective_group_ids), C(effective_user_id), C(env), C(facter), C(fips), C(hardware),
24
- C(interfaces), C(is_chroot), C(iscsi), C(kernel), C(local), C(lsb), C(machine), C(machine_id),
25
- C(mounts), C(network), C(ohai), C(os_family), C(pkg_mgr), C(platform), C(processor), C(processor_cores),
26
- C(processor_count), C(python), C(python_version), C(real_user_id), C(selinux), C(service_mgr),
27
- C(ssh_host_key_dsa_public), C(ssh_host_key_ecdsa_public), C(ssh_host_key_ed25519_public),
28
- C(ssh_host_key_rsa_public), C(ssh_host_pub_keys), C(ssh_pub_keys), C(system), C(system_capabilities),
29
- C(system_capabilities_enforced), C(user), C(user_dir), C(user_gecos), C(user_gid), C(user_id),
30
- C(user_shell), C(user_uid), C(virtual), C(virtualization_role), C(virtualization_type).
20
+ Possible values: V(all), V(all_ipv4_addresses), V(all_ipv6_addresses), V(apparmor), V(architecture),
21
+ V(caps), V(chroot),V(cmdline), V(date_time), V(default_ipv4), V(default_ipv6), V(devices),
22
+ V(distribution), V(distribution_major_version), V(distribution_release), V(distribution_version),
23
+ V(dns), V(effective_group_ids), V(effective_user_id), V(env), V(facter), V(fips), V(hardware),
24
+ V(interfaces), V(is_chroot), V(iscsi), V(kernel), V(local), V(lsb), V(machine), V(machine_id),
25
+ V(mounts), V(network), V(ohai), V(os_family), V(pkg_mgr), V(platform), V(processor), V(processor_cores),
26
+ V(processor_count), V(python), V(python_version), V(real_user_id), V(selinux), V(service_mgr),
27
+ V(ssh_host_key_dsa_public), V(ssh_host_key_ecdsa_public), V(ssh_host_key_ed25519_public),
28
+ V(ssh_host_key_rsa_public), V(ssh_host_pub_keys), V(ssh_pub_keys), V(system), V(system_capabilities),
29
+ V(system_capabilities_enforced), V(user), V(user_dir), V(user_gecos), V(user_gid), V(user_id),
30
+ V(user_shell), V(user_uid), V(virtual), V(virtualization_role), V(virtualization_type).
31
31
  Can specify a list of values to specify a larger subset.
32
32
  Values can also be used with an initial C(!) to specify that
33
33
  that specific subset should not be collected. For instance:
34
- C(!hardware,!network,!virtual,!ohai,!facter). If C(!all) is specified
34
+ V(!hardware,!network,!virtual,!ohai,!facter). If V(!all) is specified
35
35
  then only the min subset is collected. To avoid collecting even the
36
- min subset, specify C(!all,!min). To collect only specific facts,
37
- use C(!all,!min), and specify the particular fact subsets.
36
+ min subset, specify V(!all,!min). To collect only specific facts,
37
+ use V(!all,!min), and specify the particular fact subsets.
38
38
  Use the filter parameter if you do not want to display some collected
39
39
  facts."
40
40
  type: list
@@ -64,12 +64,12 @@ options:
64
64
  - Path used for local ansible facts (C(*.fact)) - files in this dir
65
65
  will be run (if executable) and their results be added to C(ansible_local) facts.
66
66
  If a file is not executable it is read instead.
67
- File/results format can be JSON or INI-format. The default C(fact_path) can be
67
+ File/results format can be JSON or INI-format. The default O(fact_path) can be
68
68
  specified in C(ansible.cfg) for when setup is automatically called as part of
69
69
  C(gather_facts).
70
70
  NOTE - For windows clients, the results will be added to a variable named after the
71
71
  local file (without extension suffix), rather than C(ansible_local).
72
- - Since Ansible 2.1, Windows hosts can use C(fact_path). Make sure that this path
72
+ - Since Ansible 2.1, Windows hosts can use O(fact_path). Make sure that this path
73
73
  exists on the target host. Files in this path MUST be PowerShell scripts C(.ps1)
74
74
  which outputs an object. This object will be formatted by Ansible as json so the
75
75
  script should be outputting a raw hashtable, array, or other primitive object.
@@ -104,7 +104,7 @@ notes:
104
104
  remote systems. (See also M(community.general.facter) and M(community.general.ohai).)
105
105
  - The filter option filters only the first level subkey below ansible_facts.
106
106
  - If the target host is Windows, you will not currently have the ability to use
107
- C(filter) as this is provided by a simpler implementation of the module.
107
+ O(filter) as this is provided by a simpler implementation of the module.
108
108
  - This module should be run with elevated privileges on BSD systems to gather facts like ansible_product_version.
109
109
  - For more information about delegated facts,
110
110
  please check U(https://docs.ansible.com/ansible/latest/user_guide/playbooks_delegation.html#delegating-facts).
@@ -174,7 +174,7 @@ EXAMPLES = r"""
174
174
  # import module snippets
175
175
  from ..module_utils.basic import AnsibleModule
176
176
 
177
- from ansible.module_utils._text import to_text
177
+ from ansible.module_utils.common.text.converters import to_text
178
178
  from ansible.module_utils.facts import ansible_collector, default_collectors
179
179
  from ansible.module_utils.facts.collector import CollectorNotFoundError, CycleFoundInFactDeps, UnresolvedFactDep
180
180
  from ansible.module_utils.facts.namespace import PrefixFactNamespace
ansible/modules/shell.py CHANGED
@@ -16,8 +16,8 @@ DOCUMENTATION = r'''
16
16
  module: shell
17
17
  short_description: Execute shell commands on targets
18
18
  description:
19
- - The C(shell) module takes the command name followed by a list of space-delimited arguments.
20
- - Either a free form command or C(cmd) parameter is required, see the examples.
19
+ - The M(ansible.builtin.shell) module takes the command name followed by a list of space-delimited arguments.
20
+ - Either a free form command or O(cmd) parameter is required, see the examples.
21
21
  - It is almost exactly like the M(ansible.builtin.command) module but runs
22
22
  the command through a shell (C(/bin/sh)) on the remote node.
23
23
  - For Windows targets, use the M(ansible.windows.win_shell) module instead.
@@ -69,7 +69,7 @@ extends_documentation_fragment:
69
69
  - action_common_attributes.raw
70
70
  attributes:
71
71
  check_mode:
72
- details: while the command itself is arbitrary and cannot be subject to the check mode semantics it adds C(creates)/C(removes) options as a workaround
72
+ details: while the command itself is arbitrary and cannot be subject to the check mode semantics it adds O(creates)/O(removes) options as a workaround
73
73
  support: partial
74
74
  diff_mode:
75
75
  support: none