ansible-core 2.17.4__py3-none-any.whl → 2.18.0b1__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 (320) hide show
  1. ansible/__main__.py +2 -17
  2. ansible/cli/__init__.py +3 -15
  3. ansible/cli/config.py +187 -24
  4. ansible/cli/console.py +1 -1
  5. ansible/cli/doc.py +38 -16
  6. ansible/cli/galaxy.py +30 -53
  7. ansible/cli/inventory.py +2 -2
  8. ansible/cli/pull.py +2 -2
  9. ansible/cli/scripts/ansible_connection_cli_stub.py +1 -10
  10. ansible/config/base.yml +127 -57
  11. ansible/config/manager.py +89 -11
  12. ansible/constants.py +32 -9
  13. ansible/errors/__init__.py +5 -0
  14. ansible/executor/interpreter_discovery.py +1 -1
  15. ansible/executor/play_iterator.py +16 -0
  16. ansible/executor/playbook_executor.py +1 -4
  17. ansible/executor/powershell/become_wrapper.ps1 +4 -5
  18. ansible/executor/powershell/bootstrap_wrapper.ps1 +2 -3
  19. ansible/executor/powershell/exec_wrapper.ps1 +1 -1
  20. ansible/executor/powershell/module_manifest.py +2 -2
  21. ansible/executor/task_executor.py +50 -39
  22. ansible/executor/task_queue_manager.py +1 -1
  23. ansible/executor/task_result.py +1 -1
  24. ansible/galaxy/api.py +3 -4
  25. ansible/galaxy/collection/__init__.py +21 -10
  26. ansible/galaxy/collection/concrete_artifact_manager.py +2 -2
  27. ansible/galaxy/collection/galaxy_api_proxy.py +10 -16
  28. ansible/galaxy/collection/gpg.py +17 -23
  29. ansible/galaxy/data/COPYING +7 -0
  30. ansible/galaxy/data/apb/Dockerfile.j2 +1 -0
  31. ansible/galaxy/data/apb/Makefile.j2 +1 -0
  32. ansible/galaxy/data/apb/README.md +7 -3
  33. ansible/galaxy/data/apb/apb.yml.j2 +1 -0
  34. ansible/galaxy/data/apb/defaults/main.yml.j2 +1 -0
  35. ansible/galaxy/data/apb/handlers/main.yml.j2 +1 -0
  36. ansible/galaxy/data/apb/meta/main.yml.j2 +1 -0
  37. ansible/galaxy/data/apb/playbooks/deprovision.yml.j2 +1 -0
  38. ansible/galaxy/data/apb/playbooks/provision.yml.j2 +1 -0
  39. ansible/galaxy/data/apb/tasks/main.yml.j2 +1 -0
  40. ansible/galaxy/data/apb/tests/ansible.cfg +1 -0
  41. ansible/galaxy/data/apb/tests/inventory +1 -0
  42. ansible/galaxy/data/apb/tests/test.yml.j2 +1 -0
  43. ansible/galaxy/data/apb/vars/main.yml.j2 +1 -0
  44. ansible/galaxy/data/collections_galaxy_meta.yml +1 -0
  45. ansible/galaxy/data/container/defaults/main.yml.j2 +1 -0
  46. ansible/galaxy/data/container/handlers/main.yml.j2 +1 -0
  47. ansible/galaxy/data/container/meta/container.yml.j2 +1 -0
  48. ansible/galaxy/data/container/meta/main.yml.j2 +1 -0
  49. ansible/galaxy/data/container/tasks/main.yml.j2 +1 -0
  50. ansible/galaxy/data/container/tests/ansible.cfg +1 -0
  51. ansible/galaxy/data/container/tests/inventory +1 -0
  52. ansible/galaxy/data/container/tests/test.yml.j2 +1 -0
  53. ansible/galaxy/data/container/vars/main.yml.j2 +1 -0
  54. ansible/galaxy/data/default/collection/README.md.j2 +1 -0
  55. ansible/galaxy/data/default/collection/galaxy.yml.j2 +1 -0
  56. ansible/galaxy/data/default/collection/meta/runtime.yml +1 -0
  57. ansible/galaxy/data/default/collection/plugins/README.md.j2 +1 -0
  58. ansible/galaxy/data/default/role/defaults/main.yml.j2 +1 -0
  59. ansible/galaxy/data/default/role/handlers/main.yml.j2 +1 -0
  60. ansible/galaxy/data/default/role/meta/main.yml.j2 +1 -0
  61. ansible/galaxy/data/default/role/tasks/main.yml.j2 +1 -0
  62. ansible/galaxy/data/default/role/tests/inventory +1 -0
  63. ansible/galaxy/data/default/role/tests/test.yml.j2 +1 -0
  64. ansible/galaxy/data/default/role/vars/main.yml.j2 +1 -0
  65. ansible/galaxy/data/network/cliconf_plugins/example.py.j2 +1 -0
  66. ansible/galaxy/data/network/defaults/main.yml.j2 +1 -0
  67. ansible/galaxy/data/network/library/example_command.py.j2 +1 -0
  68. ansible/galaxy/data/network/library/example_config.py.j2 +1 -0
  69. ansible/galaxy/data/network/library/example_facts.py.j2 +1 -0
  70. ansible/galaxy/data/network/meta/main.yml.j2 +1 -0
  71. ansible/galaxy/data/network/module_utils/example.py.j2 +1 -0
  72. ansible/galaxy/data/network/netconf_plugins/example.py.j2 +1 -0
  73. ansible/galaxy/data/network/tasks/main.yml.j2 +1 -0
  74. ansible/galaxy/data/network/terminal_plugins/example.py.j2 +1 -0
  75. ansible/galaxy/data/network/tests/inventory +1 -0
  76. ansible/galaxy/data/network/tests/test.yml.j2 +1 -0
  77. ansible/galaxy/data/network/vars/main.yml.j2 +1 -0
  78. ansible/galaxy/dependency_resolution/providers.py +3 -3
  79. ansible/galaxy/role.py +1 -1
  80. ansible/galaxy/token.py +20 -8
  81. ansible/keyword_desc.yml +1 -1
  82. ansible/module_utils/_internal/__init__.py +0 -0
  83. ansible/module_utils/_internal/_concurrent/__init__.py +0 -0
  84. ansible/module_utils/_internal/_concurrent/_daemon_threading.py +28 -0
  85. ansible/module_utils/_internal/_concurrent/_futures.py +21 -0
  86. ansible/module_utils/ansible_release.py +2 -2
  87. ansible/module_utils/api.py +2 -2
  88. ansible/module_utils/basic.py +14 -11
  89. ansible/module_utils/common/collections.py +1 -1
  90. ansible/module_utils/common/file.py +0 -6
  91. ansible/module_utils/common/process.py +22 -9
  92. ansible/module_utils/common/text/converters.py +5 -8
  93. ansible/module_utils/common/text/formatters.py +20 -4
  94. ansible/module_utils/common/validation.py +33 -25
  95. ansible/module_utils/compat/paramiko.py +6 -1
  96. ansible/module_utils/compat/selinux.py +2 -2
  97. ansible/module_utils/connection.py +8 -24
  98. ansible/module_utils/csharp/Ansible.Become.cs +14 -25
  99. ansible/module_utils/csharp/Ansible.Process.cs +1 -1
  100. ansible/module_utils/distro/__init__.py +1 -1
  101. ansible/module_utils/distro/_distro.py +8 -4
  102. ansible/module_utils/facts/collector.py +2 -0
  103. ansible/module_utils/facts/default_collectors.py +3 -1
  104. ansible/module_utils/facts/hardware/aix.py +54 -52
  105. ansible/module_utils/facts/hardware/darwin.py +37 -34
  106. ansible/module_utils/facts/hardware/freebsd.py +55 -15
  107. ansible/module_utils/facts/hardware/hpux.py +3 -0
  108. ansible/module_utils/facts/hardware/linux.py +101 -57
  109. ansible/module_utils/facts/hardware/netbsd.py +3 -0
  110. ansible/module_utils/facts/hardware/openbsd.py +4 -1
  111. ansible/module_utils/facts/hardware/sunos.py +7 -1
  112. ansible/module_utils/facts/network/aix.py +16 -17
  113. ansible/module_utils/facts/network/fc_wwn.py +4 -1
  114. ansible/module_utils/facts/network/hpux.py +21 -4
  115. ansible/module_utils/facts/network/iscsi.py +7 -8
  116. ansible/module_utils/facts/network/linux.py +0 -2
  117. ansible/module_utils/facts/other/facter.py +9 -4
  118. ansible/module_utils/facts/other/ohai.py +5 -5
  119. ansible/module_utils/facts/packages.py +49 -7
  120. ansible/module_utils/facts/sysctl.py +33 -31
  121. ansible/module_utils/facts/system/distribution.py +1 -1
  122. ansible/module_utils/facts/system/local.py +12 -22
  123. ansible/module_utils/facts/system/service_mgr.py +3 -1
  124. ansible/module_utils/facts/system/systemd.py +47 -0
  125. ansible/module_utils/powershell/Ansible.ModuleUtils.AddType.psm1 +1 -1
  126. ansible/module_utils/powershell/Ansible.ModuleUtils.CamelConversion.psm1 +1 -1
  127. ansible/module_utils/splitter.py +1 -1
  128. ansible/modules/add_host.py +1 -1
  129. ansible/modules/apt.py +43 -32
  130. ansible/modules/apt_key.py +6 -6
  131. ansible/modules/apt_repository.py +23 -14
  132. ansible/modules/assemble.py +7 -2
  133. ansible/modules/assert.py +4 -4
  134. ansible/modules/blockinfile.py +3 -6
  135. ansible/modules/command.py +1 -1
  136. ansible/modules/copy.py +4 -4
  137. ansible/modules/cron.py +13 -10
  138. ansible/modules/deb822_repository.py +16 -17
  139. ansible/modules/debconf.py +9 -9
  140. ansible/modules/debug.py +1 -1
  141. ansible/modules/dnf.py +79 -164
  142. ansible/modules/dnf5.py +48 -31
  143. ansible/modules/dpkg_selections.py +2 -2
  144. ansible/modules/expect.py +2 -2
  145. ansible/modules/fetch.py +2 -2
  146. ansible/modules/file.py +5 -3
  147. ansible/modules/find.py +40 -12
  148. ansible/modules/gather_facts.py +4 -2
  149. ansible/modules/get_url.py +29 -24
  150. ansible/modules/git.py +35 -35
  151. ansible/modules/group.py +71 -1
  152. ansible/modules/hostname.py +2 -4
  153. ansible/modules/include_vars.py +5 -5
  154. ansible/modules/iptables.py +13 -16
  155. ansible/modules/known_hosts.py +16 -13
  156. ansible/modules/lineinfile.py +1 -4
  157. ansible/modules/meta.py +6 -1
  158. ansible/modules/mount_facts.py +651 -0
  159. ansible/modules/package_facts.py +63 -80
  160. ansible/modules/pause.py +4 -3
  161. ansible/modules/pip.py +14 -14
  162. ansible/modules/replace.py +1 -4
  163. ansible/modules/rpm_key.py +31 -11
  164. ansible/modules/service.py +8 -8
  165. ansible/modules/service_facts.py +20 -5
  166. ansible/modules/set_stats.py +1 -1
  167. ansible/modules/setup.py +3 -3
  168. ansible/modules/stat.py +3 -3
  169. ansible/modules/subversion.py +1 -1
  170. ansible/modules/systemd.py +16 -10
  171. ansible/modules/systemd_service.py +16 -10
  172. ansible/modules/sysvinit.py +4 -4
  173. ansible/modules/unarchive.py +35 -22
  174. ansible/modules/uri.py +24 -18
  175. ansible/modules/user.py +145 -12
  176. ansible/modules/validate_argument_spec.py +3 -3
  177. ansible/modules/wait_for_connection.py +2 -1
  178. ansible/modules/yum_repository.py +136 -179
  179. ansible/parsing/dataloader.py +2 -2
  180. ansible/parsing/mod_args.py +11 -10
  181. ansible/parsing/vault/__init__.py +8 -3
  182. ansible/parsing/yaml/constructor.py +10 -8
  183. ansible/parsing/yaml/objects.py +1 -1
  184. ansible/playbook/base.py +12 -23
  185. ansible/playbook/helpers.py +4 -0
  186. ansible/playbook/loop_control.py +8 -0
  187. ansible/playbook/play.py +4 -22
  188. ansible/playbook/play_context.py +0 -16
  189. ansible/playbook/playbook_include.py +2 -2
  190. ansible/playbook/role/__init__.py +2 -2
  191. ansible/playbook/task.py +1 -1
  192. ansible/plugins/__init__.py +2 -0
  193. ansible/plugins/action/__init__.py +7 -9
  194. ansible/plugins/action/reboot.py +2 -2
  195. ansible/plugins/become/__init__.py +1 -1
  196. ansible/plugins/callback/__init__.py +44 -3
  197. ansible/plugins/callback/default.py +1 -1
  198. ansible/plugins/cliconf/__init__.py +1 -1
  199. ansible/plugins/connection/paramiko_ssh.py +2 -80
  200. ansible/plugins/connection/psrp.py +33 -82
  201. ansible/plugins/connection/ssh.py +0 -8
  202. ansible/plugins/connection/winrm.py +46 -1
  203. ansible/plugins/doc_fragments/connection_pipelining.py +2 -2
  204. ansible/plugins/doc_fragments/constructed.py +10 -10
  205. ansible/plugins/doc_fragments/default_callback.py +8 -8
  206. ansible/plugins/doc_fragments/files.py +5 -5
  207. ansible/plugins/doc_fragments/inventory_cache.py +2 -2
  208. ansible/plugins/doc_fragments/result_format_callback.py +6 -6
  209. ansible/plugins/doc_fragments/return_common.py +1 -1
  210. ansible/plugins/doc_fragments/shell_common.py +2 -10
  211. ansible/plugins/doc_fragments/shell_windows.py +0 -9
  212. ansible/plugins/doc_fragments/url.py +2 -2
  213. ansible/plugins/doc_fragments/url_windows.py +4 -5
  214. ansible/plugins/doc_fragments/validate.py +1 -1
  215. ansible/plugins/filter/core.py +2 -0
  216. ansible/plugins/filter/human_to_bytes.yml +9 -0
  217. ansible/plugins/filter/password_hash.yml +1 -1
  218. ansible/plugins/filter/strftime.yml +1 -1
  219. ansible/plugins/filter/to_nice_json.yml +7 -3
  220. ansible/plugins/filter/to_uuid.yml +1 -1
  221. ansible/plugins/inventory/script.py +1 -1
  222. ansible/plugins/list.py +1 -1
  223. ansible/plugins/loader.py +0 -11
  224. ansible/plugins/lookup/config.py +1 -1
  225. ansible/plugins/lookup/csvfile.py +21 -9
  226. ansible/plugins/lookup/env.py +8 -9
  227. ansible/plugins/lookup/ini.py +10 -1
  228. ansible/plugins/lookup/random_choice.py +2 -2
  229. ansible/plugins/lookup/url.py +7 -2
  230. ansible/plugins/shell/__init__.py +15 -20
  231. ansible/plugins/shell/powershell.py +9 -6
  232. ansible/plugins/strategy/__init__.py +16 -7
  233. ansible/plugins/test/core.py +23 -1
  234. ansible/plugins/test/issubset.yml +1 -1
  235. ansible/plugins/test/subset.yml +1 -1
  236. ansible/plugins/test/timedout.yml +20 -0
  237. ansible/plugins/test/vault_encrypted.yml +6 -6
  238. ansible/plugins/test/vaulted_file.yml +19 -0
  239. ansible/release.py +2 -2
  240. ansible/template/__init__.py +3 -8
  241. ansible/utils/collection_loader/_collection_finder.py +23 -55
  242. ansible/utils/display.py +44 -31
  243. ansible/utils/jsonrpc.py +1 -1
  244. ansible/utils/listify.py +1 -5
  245. ansible/utils/path.py +3 -0
  246. ansible/utils/vars.py +18 -27
  247. ansible/vars/manager.py +7 -150
  248. ansible/vars/plugins.py +1 -1
  249. ansible_core-2.18.0b1.dist-info/Apache-License.txt +202 -0
  250. {ansible_core-2.17.4.dist-info → ansible_core-2.18.0b1.dist-info}/METADATA +36 -23
  251. ansible_core-2.18.0b1.dist-info/MIT-license.txt +14 -0
  252. ansible_core-2.18.0b1.dist-info/PSF-license.txt +48 -0
  253. {ansible_core-2.17.4.dist-info → ansible_core-2.18.0b1.dist-info}/RECORD +311 -306
  254. {ansible_core-2.17.4.dist-info → ansible_core-2.18.0b1.dist-info}/WHEEL +1 -1
  255. {ansible_core-2.17.4.dist-info → ansible_core-2.18.0b1.dist-info}/entry_points.txt +1 -1
  256. ansible_core-2.18.0b1.dist-info/simplified_bsd.txt +8 -0
  257. ansible_test/_data/completion/docker.txt +7 -7
  258. ansible_test/_data/completion/remote.txt +5 -4
  259. ansible_test/_data/completion/windows.txt +4 -4
  260. ansible_test/_data/requirements/ansible-test.txt +1 -2
  261. ansible_test/_data/requirements/constraints.txt +1 -2
  262. ansible_test/_data/requirements/sanity.ansible-doc.txt +3 -3
  263. ansible_test/_data/requirements/sanity.changelog.in +1 -1
  264. ansible_test/_data/requirements/sanity.changelog.txt +4 -4
  265. ansible_test/_data/requirements/sanity.import.plugin.txt +2 -2
  266. ansible_test/_data/requirements/sanity.import.txt +1 -1
  267. ansible_test/_data/requirements/sanity.integration-aliases.txt +1 -1
  268. ansible_test/_data/requirements/sanity.pep8.txt +1 -1
  269. ansible_test/_data/requirements/sanity.pylint.txt +5 -7
  270. ansible_test/_data/requirements/sanity.runtime-metadata.txt +2 -2
  271. ansible_test/_data/requirements/sanity.validate-modules.txt +3 -3
  272. ansible_test/_data/requirements/sanity.yamllint.in +1 -0
  273. ansible_test/_data/requirements/sanity.yamllint.txt +1 -1
  274. ansible_test/_internal/ansible_util.py +8 -35
  275. ansible_test/_internal/ci/azp.py +1 -1
  276. ansible_test/_internal/classification/__init__.py +0 -2
  277. ansible_test/_internal/cli/parsers/key_value_parsers.py +3 -0
  278. ansible_test/_internal/commands/integration/cloud/hcloud.py +1 -1
  279. ansible_test/_internal/commands/integration/cloud/httptester.py +1 -1
  280. ansible_test/_internal/commands/integration/cloud/nios.py +1 -1
  281. ansible_test/_internal/commands/sanity/__init__.py +96 -19
  282. ansible_test/_internal/commands/sanity/pylint.py +20 -24
  283. ansible_test/_internal/completion.py +2 -0
  284. ansible_test/_internal/constants.py +0 -1
  285. ansible_test/_internal/coverage_util.py +1 -2
  286. ansible_test/_internal/docker_util.py +1 -1
  287. ansible_test/_internal/host_configs.py +10 -0
  288. ansible_test/_internal/host_profiles.py +9 -13
  289. ansible_test/_internal/pypi_proxy.py +1 -1
  290. ansible_test/_internal/python_requirements.py +5 -14
  291. ansible_test/_internal/timeout.py +1 -1
  292. ansible_test/_internal/util.py +40 -0
  293. ansible_test/_internal/util_common.py +5 -1
  294. ansible_test/_util/controller/sanity/code-smell/action-plugin-docs.json +3 -1
  295. ansible_test/_util/controller/sanity/code-smell/action-plugin-docs.py +6 -3
  296. ansible_test/_util/controller/sanity/code-smell/empty-init.json +0 -2
  297. ansible_test/_util/controller/sanity/pylint/config/collection.cfg +1 -0
  298. ansible_test/_util/controller/sanity/pylint/config/default.cfg +1 -0
  299. ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py +1 -19
  300. ansible_test/_util/controller/sanity/shellcheck/exclude.txt +1 -0
  301. ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py +67 -2
  302. ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py +27 -5
  303. ansible_test/_util/target/cli/ansible_test_cli_stub.py +0 -0
  304. ansible_test/_util/target/common/constants.py +2 -2
  305. ansible_test/_util/target/injector/python.py +5 -0
  306. ansible_test/_util/target/pytest/plugins/ansible_pytest_coverage.py +6 -0
  307. ansible_test/_util/target/sanity/import/importer.py +1 -1
  308. ansible_test/_util/target/setup/bootstrap.sh +6 -17
  309. ansible_test/_util/target/setup/requirements.py +14 -20
  310. ansible_test/config/config.yml +1 -1
  311. ansible_core-2.17.4.data/scripts/ansible-test +0 -44
  312. ansible_test/_data/requirements/sanity.mypy.in +0 -10
  313. ansible_test/_data/requirements/sanity.mypy.txt +0 -18
  314. ansible_test/_internal/commands/sanity/mypy.py +0 -274
  315. ansible_test/_util/controller/sanity/mypy/ansible-core.ini +0 -116
  316. ansible_test/_util/controller/sanity/mypy/ansible-test.ini +0 -27
  317. ansible_test/_util/controller/sanity/mypy/modules.ini +0 -92
  318. ansible_test/_util/controller/sanity/mypy/packaging.ini +0 -20
  319. {ansible_core-2.17.4.dist-info → ansible_core-2.18.0b1.dist-info}/COPYING +0 -0
  320. {ansible_core-2.17.4.dist-info → ansible_core-2.18.0b1.dist-info}/top_level.txt +0 -0
ansible/modules/apt.py CHANGED
@@ -21,6 +21,7 @@ options:
21
21
  description:
22
22
  - A list of package names, like V(foo), or package specifier with version, like V(foo=1.0) or V(foo>=1.0).
23
23
  Name wildcards (fnmatch) like V(apt*) and version wildcards like V(foo=1.0*) are also supported.
24
+ - Do not use single or double quotes around the version when referring to the package name with a specific version, such as V(foo=1.0) or V(foo>=1.0).
24
25
  aliases: [ package, pkg ]
25
26
  type: list
26
27
  elements: str
@@ -62,21 +63,20 @@ options:
62
63
  default: 'no'
63
64
  default_release:
64
65
  description:
65
- - Corresponds to the C(-t) option for I(apt) and sets pin priorities
66
+ - Corresponds to the C(-t) option for I(apt) and sets pin priorities.
66
67
  aliases: [ default-release ]
67
68
  type: str
68
69
  install_recommends:
69
70
  description:
70
- - Corresponds to the C(--no-install-recommends) option for I(apt). V(true) installs recommended packages. V(false) does not install
71
+ - Corresponds to the C(--no-install-recommends) option for C(apt). V(true) installs recommended packages. V(false) does not install
71
72
  recommended packages. By default, Ansible will use the same defaults as the operating system. Suggested packages are never installed.
72
73
  aliases: [ install-recommends ]
73
74
  type: bool
74
75
  force:
75
76
  description:
76
- - 'Corresponds to the C(--force-yes) to I(apt-get) and implies O(allow_unauthenticated=yes) and O(allow_downgrade=yes)'
77
- - "This option will disable checking both the packages' signatures and the certificates of the
78
- web servers they are downloaded from."
79
- - 'This option *is not* the equivalent of passing the C(-f) flag to I(apt-get) on the command line'
77
+ - 'Corresponds to the C(--force-yes) to C(apt-get) and implies O(allow_unauthenticated=yes) and O(allow_downgrade=yes).'
78
+ - "This option will disable checking both the packages' signatures and the certificates of the web servers they are downloaded from."
79
+ - 'This option *is not* the equivalent of passing the C(-f) flag to C(apt-get) on the command line.'
80
80
  - '**This is a destructive operation with the potential to destroy your system, and it should almost never be used.**
81
81
  Please also see C(man apt-get) for more information.'
82
82
  type: bool
@@ -84,7 +84,7 @@ options:
84
84
  clean:
85
85
  description:
86
86
  - Run the equivalent of C(apt-get clean) to clear out the local repository of retrieved package files. It removes everything but
87
- the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial/.
87
+ the lock file from C(/var/cache/apt/archives/) and C(/var/cache/apt/archives/partial/).
88
88
  - Can be run as part of the package installation (clean runs before install) or as a separate step.
89
89
  type: bool
90
90
  default: 'no'
@@ -92,7 +92,7 @@ options:
92
92
  allow_unauthenticated:
93
93
  description:
94
94
  - Ignore if packages cannot be authenticated. This is useful for bootstrapping environments that manage their own apt-key setup.
95
- - 'O(allow_unauthenticated) is only supported with O(state): V(install)/V(present)'
95
+ - 'O(allow_unauthenticated) is only supported with O(state): V(install)/V(present).'
96
96
  aliases: [ allow-unauthenticated ]
97
97
  type: bool
98
98
  default: 'no'
@@ -110,7 +110,7 @@ options:
110
110
  version_added: "2.12"
111
111
  allow_change_held_packages:
112
112
  description:
113
- - Allows changing the version of a package which is on the apt hold list
113
+ - Allows changing the version of a package which is on the apt hold list.
114
114
  type: bool
115
115
  default: 'no'
116
116
  version_added: '2.13'
@@ -127,14 +127,14 @@ options:
127
127
  type: str
128
128
  dpkg_options:
129
129
  description:
130
- - Add dpkg options to apt command. Defaults to '-o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold"'
131
- - Options should be supplied as comma separated list
130
+ - Add C(dpkg) options to C(apt) command. Defaults to C(-o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold").
131
+ - Options should be supplied as comma separated list.
132
132
  default: force-confdef,force-confold
133
133
  type: str
134
134
  deb:
135
135
  description:
136
136
  - Path to a .deb package on the remote machine.
137
- - If :// in the path, ansible will attempt to download deb before installing. (Version added 2.1)
137
+ - If C(://) in the path, ansible will attempt to download deb before installing. (Version added 2.1)
138
138
  - Requires the C(xz-utils) package to extract the control file of the deb package to install.
139
139
  type: path
140
140
  required: false
@@ -142,7 +142,8 @@ options:
142
142
  autoremove:
143
143
  description:
144
144
  - If V(true), remove unused dependency packages for all module states except V(build-dep). It can also be used as the only option.
145
- - Previous to version 2.4, autoclean was also an alias for autoremove, now it is its own separate command. See documentation for further information.
145
+ - Previous to version 2.4, O(autoclean) was also an alias for O(autoremove), now it is its own separate command.
146
+ See documentation for further information.
146
147
  type: bool
147
148
  default: 'no'
148
149
  version_added: "2.1"
@@ -154,10 +155,10 @@ options:
154
155
  version_added: "2.4"
155
156
  policy_rc_d:
156
157
  description:
157
- - Force the exit code of /usr/sbin/policy-rc.d.
158
- - For example, if I(policy_rc_d=101) the installed package will not trigger a service start.
159
- - If /usr/sbin/policy-rc.d already exists, it is backed up and restored after the package installation.
160
- - If V(null), the /usr/sbin/policy-rc.d isn't created/changed.
158
+ - Force the exit code of C(/usr/sbin/policy-rc.d).
159
+ - For example, if O(policy_rc_d=101) the installed package will not trigger a service start.
160
+ - If C(/usr/sbin/policy-rc.d) already exists, it is backed up and restored after the package installation.
161
+ - If V(null), the C(/usr/sbin/policy-rc.d) is not created/changed.
161
162
  type: int
162
163
  default: null
163
164
  version_added: "2.8"
@@ -178,7 +179,7 @@ options:
178
179
  version_added: "2.11"
179
180
  force_apt_get:
180
181
  description:
181
- - Force usage of apt-get instead of aptitude
182
+ - Force usage of apt-get instead of aptitude.
182
183
  type: bool
183
184
  default: 'no'
184
185
  version_added: "2.4"
@@ -204,22 +205,22 @@ attributes:
204
205
  platforms: debian
205
206
  notes:
206
207
  - Three of the upgrade modes (V(full), V(safe) and its alias V(true)) required C(aptitude) up to 2.3, since 2.4 C(apt-get) is used as a fall-back.
207
- - In most cases, packages installed with apt will start newly installed services by default. Most distributions have mechanisms to avoid this.
208
+ - In most cases, packages installed with I(apt) will start newly installed services by default. Most distributions have mechanisms to avoid this.
208
209
  For example when installing Postgresql-9.5 in Debian 9, creating an executable shell script (/usr/sbin/policy-rc.d) that throws
209
- a return code of 101 will stop Postgresql 9.5 starting up after install. Remove the file or its execute permission afterward.
210
- - The apt-get commandline supports implicit regex matches here but we do not because it can let typos through easier
210
+ a return code of 101 will stop Postgresql 9.5 starting up after install. Remove the file or its execute permission afterward.
211
+ - The C(apt-get) commandline supports implicit regex matches here but we do not because it can let typos through easier
211
212
  (If you typo C(foo) as C(fo) apt-get would install packages that have "fo" in their name with a warning and a prompt for the user.
212
- Since we don't have warnings and prompts before installing, we disallow this.Use an explicit fnmatch pattern if you want wildcarding)
213
+ Since there are no warnings and prompts before installing, we disallow this. Use an explicit fnmatch pattern if you want wildcarding).
213
214
  - When used with a C(loop:) each package will be processed individually, it is much more efficient to pass the list directly to the O(name) option.
214
215
  - When O(default_release) is used, an implicit priority of 990 is used. This is the same behavior as C(apt-get -t).
215
216
  - When an exact version is specified, an implicit priority of 1001 is used.
216
- - If the interpreter can't import ``python-apt``/``python3-apt`` the module will check for it in system-owned interpreters as well.
217
+ - If the interpreter can't import C(python-apt)/C(python3-apt) the module will check for it in system-owned interpreters as well.
217
218
  If the dependency can't be found, the module will attempt to install it.
218
219
  If the dependency is found or installed, the module will be respawned under the correct interpreter.
219
220
  '''
220
221
 
221
222
  EXAMPLES = '''
222
- - name: Install apache httpd (state=present is optional)
223
+ - name: Install apache httpd (state=present is optional)
223
224
  ansible.builtin.apt:
224
225
  name: apache2
225
226
  state: present
@@ -364,8 +365,8 @@ import datetime
364
365
  import fnmatch
365
366
  import locale as locale_module
366
367
  import os
367
- import random
368
368
  import re
369
+ import secrets
369
370
  import shutil
370
371
  import sys
371
372
  import tempfile
@@ -380,8 +381,8 @@ from ansible.module_utils.six import string_types
380
381
  from ansible.module_utils.urls import fetch_file
381
382
 
382
383
  DPKG_OPTIONS = 'force-confdef,force-confold'
383
- APT_GET_ZERO = "\n0 upgraded, 0 newly installed"
384
- APTITUDE_ZERO = "\n0 packages upgraded, 0 newly installed"
384
+ APT_GET_ZERO = "\n0 upgraded, 0 newly installed, 0 to remove"
385
+ APTITUDE_ZERO = "\n0 packages upgraded, 0 newly installed, 0 to remove"
385
386
  APT_LISTS_PATH = "/var/lib/apt/lists"
386
387
  APT_UPDATE_SUCCESS_STAMP_PATH = "/var/lib/apt/periodic/update-success-stamp"
387
388
  APT_MARK_INVALID_OP = 'Invalid operation'
@@ -506,7 +507,7 @@ def package_best_match(pkgname, version_cmp, version, release, cache):
506
507
  policy.create_pin('Release', pkgname, release, 990)
507
508
  if version_cmp == "=":
508
509
  # Installing a specific version from command line overrides all pinning
509
- # We don't mimmic this exactly, but instead set a priority which is higher than all APT built-in pin priorities.
510
+ # We don't mimic this exactly, but instead set a priority which is higher than all APT built-in pin priorities.
510
511
  policy.create_pin('Version', pkgname, version, 1001)
511
512
  pkg = cache[pkgname]
512
513
  pkgver = policy.get_candidate_ver(pkg)
@@ -1251,6 +1252,7 @@ def main():
1251
1252
  LC_ALL=locale,
1252
1253
  LC_MESSAGES=locale,
1253
1254
  LC_CTYPE=locale,
1255
+ LANGUAGE=locale,
1254
1256
  )
1255
1257
  module.run_command_environ_update = APT_ENV_VARS
1256
1258
 
@@ -1386,23 +1388,32 @@ def main():
1386
1388
  err = ''
1387
1389
  update_cache_retries = module.params.get('update_cache_retries')
1388
1390
  update_cache_retry_max_delay = module.params.get('update_cache_retry_max_delay')
1389
- randomize = random.randint(0, 1000) / 1000.0
1391
+ randomize = secrets.randbelow(1000) / 1000.0
1390
1392
 
1391
1393
  for retry in range(update_cache_retries):
1392
1394
  try:
1393
1395
  if not module.check_mode:
1394
1396
  cache.update()
1395
1397
  break
1396
- except apt.cache.FetchFailedException as e:
1397
- err = to_native(e)
1398
+ except apt.cache.FetchFailedException as fetch_failed_exc:
1399
+ err = fetch_failed_exc
1400
+ module.warn(
1401
+ f"Failed to update cache after {retry + 1} retries due "
1402
+ f"to {to_native(fetch_failed_exc)}, retrying"
1403
+ )
1398
1404
 
1399
1405
  # Use exponential backoff plus a little bit of randomness
1400
1406
  delay = 2 ** retry + randomize
1401
1407
  if delay > update_cache_retry_max_delay:
1402
1408
  delay = update_cache_retry_max_delay + randomize
1403
1409
  time.sleep(delay)
1410
+ module.warn(f"Sleeping for {int(round(delay))} seconds, before attempting to refresh the cache again")
1404
1411
  else:
1405
- module.fail_json(msg='Failed to update apt cache: %s' % (err if err else 'unknown reason'))
1412
+ msg = (
1413
+ f"Failed to update apt cache after {update_cache_retries} retries: "
1414
+ f"{err if err else 'unknown reason'}"
1415
+ )
1416
+ module.fail_json(msg=msg)
1406
1417
 
1407
1418
  cache.open(progress=None)
1408
1419
  mtimestamp, post_cache_update_time = get_updated_cache_time()
@@ -26,13 +26,13 @@ attributes:
26
26
  platform:
27
27
  platforms: debian
28
28
  notes:
29
- - The apt-key command used by this module has been deprecated. See the L(Debian wiki,https://wiki.debian.org/DebianRepository/UseThirdParty) for details.
30
- This module is kept for backwards compatibility for systems that still use apt-key as the main way to manage apt repository keys.
29
+ - The C(apt-key) command used by this module has been deprecated. See the L(Debian wiki,https://wiki.debian.org/DebianRepository/UseThirdParty) for details.
30
+ This module is kept for backwards compatibility for systems that still use C(apt-key) as the main way to manage apt repository keys.
31
31
  - As a sanity check, downloaded key id must match the one specified.
32
32
  - "Use full fingerprint (40 characters) key ids to avoid key collisions.
33
33
  To generate a full-fingerprint imported key: C(apt-key adv --list-public-keys --with-fingerprint --with-colons)."
34
- - If you specify both the key id and the URL with O(state=present), the task can verify or add the key as needed.
35
- - Adding a new key requires an apt cache update (e.g. using the M(ansible.builtin.apt) module's update_cache option).
34
+ - If you specify both the key O(id) and the O(url) with O(state=present), the task can verify or add the key as needed.
35
+ - Adding a new key requires an apt cache update (e.g. using the M(ansible.builtin.apt) module's C(update_cache) option).
36
36
  requirements:
37
37
  - gpg
38
38
  seealso:
@@ -42,7 +42,7 @@ options:
42
42
  description:
43
43
  - The identifier of the key.
44
44
  - Including this allows check mode to correctly report the changed state.
45
- - If specifying a subkey's id be aware that apt-key does not understand how to remove keys via a subkey id. Specify the primary key's id instead.
45
+ - If specifying a subkey's id be aware that apt-key does not understand how to remove keys via a subkey id. Specify the primary key's id instead.
46
46
  - This parameter is required when O(state) is set to V(absent).
47
47
  type: str
48
48
  data:
@@ -188,7 +188,7 @@ def lang_env(module):
188
188
 
189
189
  if not hasattr(lang_env, 'result'):
190
190
  locale = get_best_parsable_locale(module)
191
- lang_env.result = dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale)
191
+ lang_env.result = dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale, LANGUAGE=locale)
192
192
 
193
193
  return lang_env.result
194
194
 
@@ -41,13 +41,13 @@ options:
41
41
  default: "present"
42
42
  mode:
43
43
  description:
44
- - The octal mode for newly created files in sources.list.d.
44
+ - The octal mode for newly created files in C(sources.list.d).
45
45
  - Default is what system uses (probably 0644).
46
46
  type: raw
47
47
  version_added: "1.6"
48
48
  update_cache:
49
49
  description:
50
- - Run the equivalent of C(apt-get update) when a change occurs. Cache updates are run after making changes.
50
+ - Run the equivalent of C(apt-get update) when a change occurs. Cache updates are run after making changes.
51
51
  type: bool
52
52
  default: "yes"
53
53
  aliases: [ update-cache ]
@@ -72,9 +72,9 @@ options:
72
72
  version_added: '1.8'
73
73
  filename:
74
74
  description:
75
- - Sets the name of the source list file in sources.list.d.
75
+ - Sets the name of the source list file in C(sources.list.d).
76
76
  Defaults to a file name based on the repository source url.
77
- The .list extension will be automatically added.
77
+ The C(.list) extension will be automatically added.
78
78
  type: str
79
79
  version_added: '2.1'
80
80
  codename:
@@ -90,8 +90,8 @@ options:
90
90
  Without this library, the module does not work.
91
91
  - Runs C(apt-get install python-apt) for Python 2, and C(apt-get install python3-apt) for Python 3.
92
92
  - Only works with the system Python 2 or Python 3. If you are using a Python on the remote that is not
93
- the system Python, set O(install_python_apt=false) and ensure that the Python apt library
94
- for your Python version is installed some other way.
93
+ the system Python, set O(install_python_apt=false) and ensure that the Python apt library
94
+ for your Python version is installed some other way.
95
95
  type: bool
96
96
  default: true
97
97
  author:
@@ -174,9 +174,9 @@ import glob
174
174
  import json
175
175
  import os
176
176
  import re
177
+ import secrets
177
178
  import sys
178
179
  import tempfile
179
- import random
180
180
  import time
181
181
 
182
182
  from ansible.module_utils.basic import AnsibleModule
@@ -504,7 +504,7 @@ class UbuntuSourcesList(SourcesList):
504
504
 
505
505
  if self.apt_key_bin:
506
506
  locale = get_best_parsable_locale(self.module)
507
- APT_ENV = dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale, LC_CTYPE=locale)
507
+ APT_ENV = dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale, LC_CTYPE=locale, LANGUAGE=locale)
508
508
  self.module.run_command_environ_update = APT_ENV
509
509
  rc, out, err = self.module.run_command([self.apt_key_bin, 'export', key_fingerprint], check_rc=True)
510
510
  found = bool(not err or 'nothing exported' not in err)
@@ -738,29 +738,38 @@ def main():
738
738
 
739
739
  if changed and not module.check_mode:
740
740
  try:
741
+ err = ''
741
742
  sourceslist.save()
742
743
  if update_cache:
743
- err = ''
744
744
  update_cache_retries = module.params.get('update_cache_retries')
745
745
  update_cache_retry_max_delay = module.params.get('update_cache_retry_max_delay')
746
- randomize = random.randint(0, 1000) / 1000.0
746
+ randomize = secrets.randbelow(1000) / 1000.0
747
747
 
748
+ cache = apt.Cache()
748
749
  for retry in range(update_cache_retries):
749
750
  try:
750
- cache = apt.Cache()
751
751
  cache.update()
752
752
  break
753
- except apt.cache.FetchFailedException as e:
754
- err = to_native(e)
753
+ except apt.cache.FetchFailedException as fetch_failed_exc:
754
+ err = fetch_failed_exc
755
+ module.warn(
756
+ f"Failed to update cache after {retry + 1} due "
757
+ f"to {to_native(fetch_failed_exc)} retry, retrying"
758
+ )
755
759
 
756
760
  # Use exponential backoff with a max fail count, plus a little bit of randomness
757
761
  delay = 2 ** retry + randomize
758
762
  if delay > update_cache_retry_max_delay:
759
763
  delay = update_cache_retry_max_delay + randomize
760
764
  time.sleep(delay)
765
+ module.warn(f"Sleeping for {int(round(delay))} seconds, before attempting to update the cache again")
761
766
  else:
762
767
  revert_sources_list(sources_before, sources_after, sourceslist_before)
763
- module.fail_json(msg='Failed to update apt cache: %s' % (err if err else 'unknown reason'))
768
+ msg = (
769
+ f"Failed to update apt cache after {update_cache_retries} retries: "
770
+ f"{err if err else 'unknown reason'}"
771
+ )
772
+ module.fail_json(msg=msg)
764
773
 
765
774
  except (OSError, IOError) as ex:
766
775
  revert_sources_list(sources_before, sources_after, sourceslist_before)
@@ -61,14 +61,14 @@ options:
61
61
  type: str
62
62
  ignore_hidden:
63
63
  description:
64
- - A boolean that controls if files that start with a '.' will be included or not.
64
+ - A boolean that controls if files that start with a C(.) will be included or not.
65
65
  type: bool
66
66
  default: no
67
67
  version_added: '2.0'
68
68
  validate:
69
69
  description:
70
70
  - The validation command to run before copying into place.
71
- - The path to the file to validate is passed in via '%s' which must be present as in the sshd example below.
71
+ - The path to the file to validate is passed in by C(%s) which must be present as in the sshd example below.
72
72
  - The command is passed securely so shell features like expansion and pipes won't work.
73
73
  type: str
74
74
  version_added: '2.0'
@@ -205,6 +205,11 @@ def main():
205
205
  regexp=dict(type='str'),
206
206
  ignore_hidden=dict(type='bool', default=False),
207
207
  validate=dict(type='str'),
208
+
209
+ # Options that are for the action plugin, but ignored by the module itself.
210
+ # We have them here so that the tests pass without ignores, which
211
+ # reduces the likelihood of further bugs added.
212
+ decrypt=dict(type='bool', default=True),
208
213
  ),
209
214
  add_file_common_args=True,
210
215
  )
ansible/modules/assert.py CHANGED
@@ -17,14 +17,14 @@ version_added: "1.5"
17
17
  options:
18
18
  that:
19
19
  description:
20
- - A list of string expressions of the same form that can be passed to the 'when' statement.
20
+ - A list of string expressions of the same form that can be passed to the C(when) statement.
21
21
  type: list
22
22
  elements: str
23
23
  required: true
24
24
  fail_msg:
25
25
  description:
26
26
  - The customized message used for a failing assertion.
27
- - This argument was called 'msg' before Ansible 2.7, now it is renamed to 'fail_msg' with alias 'msg'.
27
+ - This argument was called O(msg) before Ansible 2.7, now it is renamed to O(fail_msg) with alias O(msg).
28
28
  type: str
29
29
  aliases: [ msg ]
30
30
  version_added: "2.7"
@@ -85,7 +85,7 @@ EXAMPLES = r'''
85
85
  - >
86
86
  "reject" not in some_command_result.stderr
87
87
 
88
- - name: After version 2.7 both 'msg' and 'fail_msg' can customize failing assertion message
88
+ - name: After version 2.7 both O(msg) and O(fail_msg) can customize failing assertion message
89
89
  ansible.builtin.assert:
90
90
  that:
91
91
  - my_param <= 100
@@ -93,7 +93,7 @@ EXAMPLES = r'''
93
93
  fail_msg: "'my_param' must be between 0 and 100"
94
94
  success_msg: "'my_param' is between 0 and 100"
95
95
 
96
- - name: Please use 'msg' when ansible version is smaller than 2.7
96
+ - name: Please use O(msg) when ansible version is smaller than 2.7
97
97
  ansible.builtin.assert:
98
98
  that:
99
99
  - my_param <= 100
@@ -33,7 +33,7 @@ options:
33
33
  marker:
34
34
  description:
35
35
  - The marker line template.
36
- - C({mark}) will be replaced with the values in O(marker_begin) (default="BEGIN") and O(marker_end) (default="END").
36
+ - C({mark}) will be replaced with the values in O(marker_begin) (default=C(BEGIN)) and O(marker_end) (default=C(END)).
37
37
  - Using a custom marker without the C({mark}) variable may result in the block being repeatedly inserted on subsequent playbook runs.
38
38
  - Multi-line markers are not supported and will result in the block being repeatedly inserted on subsequent playbook runs.
39
39
  - A newline is automatically appended by the module to O(marker_begin) and O(marker_end).
@@ -50,12 +50,10 @@ options:
50
50
  description:
51
51
  - If specified and no begin/ending O(marker) lines are found, the block will be inserted after the last match of specified regular expression.
52
52
  - A special value is available; V(EOF) for inserting the block at the end of the file.
53
- - If specified regular expression has no matches, V(EOF) will be used instead.
53
+ - If specified regular expression has no matches or no value is passed, V(EOF) will be used instead.
54
54
  - The presence of the multiline flag (?m) in the regular expression controls whether the match is done line by line or with multiple lines.
55
55
  This behaviour was added in ansible-core 2.14.
56
56
  type: str
57
- choices: [ EOF, '*regex*' ]
58
- default: EOF
59
57
  insertbefore:
60
58
  description:
61
59
  - If specified and no begin/ending O(marker) lines are found, the block will be inserted before the last match of specified regular expression.
@@ -64,7 +62,6 @@ options:
64
62
  - The presence of the multiline flag (?m) in the regular expression controls whether the match is done line by line or with multiple lines.
65
63
  This behaviour was added in ansible-core 2.14.
66
64
  type: str
67
- choices: [ BOF, '*regex*' ]
68
65
  create:
69
66
  description:
70
67
  - Create a new file if it does not exist.
@@ -106,7 +103,7 @@ options:
106
103
  default: no
107
104
  version_added: '2.16'
108
105
  notes:
109
- - When using 'with_*' loops be aware that if you do not set a unique mark the block will be overwritten on each iteration.
106
+ - When using C(with_*) loops be aware that if you do not set a unique mark the block will be overwritten on each iteration.
110
107
  - As of Ansible 2.3, the O(dest) option has been changed to O(path) as default, but O(dest) still works as well.
111
108
  - Option O(ignore:follow) has been removed in Ansible 2.5, because this module modifies the contents of the file
112
109
  so O(ignore:follow=no) does not make sense.
@@ -50,7 +50,7 @@ options:
50
50
  free_form:
51
51
  description:
52
52
  - The command module takes a free form string as a command to run.
53
- - There is no actual parameter named 'free form'.
53
+ - There is no actual parameter named C(free_form).
54
54
  cmd:
55
55
  type: str
56
56
  description:
ansible/modules/copy.py CHANGED
@@ -28,8 +28,8 @@ options:
28
28
  - Local path to a file to copy to the remote server.
29
29
  - This can be absolute or relative.
30
30
  - If path is a directory, it is copied recursively. In this case, if path ends
31
- with "/", only inside contents of that directory are copied to destination.
32
- Otherwise, if it does not end with "/", the directory itself with all contents
31
+ with C(/), only inside contents of that directory are copied to destination.
32
+ Otherwise, if it does not end with C(/), the directory itself with all contents
33
33
  is copied. This behavior is similar to the C(rsync) command line tool.
34
34
  type: path
35
35
  content:
@@ -44,7 +44,7 @@ options:
44
44
  description:
45
45
  - Remote absolute path where the file should be copied to.
46
46
  - If O(src) is a directory, this must be a directory too.
47
- - If O(dest) is a non-existent path and if either O(dest) ends with "/" or O(src) is a directory, O(dest) is created.
47
+ - If O(dest) is a non-existent path and if either O(dest) ends with C(/) or O(src) is a directory, O(dest) is created.
48
48
  - If O(dest) is a relative path, the starting directory is determined by the remote host.
49
49
  - If O(src) and O(dest) are files, the parent directory of O(dest) is not created and the task fails if it does not already exist.
50
50
  type: path
@@ -92,7 +92,7 @@ options:
92
92
  description:
93
93
  - Influence whether O(src) needs to be transferred or already is present remotely.
94
94
  - If V(false), it will search for O(src) on the controller node.
95
- - If V(true) it will search for O(src) on the managed (remote) node.
95
+ - If V(true), it will search for O(src) on the managed (remote) node.
96
96
  - O(remote_src) supports recursive copying as of version 2.8.
97
97
  - O(remote_src) only works with O(mode=preserve) as of version 2.6.
98
98
  - Auto-decryption of files does not work when O(remote_src=yes).
ansible/modules/cron.py CHANGED
@@ -18,19 +18,19 @@ description:
18
18
  - Use this module to manage crontab and environment variables entries. This module allows
19
19
  you to create environment variables and named crontab entries, update, or delete them.
20
20
  - 'When crontab jobs are managed: the module includes one line with the description of the
21
- crontab entry C("#Ansible: <name>") corresponding to the "name" passed to the module,
22
- which is used by future ansible/module calls to find/check the state. The "name"
23
- parameter should be unique, and changing the "name" value will result in a new cron
21
+ crontab entry C("#Ansible: <name>") corresponding to the O(name) passed to the module,
22
+ which is used by future ansible/module calls to find/check the state. The O(name)
23
+ parameter should be unique, and changing the O(name) value will result in a new cron
24
24
  task being created (or a different one being removed).'
25
25
  - When environment variables are managed, no comment line is added, but, when the module
26
- needs to find/check the state, it uses the "name" parameter to find the environment
26
+ needs to find/check the state, it uses the O(name) parameter to find the environment
27
27
  variable definition line.
28
- - When using symbols such as %, they must be properly escaped.
28
+ - When using symbols such as C(%), they must be properly escaped.
29
29
  version_added: "0.9"
30
30
  options:
31
31
  name:
32
32
  description:
33
- - Description of a crontab entry or, if env is set, the name of environment variable.
33
+ - Description of a crontab entry or, if O(env) is set, the name of environment variable.
34
34
  - This parameter is always required as of ansible-core 2.12.
35
35
  type: str
36
36
  required: yes
@@ -41,7 +41,7 @@ options:
41
41
  type: str
42
42
  job:
43
43
  description:
44
- - The command to execute or, if env is set, the value of environment variable.
44
+ - The command to execute or, if O(env) is set, the value of environment variable.
45
45
  - The command should not contain line breaks.
46
46
  - Required if O(state=present).
47
47
  type: str
@@ -58,10 +58,10 @@ options:
58
58
  The assumption is that this file is exclusively managed by the module,
59
59
  do not use if the file contains multiple entries, NEVER use for /etc/crontab.
60
60
  - If this is a relative path, it is interpreted with respect to C(/etc/cron.d).
61
- - Many linux distros expect (and some require) the filename portion to consist solely
61
+ - Many Linux distros expect (and some require) the filename portion to consist solely
62
62
  of upper- and lower-case letters, digits, underscores, and hyphens.
63
- - Using this parameter requires you to specify the O(user) as well, unless O(state) is not V(present).
64
- - Either this parameter or O(name) is required
63
+ - Using this parameter requires you to specify the O(user) as well, unless O(state=absent).
64
+ - Either this parameter or O(name) is required.
65
65
  type: path
66
66
  backup:
67
67
  description:
@@ -131,6 +131,9 @@ options:
131
131
  version_added: "2.1"
132
132
  requirements:
133
133
  - cron (any 'vixie cron' conformant variant, like cronie)
134
+ notes:
135
+ - If you are experiencing permissions issues with cron and MacOS,
136
+ you should see the official MacOS documentation for further information.
134
137
  author:
135
138
  - Dane Summers (@dsummersl)
136
139
  - Mike Grozak (@rhaido)