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.
- ansible/cli/__init__.py +3 -3
- ansible/cli/adhoc.py +1 -1
- ansible/cli/arguments/option_helpers.py +15 -5
- ansible/cli/config.py +2 -2
- ansible/cli/console.py +21 -17
- ansible/cli/doc.py +8 -9
- ansible/cli/galaxy.py +60 -27
- ansible/cli/inventory.py +1 -1
- ansible/cli/playbook.py +1 -1
- ansible/cli/pull.py +2 -2
- ansible/cli/scripts/ansible_connection_cli_stub.py +1 -1
- ansible/cli/vault.py +11 -6
- ansible/collections/__init__.py +0 -29
- ansible/collections/list.py +23 -44
- ansible/config/ansible_builtin_runtime.yml +8 -4
- ansible/config/base.yml +34 -22
- ansible/config/manager.py +1 -1
- ansible/constants.py +3 -5
- ansible/errors/__init__.py +1 -1
- ansible/executor/interpreter_discovery.py +1 -1
- ansible/executor/module_common.py +39 -32
- ansible/executor/play_iterator.py +0 -15
- ansible/executor/playbook_executor.py +3 -3
- ansible/executor/powershell/module_manifest.py +1 -1
- ansible/executor/powershell/module_wrapper.ps1 +4 -1
- ansible/executor/process/worker.py +22 -7
- ansible/executor/task_executor.py +39 -40
- ansible/executor/task_queue_manager.py +8 -11
- ansible/galaxy/__init__.py +1 -1
- ansible/galaxy/api.py +8 -11
- ansible/galaxy/collection/__init__.py +17 -4
- ansible/galaxy/collection/concrete_artifact_manager.py +7 -2
- ansible/galaxy/collection/galaxy_api_proxy.py +1 -1
- ansible/galaxy/data/container/README.md +3 -5
- ansible/galaxy/dependency_resolution/__init__.py +1 -6
- ansible/galaxy/dependency_resolution/dataclasses.py +22 -1
- ansible/galaxy/dependency_resolution/providers.py +61 -69
- ansible/galaxy/role.py +31 -13
- ansible/galaxy/token.py +2 -2
- ansible/inventory/group.py +1 -1
- ansible/inventory/manager.py +1 -1
- ansible/module_utils/ansible_release.py +2 -2
- ansible/module_utils/basic.py +11 -41
- ansible/module_utils/common/file.py +0 -100
- ansible/module_utils/common/json.py +1 -1
- ansible/module_utils/common/locale.py +1 -1
- ansible/module_utils/common/text/converters.py +2 -2
- ansible/module_utils/common/validation.py +1 -1
- ansible/module_utils/compat/_selectors2.py +4 -4
- ansible/module_utils/compat/datetime.py +40 -0
- ansible/module_utils/compat/selinux.py +1 -1
- ansible/module_utils/compat/typing.py +1 -1
- ansible/module_utils/connection.py +1 -1
- ansible/module_utils/facts/hardware/linux.py +2 -2
- ansible/module_utils/facts/hardware/openbsd.py +1 -1
- ansible/module_utils/facts/network/linux.py +3 -3
- ansible/module_utils/facts/other/facter.py +8 -15
- ansible/module_utils/facts/sysctl.py +1 -1
- ansible/module_utils/facts/system/date_time.py +2 -2
- ansible/module_utils/facts/system/distribution.py +1 -1
- ansible/module_utils/facts/system/local.py +6 -2
- ansible/module_utils/facts/system/pkg_mgr.py +6 -1
- ansible/module_utils/facts/system/service_mgr.py +4 -2
- ansible/module_utils/parsing/convert_bool.py +1 -1
- ansible/module_utils/service.py +9 -6
- ansible/module_utils/urls.py +40 -22
- ansible/modules/add_host.py +2 -2
- ansible/modules/apt.py +48 -31
- ansible/modules/apt_key.py +4 -4
- ansible/modules/apt_repository.py +5 -5
- ansible/modules/assemble.py +7 -7
- ansible/modules/assert.py +1 -1
- ansible/modules/async_status.py +11 -7
- ansible/modules/async_wrapper.py +1 -1
- ansible/modules/blockinfile.py +60 -17
- ansible/modules/command.py +37 -15
- ansible/modules/copy.py +35 -30
- ansible/modules/cron.py +14 -14
- ansible/modules/deb822_repository.py +4 -3
- ansible/modules/debconf.py +35 -14
- ansible/modules/debug.py +1 -1
- ansible/modules/dnf.py +29 -27
- ansible/modules/dnf5.py +22 -22
- ansible/modules/dpkg_selections.py +9 -2
- ansible/modules/expect.py +4 -4
- ansible/modules/fetch.py +7 -7
- ansible/modules/file.py +30 -30
- ansible/modules/find.py +82 -22
- ansible/modules/gather_facts.py +6 -2
- ansible/modules/get_url.py +29 -29
- ansible/modules/getent.py +4 -4
- ansible/modules/git.py +27 -27
- ansible/modules/group.py +5 -12
- ansible/modules/hostname.py +21 -2
- ansible/modules/include_role.py +5 -5
- ansible/modules/include_tasks.py +2 -2
- ansible/modules/include_vars.py +5 -5
- ansible/modules/iptables.py +70 -65
- ansible/modules/known_hosts.py +7 -7
- ansible/modules/lineinfile.py +33 -33
- ansible/modules/meta.py +13 -13
- ansible/modules/package.py +8 -8
- ansible/modules/package_facts.py +3 -3
- ansible/modules/pause.py +2 -2
- ansible/modules/ping.py +5 -5
- ansible/modules/pip.py +80 -46
- ansible/modules/reboot.py +8 -4
- ansible/modules/replace.py +20 -15
- ansible/modules/rpm_key.py +2 -2
- ansible/modules/script.py +16 -10
- ansible/modules/service.py +26 -98
- ansible/modules/service_facts.py +36 -12
- ansible/modules/set_fact.py +2 -2
- ansible/modules/set_stats.py +2 -2
- ansible/modules/setup.py +18 -18
- ansible/modules/shell.py +3 -3
- ansible/modules/stat.py +9 -30
- ansible/modules/subversion.py +9 -9
- ansible/modules/systemd.py +20 -19
- ansible/modules/systemd_service.py +20 -19
- ansible/modules/sysvinit.py +26 -21
- ansible/modules/tempfile.py +5 -4
- ansible/modules/template.py +60 -6
- ansible/modules/unarchive.py +21 -18
- ansible/modules/uri.py +39 -39
- ansible/modules/user.py +81 -53
- ansible/modules/wait_for.py +22 -21
- ansible/modules/wait_for_connection.py +4 -4
- ansible/modules/yum.py +38 -38
- ansible/modules/yum_repository.py +58 -80
- ansible/parsing/dataloader.py +27 -27
- ansible/parsing/mod_args.py +1 -1
- ansible/parsing/plugin_docs.py +3 -3
- ansible/parsing/splitter.py +14 -16
- ansible/parsing/utils/yaml.py +1 -1
- ansible/parsing/vault/__init__.py +8 -6
- ansible/parsing/yaml/constructor.py +1 -1
- ansible/parsing/yaml/objects.py +1 -1
- ansible/playbook/__init__.py +1 -1
- ansible/playbook/base.py +2 -2
- ansible/playbook/block.py +0 -1
- ansible/playbook/conditional.py +40 -114
- ansible/playbook/helpers.py +5 -28
- ansible/playbook/included_file.py +8 -7
- ansible/playbook/play.py +1 -1
- ansible/playbook/play_context.py +2 -2
- ansible/playbook/playbook_include.py +2 -2
- ansible/playbook/role/__init__.py +1 -1
- ansible/playbook/role/include.py +1 -1
- ansible/playbook/role/metadata.py +1 -1
- ansible/playbook/role_include.py +1 -1
- ansible/playbook/task.py +2 -2
- ansible/playbook/task_include.py +1 -24
- ansible/plugins/__init__.py +13 -5
- ansible/plugins/action/__init__.py +17 -43
- ansible/plugins/action/add_host.py +2 -3
- ansible/plugins/action/assemble.py +1 -1
- ansible/plugins/action/assert.py +2 -1
- ansible/plugins/action/copy.py +2 -2
- ansible/plugins/action/debug.py +2 -1
- ansible/plugins/action/fail.py +1 -0
- ansible/plugins/action/fetch.py +3 -1
- ansible/plugins/action/gather_facts.py +37 -13
- ansible/plugins/action/group_by.py +1 -0
- ansible/plugins/action/include_vars.py +3 -2
- ansible/plugins/action/normal.py +3 -3
- ansible/plugins/action/pause.py +1 -1
- ansible/plugins/action/reboot.py +21 -16
- ansible/plugins/action/script.py +23 -8
- ansible/plugins/action/set_fact.py +1 -0
- ansible/plugins/action/set_stats.py +1 -0
- ansible/plugins/action/shell.py +6 -0
- ansible/plugins/action/template.py +1 -1
- ansible/plugins/action/unarchive.py +1 -1
- ansible/plugins/action/uri.py +1 -1
- ansible/plugins/action/validate_argument_spec.py +1 -0
- ansible/plugins/action/wait_for_connection.py +4 -4
- ansible/plugins/become/__init__.py +1 -1
- ansible/plugins/become/su.py +1 -1
- ansible/plugins/cache/__init__.py +1 -1
- ansible/plugins/callback/junit.py +1 -1
- ansible/plugins/callback/oneline.py +1 -1
- ansible/plugins/callback/tree.py +1 -1
- ansible/plugins/cliconf/__init__.py +2 -2
- ansible/plugins/connection/__init__.py +65 -37
- ansible/plugins/connection/local.py +9 -8
- ansible/plugins/connection/paramiko_ssh.py +34 -28
- ansible/plugins/connection/psrp.py +56 -43
- ansible/plugins/connection/ssh.py +67 -43
- ansible/plugins/connection/winrm.py +77 -30
- ansible/plugins/doc_fragments/constructed.py +4 -4
- ansible/plugins/doc_fragments/files.py +12 -12
- ansible/plugins/doc_fragments/inventory_cache.py +0 -6
- ansible/plugins/doc_fragments/result_format_callback.py +5 -5
- ansible/plugins/doc_fragments/shell_common.py +2 -2
- ansible/plugins/doc_fragments/shell_windows.py +1 -1
- ansible/plugins/doc_fragments/template_common.py +6 -6
- ansible/plugins/doc_fragments/url.py +10 -10
- ansible/plugins/doc_fragments/url_windows.py +15 -15
- ansible/plugins/doc_fragments/vars_plugin_staging.py +4 -4
- ansible/plugins/filter/b64decode.yml +1 -1
- ansible/plugins/filter/b64encode.yml +2 -2
- ansible/plugins/filter/bool.yml +5 -5
- ansible/plugins/filter/combine.yml +1 -1
- ansible/plugins/filter/commonpath.yml +2 -1
- ansible/plugins/filter/core.py +6 -8
- ansible/plugins/filter/dict2items.yml +11 -1
- ansible/plugins/filter/difference.yml +1 -0
- ansible/plugins/filter/encryption.py +1 -1
- ansible/plugins/filter/extract.yml +1 -1
- ansible/plugins/filter/flatten.yml +1 -1
- ansible/plugins/filter/from_yaml.yml +1 -1
- ansible/plugins/filter/from_yaml_all.yml +2 -2
- ansible/plugins/filter/hash.yml +1 -1
- ansible/plugins/filter/human_readable.yml +1 -1
- ansible/plugins/filter/human_to_bytes.yml +2 -2
- ansible/plugins/filter/intersect.yml +1 -0
- ansible/plugins/filter/mandatory.yml +7 -0
- ansible/plugins/filter/mathstuff.py +15 -17
- ansible/plugins/filter/normpath.yml +1 -1
- ansible/plugins/filter/path_join.yml +8 -1
- ansible/plugins/filter/realpath.yml +3 -2
- ansible/plugins/filter/regex_findall.yml +8 -2
- ansible/plugins/filter/regex_replace.yml +9 -3
- ansible/plugins/filter/regex_search.yml +8 -2
- ansible/plugins/filter/relpath.yml +2 -2
- ansible/plugins/filter/root.yml +1 -1
- ansible/plugins/filter/splitext.yml +1 -1
- ansible/plugins/filter/subelements.yml +2 -2
- ansible/plugins/filter/symmetric_difference.yml +1 -0
- ansible/plugins/filter/ternary.yml +5 -5
- ansible/plugins/filter/to_json.yml +7 -7
- ansible/plugins/filter/to_nice_json.yml +5 -5
- ansible/plugins/filter/to_yaml.yml +2 -2
- ansible/plugins/filter/type_debug.yml +1 -1
- ansible/plugins/filter/union.yml +1 -0
- ansible/plugins/filter/unvault.yml +2 -2
- ansible/plugins/filter/urldecode.yml +13 -32
- ansible/plugins/filter/urlsplit.py +1 -1
- ansible/plugins/filter/vault.yml +1 -1
- ansible/plugins/filter/zip.yml +1 -1
- ansible/plugins/filter/zip_longest.yml +1 -1
- ansible/plugins/inventory/__init__.py +1 -1
- ansible/plugins/inventory/advanced_host_list.py +1 -1
- ansible/plugins/inventory/constructed.py +2 -2
- ansible/plugins/inventory/host_list.py +1 -1
- ansible/plugins/inventory/ini.py +6 -3
- ansible/plugins/inventory/script.py +8 -2
- ansible/plugins/inventory/toml.py +1 -1
- ansible/plugins/inventory/yaml.py +1 -1
- ansible/plugins/list.py +21 -17
- ansible/plugins/loader.py +66 -88
- ansible/plugins/lookup/__init__.py +1 -1
- ansible/plugins/lookup/config.py +16 -6
- ansible/plugins/lookup/csvfile.py +7 -4
- ansible/plugins/lookup/env.py +1 -1
- ansible/plugins/lookup/file.py +5 -2
- ansible/plugins/lookup/fileglob.py +5 -2
- ansible/plugins/lookup/first_found.py +20 -14
- ansible/plugins/lookup/ini.py +6 -3
- ansible/plugins/lookup/lines.py +2 -1
- ansible/plugins/lookup/password.py +7 -7
- ansible/plugins/lookup/pipe.py +1 -0
- ansible/plugins/lookup/random_choice.py +2 -2
- ansible/plugins/lookup/sequence.py +1 -1
- ansible/plugins/lookup/subelements.py +2 -2
- ansible/plugins/lookup/template.py +4 -1
- ansible/plugins/lookup/unvault.py +4 -1
- ansible/plugins/lookup/url.py +6 -6
- ansible/plugins/lookup/varnames.py +1 -1
- ansible/plugins/netconf/__init__.py +3 -3
- ansible/plugins/shell/__init__.py +1 -1
- ansible/plugins/shell/cmd.py +7 -7
- ansible/plugins/shell/powershell.py +1 -1
- ansible/plugins/strategy/__init__.py +8 -10
- ansible/plugins/strategy/free.py +1 -1
- ansible/plugins/strategy/linear.py +3 -3
- ansible/plugins/terminal/__init__.py +2 -2
- ansible/plugins/test/abs.yml +1 -1
- ansible/plugins/test/all.yml +1 -1
- ansible/plugins/test/any.yml +1 -1
- ansible/plugins/test/change.yml +2 -2
- ansible/plugins/test/changed.yml +2 -2
- ansible/plugins/test/contains.yml +1 -1
- ansible/plugins/test/core.py +1 -1
- ansible/plugins/test/directory.yml +1 -1
- ansible/plugins/test/exists.yml +3 -2
- ansible/plugins/test/failed.yml +2 -2
- ansible/plugins/test/failure.yml +2 -2
- ansible/plugins/test/falsy.yml +2 -2
- ansible/plugins/test/file.yml +1 -1
- ansible/plugins/test/finished.yml +2 -2
- ansible/plugins/test/is_abs.yml +1 -1
- ansible/plugins/test/is_dir.yml +1 -1
- ansible/plugins/test/is_file.yml +1 -1
- ansible/plugins/test/is_link.yml +1 -1
- ansible/plugins/test/is_mount.yml +1 -1
- ansible/plugins/test/is_same_file.yml +1 -1
- ansible/plugins/test/isnan.yml +1 -1
- ansible/plugins/test/issubset.yml +1 -2
- ansible/plugins/test/issuperset.yml +1 -2
- ansible/plugins/test/link.yml +1 -1
- ansible/plugins/test/link_exists.yml +1 -1
- ansible/plugins/test/match.yml +2 -2
- ansible/plugins/test/mount.yml +1 -1
- ansible/plugins/test/nan.yml +1 -1
- ansible/plugins/test/reachable.yml +2 -2
- ansible/plugins/test/regex.yml +1 -1
- ansible/plugins/test/same_file.yml +1 -1
- ansible/plugins/test/search.yml +2 -2
- ansible/plugins/test/skip.yml +3 -3
- ansible/plugins/test/skipped.yml +3 -3
- ansible/plugins/test/started.yml +2 -2
- ansible/plugins/test/subset.yml +1 -2
- ansible/plugins/test/succeeded.yml +2 -2
- ansible/plugins/test/success.yml +2 -2
- ansible/plugins/test/successful.yml +2 -2
- ansible/plugins/test/superset.yml +1 -2
- ansible/plugins/test/truthy.yml +3 -3
- ansible/plugins/test/unreachable.yml +2 -2
- ansible/plugins/test/uri.yml +1 -1
- ansible/plugins/test/url.yml +1 -1
- ansible/plugins/test/urn.yml +1 -1
- ansible/plugins/test/vault_encrypted.yml +1 -1
- ansible/plugins/test/version.yml +7 -7
- ansible/plugins/test/version_compare.yml +7 -7
- ansible/plugins/vars/host_group_vars.py +1 -1
- ansible/release.py +2 -2
- ansible/template/__init__.py +24 -26
- ansible/template/native_helpers.py +1 -1
- ansible/template/vars.py +1 -1
- ansible/utils/_junit_xml.py +1 -1
- ansible/utils/cmd_functions.py +1 -1
- ansible/utils/collection_loader/_collection_finder.py +12 -1
- ansible/utils/display.py +113 -62
- ansible/utils/encrypt.py +11 -14
- ansible/utils/hashing.py +1 -1
- ansible/utils/jsonrpc.py +1 -1
- ansible/utils/path.py +1 -1
- ansible/utils/plugin_docs.py +1 -1
- ansible/utils/py3compat.py +1 -1
- ansible/utils/shlex.py +2 -10
- ansible/utils/ssh_functions.py +5 -4
- ansible/utils/unicode.py +1 -1
- ansible/utils/unsafe_proxy.py +1 -1
- ansible/utils/vars.py +4 -29
- ansible/vars/hostvars.py +1 -2
- ansible/vars/manager.py +13 -9
- ansible/vars/plugins.py +2 -2
- {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/COPYING +4 -5
- {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/METADATA +2 -4
- {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/RECORD +424 -425
- ansible_test/_data/completion/docker.txt +9 -9
- ansible_test/_data/completion/remote.txt +4 -7
- ansible_test/_data/completion/windows.txt +0 -2
- ansible_test/_data/requirements/ansible-test.txt +2 -1
- ansible_test/_data/requirements/ansible.txt +0 -3
- ansible_test/_data/requirements/constraints.txt +0 -2
- ansible_test/_data/requirements/sanity.ansible-doc.txt +3 -5
- ansible_test/_data/requirements/sanity.changelog.in +1 -2
- ansible_test/_data/requirements/sanity.changelog.txt +4 -6
- ansible_test/_data/requirements/sanity.import.plugin.txt +2 -4
- ansible_test/_data/requirements/sanity.import.txt +1 -3
- ansible_test/_data/requirements/sanity.integration-aliases.txt +1 -3
- ansible_test/_data/requirements/sanity.mypy.txt +12 -12
- ansible_test/_data/requirements/sanity.pep8.txt +1 -1
- ansible_test/_data/requirements/sanity.pylint.txt +6 -12
- ansible_test/_data/requirements/sanity.runtime-metadata.txt +1 -3
- ansible_test/_data/requirements/sanity.validate-modules.in +1 -1
- ansible_test/_data/requirements/sanity.validate-modules.txt +3 -5
- ansible_test/_data/requirements/sanity.yamllint.txt +3 -5
- ansible_test/_data/requirements/units.txt +0 -1
- ansible_test/_internal/ci/azp.py +4 -4
- ansible_test/_internal/cli/environments.py +0 -13
- ansible_test/_internal/commands/coverage/analyze/targets/__init__.py +4 -4
- ansible_test/_internal/commands/coverage/combine.py +1 -1
- ansible_test/_internal/commands/integration/cloud/acme.py +6 -8
- ansible_test/_internal/commands/integration/cloud/cs.py +4 -9
- ansible_test/_internal/commands/integration/cloud/galaxy.py +103 -96
- ansible_test/_internal/commands/integration/cloud/httptester.py +0 -3
- ansible_test/_internal/commands/integration/cloud/nios.py +7 -9
- ansible_test/_internal/commands/integration/cloud/openshift.py +2 -7
- ansible_test/_internal/commands/integration/cloud/vcenter.py +11 -95
- ansible_test/_internal/commands/sanity/__init__.py +10 -0
- ansible_test/_internal/commands/sanity/import.py +8 -2
- ansible_test/_internal/commands/sanity/pylint.py +27 -1
- ansible_test/_internal/commands/units/__init__.py +2 -1
- ansible_test/_internal/config.py +0 -7
- ansible_test/_internal/containers.py +11 -56
- ansible_test/_internal/core_ci.py +0 -7
- ansible_test/_internal/coverage_util.py +8 -3
- ansible_test/_internal/delegation.py +0 -1
- ansible_test/_internal/diff.py +1 -1
- ansible_test/_internal/docker_util.py +9 -2
- ansible_test/_internal/host_profiles.py +6 -6
- ansible_test/_internal/http.py +1 -1
- ansible_test/_internal/junit_xml.py +1 -1
- ansible_test/_internal/pypi_proxy.py +1 -1
- ansible_test/_internal/python_requirements.py +3 -8
- ansible_test/_internal/util.py +1 -6
- ansible_test/_util/controller/sanity/code-smell/no-get-exception.json +4 -0
- ansible_test/_util/controller/sanity/code-smell/replace-urlopen.json +4 -0
- ansible_test/_util/controller/sanity/code-smell/use-compat-six.json +4 -0
- ansible_test/_util/controller/sanity/mypy/ansible-core.ini +3 -0
- ansible_test/_util/controller/sanity/pylint/config/ansible-test-target.cfg +2 -0
- ansible_test/_util/controller/sanity/pylint/config/ansible-test.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/config/collection.cfg +1 -0
- ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py +172 -10
- ansible_test/_util/controller/sanity/pylint/plugins/string_format.py +13 -2
- ansible_test/_util/controller/sanity/pylint/plugins/unwanted.py +7 -1
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py +6 -6
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/module_args.py +1 -1
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/utils.py +1 -1
- ansible_test/_util/controller/sanity/yamllint/yamllinter.py +3 -3
- ansible_test/_util/controller/tools/collection_detail.py +2 -2
- ansible_test/_util/target/common/constants.py +2 -2
- ansible_test/_util/target/pytest/plugins/ansible_forked.py +103 -0
- ansible_test/_util/target/sanity/import/importer.py +0 -8
- ansible_test/_util/target/setup/bootstrap.sh +36 -16
- ansible_test/_util/target/setup/quiet_pip.py +0 -4
- ansible/modules/_include.py +0 -80
- ansible_test/_internal/commands/integration/cloud/foreman.py +0 -102
- ansible_test/_util/target/setup/ConfigureRemotingForAnsible.ps1 +0 -435
- {ansible_core-2.15.4rc1.data → ansible_core-2.16.0b2.data}/scripts/ansible-test +0 -0
- {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/WHEEL +0 -0
- {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/entry_points.txt +0 -0
- {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/top_level.txt +0 -0
ansible/modules/dnf.py
CHANGED
|
@@ -29,7 +29,7 @@ options:
|
|
|
29
29
|
description:
|
|
30
30
|
- "A package name or package specifier with version, like C(name-1.0).
|
|
31
31
|
When using state=latest, this can be '*' which means run: dnf -y update.
|
|
32
|
-
You can also pass a url or a local path to
|
|
32
|
+
You can also pass a url or a local path to an rpm file.
|
|
33
33
|
To operate on several packages this can accept a comma separated string of packages or a list of packages."
|
|
34
34
|
- Comparison operators for package version are valid here C(>), C(<), C(>=), C(<=). Example - C(name >= 1.0).
|
|
35
35
|
Spaces around the operator are required.
|
|
@@ -44,14 +44,14 @@ options:
|
|
|
44
44
|
list:
|
|
45
45
|
description:
|
|
46
46
|
- Various (non-idempotent) commands for usage with C(/usr/bin/ansible) and I(not) playbooks.
|
|
47
|
-
Use M(ansible.builtin.package_facts) instead of the
|
|
47
|
+
Use M(ansible.builtin.package_facts) instead of the O(list) argument as a best practice.
|
|
48
48
|
type: str
|
|
49
49
|
|
|
50
50
|
state:
|
|
51
51
|
description:
|
|
52
|
-
- Whether to install (
|
|
53
|
-
- Default is
|
|
54
|
-
enabled for this module, then
|
|
52
|
+
- Whether to install (V(present), V(latest)), or remove (V(absent)) a package.
|
|
53
|
+
- Default is V(None), however in effect the default action is V(present) unless the O(autoremove) option is
|
|
54
|
+
enabled for this module, then V(absent) is inferred.
|
|
55
55
|
choices: ['absent', 'present', 'installed', 'removed', 'latest']
|
|
56
56
|
type: str
|
|
57
57
|
|
|
@@ -81,7 +81,7 @@ options:
|
|
|
81
81
|
disable_gpg_check:
|
|
82
82
|
description:
|
|
83
83
|
- Whether to disable the GPG checking of signatures of packages being
|
|
84
|
-
installed. Has an effect only if state is
|
|
84
|
+
installed. Has an effect only if O(state) is V(present) or V(latest).
|
|
85
85
|
- This setting affects packages installed from a repository as well as
|
|
86
86
|
"local" packages installed from the filesystem or a URL.
|
|
87
87
|
type: bool
|
|
@@ -104,9 +104,9 @@ options:
|
|
|
104
104
|
|
|
105
105
|
autoremove:
|
|
106
106
|
description:
|
|
107
|
-
- If
|
|
107
|
+
- If V(true), removes all "leaf" packages from the system that were originally
|
|
108
108
|
installed as dependencies of user-installed packages but which are no longer
|
|
109
|
-
required by any such package. Should be used alone or when state is
|
|
109
|
+
required by any such package. Should be used alone or when O(state) is V(absent)
|
|
110
110
|
type: bool
|
|
111
111
|
default: "no"
|
|
112
112
|
version_added: "2.4"
|
|
@@ -128,7 +128,7 @@ options:
|
|
|
128
128
|
update_cache:
|
|
129
129
|
description:
|
|
130
130
|
- Force dnf to check if cache is out of date and redownload if needed.
|
|
131
|
-
Has an effect only if state is
|
|
131
|
+
Has an effect only if O(state) is V(present) or V(latest).
|
|
132
132
|
type: bool
|
|
133
133
|
default: "no"
|
|
134
134
|
aliases: [ expire-cache ]
|
|
@@ -136,20 +136,20 @@ options:
|
|
|
136
136
|
update_only:
|
|
137
137
|
description:
|
|
138
138
|
- When using latest, only update installed packages. Do not install packages.
|
|
139
|
-
- Has an effect only if state is
|
|
139
|
+
- Has an effect only if O(state) is V(latest)
|
|
140
140
|
default: "no"
|
|
141
141
|
type: bool
|
|
142
142
|
version_added: "2.7"
|
|
143
143
|
security:
|
|
144
144
|
description:
|
|
145
|
-
- If set to
|
|
145
|
+
- If set to V(true), and O(state=latest) then only installs updates that have been marked security related.
|
|
146
146
|
- Note that, similar to C(dnf upgrade-minimal), this filter applies to dependencies as well.
|
|
147
147
|
type: bool
|
|
148
148
|
default: "no"
|
|
149
149
|
version_added: "2.7"
|
|
150
150
|
bugfix:
|
|
151
151
|
description:
|
|
152
|
-
- If set to
|
|
152
|
+
- If set to V(true), and O(state=latest) then only installs updates that have been marked bugfix related.
|
|
153
153
|
- Note that, similar to C(dnf upgrade-minimal), this filter applies to dependencies as well.
|
|
154
154
|
default: "no"
|
|
155
155
|
type: bool
|
|
@@ -173,22 +173,22 @@ options:
|
|
|
173
173
|
disable_excludes:
|
|
174
174
|
description:
|
|
175
175
|
- Disable the excludes defined in DNF config files.
|
|
176
|
-
- If set to
|
|
177
|
-
- If set to
|
|
178
|
-
- If set to
|
|
176
|
+
- If set to V(all), disables all excludes.
|
|
177
|
+
- If set to V(main), disable excludes defined in [main] in dnf.conf.
|
|
178
|
+
- If set to V(repoid), disable excludes defined for given repo id.
|
|
179
179
|
version_added: "2.7"
|
|
180
180
|
type: str
|
|
181
181
|
validate_certs:
|
|
182
182
|
description:
|
|
183
|
-
- This only applies if using a https url as the source of the rpm. e.g. for localinstall. If set to
|
|
184
|
-
- This should only set to
|
|
183
|
+
- This only applies if using a https url as the source of the rpm. e.g. for localinstall. If set to V(false), the SSL certificates will not be validated.
|
|
184
|
+
- This should only set to V(false) used on personally controlled sites using self-signed certificates as it avoids verifying the source site.
|
|
185
185
|
type: bool
|
|
186
186
|
default: "yes"
|
|
187
187
|
version_added: "2.7"
|
|
188
188
|
sslverify:
|
|
189
189
|
description:
|
|
190
190
|
- Disables SSL validation of the repository server for this transaction.
|
|
191
|
-
- This should be set to
|
|
191
|
+
- This should be set to V(false) if one of the configured repositories is using an untrusted or self-signed certificate.
|
|
192
192
|
type: bool
|
|
193
193
|
default: "yes"
|
|
194
194
|
version_added: "2.13"
|
|
@@ -208,7 +208,7 @@ options:
|
|
|
208
208
|
install_repoquery:
|
|
209
209
|
description:
|
|
210
210
|
- This is effectively a no-op in DNF as it is not needed with DNF, but is an accepted parameter for feature
|
|
211
|
-
parity/compatibility with the
|
|
211
|
+
parity/compatibility with the M(ansible.builtin.yum) module.
|
|
212
212
|
type: bool
|
|
213
213
|
default: "yes"
|
|
214
214
|
version_added: "2.7"
|
|
@@ -234,12 +234,12 @@ options:
|
|
|
234
234
|
download_dir:
|
|
235
235
|
description:
|
|
236
236
|
- Specifies an alternate directory to store packages.
|
|
237
|
-
- Has an effect only if
|
|
237
|
+
- Has an effect only if O(download_only) is specified.
|
|
238
238
|
type: str
|
|
239
239
|
version_added: "2.8"
|
|
240
240
|
allowerasing:
|
|
241
241
|
description:
|
|
242
|
-
- If
|
|
242
|
+
- If V(true) it allows erasing of installed packages to resolve dependencies.
|
|
243
243
|
required: false
|
|
244
244
|
type: bool
|
|
245
245
|
default: "no"
|
|
@@ -383,9 +383,8 @@ import os
|
|
|
383
383
|
import re
|
|
384
384
|
import sys
|
|
385
385
|
|
|
386
|
-
from ansible.module_utils.
|
|
386
|
+
from ansible.module_utils.common.text.converters import to_native, to_text
|
|
387
387
|
from ansible.module_utils.urls import fetch_file
|
|
388
|
-
from ansible.module_utils.six import text_type
|
|
389
388
|
from ansible.module_utils.compat.version import LooseVersion
|
|
390
389
|
|
|
391
390
|
from ansible.module_utils.basic import AnsibleModule
|
|
@@ -582,6 +581,7 @@ class DnfModule(YumDnf):
|
|
|
582
581
|
import dnf.cli
|
|
583
582
|
import dnf.const
|
|
584
583
|
import dnf.exceptions
|
|
584
|
+
import dnf.package
|
|
585
585
|
import dnf.subject
|
|
586
586
|
import dnf.util
|
|
587
587
|
HAS_DNF = True
|
|
@@ -966,12 +966,14 @@ class DnfModule(YumDnf):
|
|
|
966
966
|
def _update_only(self, pkgs):
|
|
967
967
|
not_installed = []
|
|
968
968
|
for pkg in pkgs:
|
|
969
|
-
if self._is_installed(
|
|
969
|
+
if self._is_installed(
|
|
970
|
+
self._package_dict(pkg)["nevra"] if isinstance(pkg, dnf.package.Package) else pkg
|
|
971
|
+
):
|
|
970
972
|
try:
|
|
971
|
-
if isinstance(
|
|
972
|
-
self.base.upgrade(pkg)
|
|
973
|
-
else:
|
|
973
|
+
if isinstance(pkg, dnf.package.Package):
|
|
974
974
|
self.base.package_upgrade(pkg)
|
|
975
|
+
else:
|
|
976
|
+
self.base.upgrade(pkg)
|
|
975
977
|
except Exception as e:
|
|
976
978
|
self.module.fail_json(
|
|
977
979
|
msg="Error occurred attempting update_only operation: {0}".format(to_native(e)),
|
ansible/modules/dnf5.py
CHANGED
|
@@ -11,15 +11,15 @@ module: dnf5
|
|
|
11
11
|
author: Ansible Core Team
|
|
12
12
|
description:
|
|
13
13
|
- Installs, upgrade, removes, and lists packages and groups with the I(dnf5) package manager.
|
|
14
|
-
- "WARNING: The I(dnf5) package manager is still under development and not all features that the existing
|
|
15
|
-
provides are implemented in
|
|
14
|
+
- "WARNING: The I(dnf5) package manager is still under development and not all features that the existing M(ansible.builtin.dnf) module
|
|
15
|
+
provides are implemented in M(ansible.builtin.dnf5), please consult specific options for more information."
|
|
16
16
|
short_description: Manages packages with the I(dnf5) package manager
|
|
17
17
|
options:
|
|
18
18
|
name:
|
|
19
19
|
description:
|
|
20
20
|
- "A package name or package specifier with version, like C(name-1.0).
|
|
21
21
|
When using state=latest, this can be '*' which means run: dnf -y update.
|
|
22
|
-
You can also pass a url or a local path to
|
|
22
|
+
You can also pass a url or a local path to an rpm file.
|
|
23
23
|
To operate on several packages this can accept a comma separated string of packages or a list of packages."
|
|
24
24
|
- Comparison operators for package version are valid here C(>), C(<), C(>=), C(<=). Example - C(name >= 1.0).
|
|
25
25
|
Spaces around the operator are required.
|
|
@@ -33,13 +33,13 @@ options:
|
|
|
33
33
|
list:
|
|
34
34
|
description:
|
|
35
35
|
- Various (non-idempotent) commands for usage with C(/usr/bin/ansible) and I(not) playbooks.
|
|
36
|
-
Use M(ansible.builtin.package_facts) instead of the
|
|
36
|
+
Use M(ansible.builtin.package_facts) instead of the O(list) argument as a best practice.
|
|
37
37
|
type: str
|
|
38
38
|
state:
|
|
39
39
|
description:
|
|
40
|
-
- Whether to install (
|
|
41
|
-
- Default is
|
|
42
|
-
enabled for this module, then
|
|
40
|
+
- Whether to install (V(present), V(latest)), or remove (V(absent)) a package.
|
|
41
|
+
- Default is V(None), however in effect the default action is V(present) unless the V(autoremove) option is
|
|
42
|
+
enabled for this module, then V(absent) is inferred.
|
|
43
43
|
choices: ['absent', 'present', 'installed', 'removed', 'latest']
|
|
44
44
|
type: str
|
|
45
45
|
enablerepo:
|
|
@@ -65,7 +65,7 @@ options:
|
|
|
65
65
|
disable_gpg_check:
|
|
66
66
|
description:
|
|
67
67
|
- Whether to disable the GPG checking of signatures of packages being
|
|
68
|
-
installed. Has an effect only if state is
|
|
68
|
+
installed. Has an effect only if O(state) is V(present) or V(latest).
|
|
69
69
|
- This setting affects packages installed from a repository as well as
|
|
70
70
|
"local" packages installed from the filesystem or a URL.
|
|
71
71
|
type: bool
|
|
@@ -83,9 +83,9 @@ options:
|
|
|
83
83
|
type: str
|
|
84
84
|
autoremove:
|
|
85
85
|
description:
|
|
86
|
-
- If
|
|
86
|
+
- If V(true), removes all "leaf" packages from the system that were originally
|
|
87
87
|
installed as dependencies of user-installed packages but which are no longer
|
|
88
|
-
required by any such package. Should be used alone or when state is
|
|
88
|
+
required by any such package. Should be used alone or when O(state) is V(absent)
|
|
89
89
|
type: bool
|
|
90
90
|
default: "no"
|
|
91
91
|
exclude:
|
|
@@ -104,25 +104,25 @@ options:
|
|
|
104
104
|
update_cache:
|
|
105
105
|
description:
|
|
106
106
|
- Force dnf to check if cache is out of date and redownload if needed.
|
|
107
|
-
Has an effect only if state is
|
|
107
|
+
Has an effect only if O(state) is V(present) or V(latest).
|
|
108
108
|
type: bool
|
|
109
109
|
default: "no"
|
|
110
110
|
aliases: [ expire-cache ]
|
|
111
111
|
update_only:
|
|
112
112
|
description:
|
|
113
113
|
- When using latest, only update installed packages. Do not install packages.
|
|
114
|
-
- Has an effect only if state is
|
|
114
|
+
- Has an effect only if O(state) is V(latest)
|
|
115
115
|
default: "no"
|
|
116
116
|
type: bool
|
|
117
117
|
security:
|
|
118
118
|
description:
|
|
119
|
-
- If set to
|
|
119
|
+
- If set to V(true), and O(state=latest) then only installs updates that have been marked security related.
|
|
120
120
|
- Note that, similar to C(dnf upgrade-minimal), this filter applies to dependencies as well.
|
|
121
121
|
type: bool
|
|
122
122
|
default: "no"
|
|
123
123
|
bugfix:
|
|
124
124
|
description:
|
|
125
|
-
- If set to
|
|
125
|
+
- If set to V(true), and O(state=latest) then only installs updates that have been marked bugfix related.
|
|
126
126
|
- Note that, similar to C(dnf upgrade-minimal), this filter applies to dependencies as well.
|
|
127
127
|
default: "no"
|
|
128
128
|
type: bool
|
|
@@ -145,20 +145,20 @@ options:
|
|
|
145
145
|
disable_excludes:
|
|
146
146
|
description:
|
|
147
147
|
- Disable the excludes defined in DNF config files.
|
|
148
|
-
- If set to
|
|
149
|
-
- If set to
|
|
150
|
-
- If set to
|
|
148
|
+
- If set to V(all), disables all excludes.
|
|
149
|
+
- If set to V(main), disable excludes defined in [main] in dnf.conf.
|
|
150
|
+
- If set to V(repoid), disable excludes defined for given repo id.
|
|
151
151
|
type: str
|
|
152
152
|
validate_certs:
|
|
153
153
|
description:
|
|
154
154
|
- This is effectively a no-op in the dnf5 module as dnf5 itself handles downloading a https url as the source of the rpm,
|
|
155
|
-
but is an accepted parameter for feature parity/compatibility with the
|
|
155
|
+
but is an accepted parameter for feature parity/compatibility with the M(ansible.builtin.yum) module.
|
|
156
156
|
type: bool
|
|
157
157
|
default: "yes"
|
|
158
158
|
sslverify:
|
|
159
159
|
description:
|
|
160
160
|
- Disables SSL validation of the repository server for this transaction.
|
|
161
|
-
- This should be set to
|
|
161
|
+
- This should be set to V(false) if one of the configured repositories is using an untrusted or self-signed certificate.
|
|
162
162
|
type: bool
|
|
163
163
|
default: "yes"
|
|
164
164
|
allow_downgrade:
|
|
@@ -176,7 +176,7 @@ options:
|
|
|
176
176
|
install_repoquery:
|
|
177
177
|
description:
|
|
178
178
|
- This is effectively a no-op in DNF as it is not needed with DNF, but is an accepted parameter for feature
|
|
179
|
-
parity/compatibility with the
|
|
179
|
+
parity/compatibility with the M(ansible.builtin.yum) module.
|
|
180
180
|
type: bool
|
|
181
181
|
default: "yes"
|
|
182
182
|
download_only:
|
|
@@ -199,11 +199,11 @@ options:
|
|
|
199
199
|
download_dir:
|
|
200
200
|
description:
|
|
201
201
|
- Specifies an alternate directory to store packages.
|
|
202
|
-
- Has an effect only if
|
|
202
|
+
- Has an effect only if O(download_only) is specified.
|
|
203
203
|
type: str
|
|
204
204
|
allowerasing:
|
|
205
205
|
description:
|
|
206
|
-
- If
|
|
206
|
+
- If V(true) it allows erasing of installed packages to resolve dependencies.
|
|
207
207
|
required: false
|
|
208
208
|
type: bool
|
|
209
209
|
default: "no"
|
|
@@ -39,7 +39,7 @@ attributes:
|
|
|
39
39
|
support: full
|
|
40
40
|
platforms: debian
|
|
41
41
|
notes:
|
|
42
|
-
- This module
|
|
42
|
+
- This module will not cause any packages to be installed/removed/purged, use the M(ansible.builtin.apt) module for that.
|
|
43
43
|
'''
|
|
44
44
|
EXAMPLES = '''
|
|
45
45
|
- name: Prevent python from being upgraded
|
|
@@ -54,6 +54,7 @@ EXAMPLES = '''
|
|
|
54
54
|
'''
|
|
55
55
|
|
|
56
56
|
from ansible.module_utils.basic import AnsibleModule
|
|
57
|
+
from ansible.module_utils.common.locale import get_best_parsable_locale
|
|
57
58
|
|
|
58
59
|
|
|
59
60
|
def main():
|
|
@@ -67,12 +68,18 @@ def main():
|
|
|
67
68
|
|
|
68
69
|
dpkg = module.get_bin_path('dpkg', True)
|
|
69
70
|
|
|
71
|
+
locale = get_best_parsable_locale(module)
|
|
72
|
+
DPKG_ENV = dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale, LC_CTYPE=locale)
|
|
73
|
+
module.run_command_environ_update = DPKG_ENV
|
|
74
|
+
|
|
70
75
|
name = module.params['name']
|
|
71
76
|
selection = module.params['selection']
|
|
72
77
|
|
|
73
78
|
# Get current settings.
|
|
74
79
|
rc, out, err = module.run_command([dpkg, '--get-selections', name], check_rc=True)
|
|
75
|
-
if
|
|
80
|
+
if 'no packages found matching' in err:
|
|
81
|
+
module.fail_json(msg="Failed to find package '%s' to perform selection '%s'." % (name, selection))
|
|
82
|
+
elif not out:
|
|
76
83
|
current = 'not present'
|
|
77
84
|
else:
|
|
78
85
|
current = out.split()[1]
|
ansible/modules/expect.py
CHANGED
|
@@ -13,7 +13,7 @@ module: expect
|
|
|
13
13
|
version_added: '2.0'
|
|
14
14
|
short_description: Executes a command and responds to prompts
|
|
15
15
|
description:
|
|
16
|
-
- The
|
|
16
|
+
- The M(ansible.builtin.expect) module executes a command and responds to prompts.
|
|
17
17
|
- The given command will be executed on all selected nodes. It will not be
|
|
18
18
|
processed through the shell, so variables like C($HOME) and operations
|
|
19
19
|
like C("<"), C(">"), C("|"), and C("&") will not work.
|
|
@@ -46,7 +46,7 @@ options:
|
|
|
46
46
|
type: int
|
|
47
47
|
description:
|
|
48
48
|
- Amount of time in seconds to wait for the expected strings. Use
|
|
49
|
-
|
|
49
|
+
V(null) to disable timeout.
|
|
50
50
|
default: 30
|
|
51
51
|
echo:
|
|
52
52
|
description:
|
|
@@ -69,7 +69,7 @@ notes:
|
|
|
69
69
|
- If you want to run a command through the shell (say you are using C(<),
|
|
70
70
|
C(>), C(|), and so on), you must specify a shell in the command such as
|
|
71
71
|
C(/bin/bash -c "/path/to/something | grep else").
|
|
72
|
-
- The question, or key, under
|
|
72
|
+
- The question, or key, under O(responses) is a python regex match. Case
|
|
73
73
|
insensitive searches are indicated with a prefix of C(?i).
|
|
74
74
|
- The C(pexpect) library used by this module operates with a search window
|
|
75
75
|
of 2000 bytes, and does not use a multiline regex match. To perform a
|
|
@@ -121,7 +121,7 @@ except ImportError:
|
|
|
121
121
|
HAS_PEXPECT = False
|
|
122
122
|
|
|
123
123
|
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
|
124
|
-
from ansible.module_utils.
|
|
124
|
+
from ansible.module_utils.common.text.converters import to_bytes, to_native
|
|
125
125
|
|
|
126
126
|
|
|
127
127
|
def response_closure(module, question, responses):
|
ansible/modules/fetch.py
CHANGED
|
@@ -16,7 +16,7 @@ short_description: Fetch files from remote nodes
|
|
|
16
16
|
description:
|
|
17
17
|
- This module works like M(ansible.builtin.copy), but in reverse.
|
|
18
18
|
- It is used for fetching files from remote machines and storing them locally in a file tree, organized by hostname.
|
|
19
|
-
- Files that already exist at
|
|
19
|
+
- Files that already exist at O(dest) will be overwritten if they are different than the O(src).
|
|
20
20
|
- This module is also supported for Windows targets.
|
|
21
21
|
version_added: '0.2'
|
|
22
22
|
options:
|
|
@@ -29,16 +29,16 @@ options:
|
|
|
29
29
|
dest:
|
|
30
30
|
description:
|
|
31
31
|
- A directory to save the file into.
|
|
32
|
-
- For example, if the
|
|
32
|
+
- For example, if the O(dest) directory is C(/backup) a O(src) file named C(/etc/profile) on host
|
|
33
33
|
C(host.example.com), would be saved into C(/backup/host.example.com/etc/profile).
|
|
34
34
|
The host name is based on the inventory name.
|
|
35
35
|
required: yes
|
|
36
36
|
fail_on_missing:
|
|
37
37
|
version_added: '1.1'
|
|
38
38
|
description:
|
|
39
|
-
- When set to
|
|
39
|
+
- When set to V(true), the task will fail if the remote file cannot be read for any reason.
|
|
40
40
|
- Prior to Ansible 2.5, setting this would only fail if the source file was missing.
|
|
41
|
-
- The default was changed to
|
|
41
|
+
- The default was changed to V(true) in Ansible 2.5.
|
|
42
42
|
type: bool
|
|
43
43
|
default: yes
|
|
44
44
|
validate_checksum:
|
|
@@ -51,7 +51,7 @@ options:
|
|
|
51
51
|
version_added: '1.2'
|
|
52
52
|
description:
|
|
53
53
|
- Allows you to override the default behavior of appending hostname/path/to/file to the destination.
|
|
54
|
-
- If
|
|
54
|
+
- If O(dest) ends with '/', it will use the basename of the source file, similar to the copy module.
|
|
55
55
|
- This can be useful if working with a single host, or if retrieving files that are uniquely named per host.
|
|
56
56
|
- If using multiple hosts with the same filename, the file will be overwritten for each host.
|
|
57
57
|
type: bool
|
|
@@ -85,10 +85,10 @@ notes:
|
|
|
85
85
|
remote or local hosts causing a C(MemoryError). Due to this it is
|
|
86
86
|
advisable to run this module without C(become) whenever possible.
|
|
87
87
|
- Prior to Ansible 2.5 this module would not fail if reading the remote
|
|
88
|
-
file was impossible unless
|
|
88
|
+
file was impossible unless O(fail_on_missing) was set.
|
|
89
89
|
- In Ansible 2.5 or later, playbook authors are encouraged to use
|
|
90
90
|
C(fail_when) or C(ignore_errors) to get this ability. They may
|
|
91
|
-
also explicitly set
|
|
91
|
+
also explicitly set O(fail_on_missing) to V(false) to get the
|
|
92
92
|
non-failing behaviour.
|
|
93
93
|
seealso:
|
|
94
94
|
- module: ansible.builtin.copy
|
ansible/modules/file.py
CHANGED
|
@@ -17,7 +17,7 @@ extends_documentation_fragment: [files, action_common_attributes]
|
|
|
17
17
|
description:
|
|
18
18
|
- Set attributes of files, directories, or symlinks and their targets.
|
|
19
19
|
- Alternatively, remove files, symlinks or directories.
|
|
20
|
-
- Many other modules support the same options as the
|
|
20
|
+
- Many other modules support the same options as the M(ansible.builtin.file) module - including M(ansible.builtin.copy),
|
|
21
21
|
M(ansible.builtin.template), and M(ansible.builtin.assemble).
|
|
22
22
|
- For Windows targets, use the M(ansible.windows.win_file) module instead.
|
|
23
23
|
options:
|
|
@@ -29,35 +29,35 @@ options:
|
|
|
29
29
|
aliases: [ dest, name ]
|
|
30
30
|
state:
|
|
31
31
|
description:
|
|
32
|
-
- If
|
|
32
|
+
- If V(absent), directories will be recursively deleted, and files or symlinks will
|
|
33
33
|
be unlinked. In the case of a directory, if C(diff) is declared, you will see the files and folders deleted listed
|
|
34
|
-
under C(path_contents). Note that
|
|
34
|
+
under C(path_contents). Note that V(absent) will not cause M(ansible.builtin.file) to fail if the O(path) does
|
|
35
35
|
not exist as the state did not change.
|
|
36
|
-
- If
|
|
36
|
+
- If V(directory), all intermediate subdirectories will be created if they
|
|
37
37
|
do not exist. Since Ansible 1.7 they will be created with the supplied permissions.
|
|
38
|
-
- If
|
|
39
|
-
- If
|
|
40
|
-
Set to
|
|
41
|
-
- If
|
|
42
|
-
- If
|
|
43
|
-
- If
|
|
38
|
+
- If V(file), with no other options, returns the current state of C(path).
|
|
39
|
+
- If V(file), even with other options (such as O(mode)), the file will be modified if it exists but will NOT be created if it does not exist.
|
|
40
|
+
Set to V(touch) or use the M(ansible.builtin.copy) or M(ansible.builtin.template) module if you want to create the file if it does not exist.
|
|
41
|
+
- If V(hard), the hard link will be created or changed.
|
|
42
|
+
- If V(link), the symbolic link will be created or changed.
|
|
43
|
+
- If V(touch) (new in 1.4), an empty file will be created if the file does not
|
|
44
44
|
exist, while an existing file or directory will receive updated file access and
|
|
45
|
-
modification times (similar to the way
|
|
46
|
-
- Default is the current state of the file if it exists,
|
|
45
|
+
modification times (similar to the way V(touch) works from the command line).
|
|
46
|
+
- Default is the current state of the file if it exists, V(directory) if O(recurse=yes), or V(file) otherwise.
|
|
47
47
|
type: str
|
|
48
48
|
choices: [ absent, directory, file, hard, link, touch ]
|
|
49
49
|
src:
|
|
50
50
|
description:
|
|
51
51
|
- Path of the file to link to.
|
|
52
|
-
- This applies only to
|
|
53
|
-
- For
|
|
54
|
-
- Relative paths are relative to the file being created (
|
|
52
|
+
- This applies only to O(state=link) and O(state=hard).
|
|
53
|
+
- For O(state=link), this will also accept a non-existing path.
|
|
54
|
+
- Relative paths are relative to the file being created (O(path)) which is how
|
|
55
55
|
the Unix command C(ln -s SRC DEST) treats relative paths.
|
|
56
56
|
type: path
|
|
57
57
|
recurse:
|
|
58
58
|
description:
|
|
59
59
|
- Recursively set the specified file attributes on directory contents.
|
|
60
|
-
- This applies only when
|
|
60
|
+
- This applies only when O(state) is set to V(directory).
|
|
61
61
|
type: bool
|
|
62
62
|
default: no
|
|
63
63
|
version_added: '1.1'
|
|
@@ -66,27 +66,27 @@ options:
|
|
|
66
66
|
- >
|
|
67
67
|
Force the creation of the symlinks in two cases: the source file does
|
|
68
68
|
not exist (but will appear later); the destination exists and is a file (so, we need to unlink the
|
|
69
|
-
|
|
69
|
+
O(path) file and create symlink to the O(src) file in place of it).
|
|
70
70
|
type: bool
|
|
71
71
|
default: no
|
|
72
72
|
follow:
|
|
73
73
|
description:
|
|
74
74
|
- This flag indicates that filesystem links, if they exist, should be followed.
|
|
75
|
-
-
|
|
76
|
-
- Previous to Ansible 2.5, this was
|
|
75
|
+
- O(follow=yes) and O(state=link) can modify O(src) when combined with parameters such as O(mode).
|
|
76
|
+
- Previous to Ansible 2.5, this was V(false) by default.
|
|
77
77
|
type: bool
|
|
78
78
|
default: yes
|
|
79
79
|
version_added: '1.8'
|
|
80
80
|
modification_time:
|
|
81
81
|
description:
|
|
82
82
|
- This parameter indicates the time the file's modification time should be set to.
|
|
83
|
-
- Should be
|
|
84
|
-
- Default is None meaning that
|
|
83
|
+
- Should be V(preserve) when no modification is required, C(YYYYMMDDHHMM.SS) when using default time format, or V(now).
|
|
84
|
+
- Default is None meaning that V(preserve) is the default for O(state=[file,directory,link,hard]) and V(now) is default for O(state=touch).
|
|
85
85
|
type: str
|
|
86
86
|
version_added: "2.7"
|
|
87
87
|
modification_time_format:
|
|
88
88
|
description:
|
|
89
|
-
- When used with
|
|
89
|
+
- When used with O(modification_time), indicates the time format that must be used.
|
|
90
90
|
- Based on default Python format (see time.strftime doc).
|
|
91
91
|
type: str
|
|
92
92
|
default: "%Y%m%d%H%M.%S"
|
|
@@ -94,13 +94,13 @@ options:
|
|
|
94
94
|
access_time:
|
|
95
95
|
description:
|
|
96
96
|
- This parameter indicates the time the file's access time should be set to.
|
|
97
|
-
- Should be
|
|
98
|
-
- Default is
|
|
97
|
+
- Should be V(preserve) when no modification is required, C(YYYYMMDDHHMM.SS) when using default time format, or V(now).
|
|
98
|
+
- Default is V(None) meaning that V(preserve) is the default for O(state=[file,directory,link,hard]) and V(now) is default for O(state=touch).
|
|
99
99
|
type: str
|
|
100
100
|
version_added: '2.7'
|
|
101
101
|
access_time_format:
|
|
102
102
|
description:
|
|
103
|
-
- When used with
|
|
103
|
+
- When used with O(access_time), indicates the time format that must be used.
|
|
104
104
|
- Based on default Python format (see time.strftime doc).
|
|
105
105
|
type: str
|
|
106
106
|
default: "%Y%m%d%H%M.%S"
|
|
@@ -216,13 +216,13 @@ EXAMPLES = r'''
|
|
|
216
216
|
'''
|
|
217
217
|
RETURN = r'''
|
|
218
218
|
dest:
|
|
219
|
-
description: Destination file/path, equal to the value passed to
|
|
220
|
-
returned: state=touch, state=hard, state=link
|
|
219
|
+
description: Destination file/path, equal to the value passed to O(path).
|
|
220
|
+
returned: O(state=touch), O(state=hard), O(state=link)
|
|
221
221
|
type: str
|
|
222
222
|
sample: /path/to/file.txt
|
|
223
223
|
path:
|
|
224
|
-
description: Destination file/path, equal to the value passed to
|
|
225
|
-
returned: state=absent, state=directory, state=file
|
|
224
|
+
description: Destination file/path, equal to the value passed to O(path).
|
|
225
|
+
returned: O(state=absent), O(state=directory), O(state=file)
|
|
226
226
|
type: str
|
|
227
227
|
sample: /path/to/file.txt
|
|
228
228
|
'''
|
|
@@ -237,7 +237,7 @@ from pwd import getpwnam, getpwuid
|
|
|
237
237
|
from grp import getgrnam, getgrgid
|
|
238
238
|
|
|
239
239
|
from ansible.module_utils.basic import AnsibleModule
|
|
240
|
-
from ansible.module_utils.
|
|
240
|
+
from ansible.module_utils.common.text.converters import to_bytes, to_native
|
|
241
241
|
|
|
242
242
|
|
|
243
243
|
# There will only be a single AnsibleModule object per module
|