ansible-core 2.16.7__py3-none-any.whl → 2.17.0__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/__init__.py +1 -3
- ansible/__main__.py +1 -0
- ansible/_vendor/__init__.py +1 -2
- ansible/cli/__init__.py +7 -8
- ansible/cli/adhoc.py +1 -2
- ansible/cli/arguments/__init__.py +1 -2
- ansible/cli/arguments/option_helpers.py +1 -2
- ansible/cli/config.py +1 -2
- ansible/cli/console.py +1 -2
- ansible/cli/doc.py +326 -202
- ansible/cli/galaxy.py +9 -3
- ansible/cli/inventory.py +4 -6
- ansible/cli/playbook.py +1 -2
- ansible/cli/pull.py +4 -5
- ansible/cli/scripts/ansible_connection_cli_stub.py +1 -4
- ansible/cli/vault.py +1 -2
- ansible/collections/list.py +1 -0
- ansible/compat/__init__.py +1 -4
- ansible/compat/importlib_resources.py +1 -2
- ansible/compat/{selectors/__init__.py → selectors.py} +12 -12
- ansible/config/ansible_builtin_runtime.yml +2 -0
- ansible/config/base.yml +154 -149
- ansible/config/manager.py +33 -25
- ansible/constants.py +1 -2
- ansible/context.py +1 -4
- ansible/errors/__init__.py +1 -3
- ansible/errors/yaml_strings.py +1 -3
- ansible/executor/__init__.py +1 -3
- ansible/executor/discovery/python_target.py +1 -2
- ansible/executor/interpreter_discovery.py +9 -8
- ansible/executor/module_common.py +1 -3
- ansible/executor/play_iterator.py +1 -3
- ansible/executor/playbook_executor.py +1 -3
- ansible/executor/powershell/module_manifest.py +2 -3
- ansible/executor/process/__init__.py +1 -3
- ansible/executor/process/worker.py +1 -3
- ansible/executor/stats.py +1 -3
- ansible/executor/task_executor.py +2 -3
- ansible/executor/task_queue_manager.py +1 -3
- ansible/executor/task_result.py +2 -3
- ansible/galaxy/__init__.py +1 -2
- ansible/galaxy/api.py +10 -2
- ansible/galaxy/collection/__init__.py +38 -24
- ansible/galaxy/collection/concrete_artifact_manager.py +1 -2
- ansible/galaxy/collection/galaxy_api_proxy.py +1 -2
- ansible/galaxy/collection/gpg.py +4 -2
- ansible/galaxy/data/apb/meta/main.yml.j2 +0 -15
- ansible/galaxy/data/container/meta/main.yml.j2 +0 -18
- ansible/galaxy/data/default/role/meta/main.yml.j2 +0 -18
- ansible/galaxy/data/network/cliconf_plugins/example.py.j2 +1 -2
- ansible/galaxy/data/network/library/example_command.py.j2 +1 -2
- ansible/galaxy/data/network/library/example_config.py.j2 +1 -2
- ansible/galaxy/data/network/library/example_facts.py.j2 +1 -2
- ansible/galaxy/data/network/meta/main.yml.j2 +0 -15
- ansible/galaxy/data/network/module_utils/example.py.j2 +1 -2
- ansible/galaxy/data/network/netconf_plugins/example.py.j2 +1 -2
- ansible/galaxy/data/network/terminal_plugins/example.py.j2 +1 -2
- ansible/galaxy/dependency_resolution/__init__.py +1 -2
- ansible/galaxy/dependency_resolution/dataclasses.py +5 -6
- ansible/galaxy/dependency_resolution/errors.py +1 -2
- ansible/galaxy/dependency_resolution/providers.py +3 -4
- ansible/galaxy/dependency_resolution/reporters.py +2 -3
- ansible/galaxy/dependency_resolution/resolvers.py +1 -2
- ansible/galaxy/dependency_resolution/versioning.py +1 -2
- ansible/galaxy/role.py +2 -3
- ansible/galaxy/token.py +1 -2
- ansible/galaxy/user_agent.py +1 -2
- ansible/inventory/data.py +1 -2
- ansible/inventory/group.py +1 -2
- ansible/inventory/helpers.py +1 -2
- ansible/inventory/host.py +1 -3
- ansible/inventory/manager.py +1 -2
- ansible/module_utils/_text.py +1 -2
- ansible/module_utils/ansible_release.py +3 -5
- ansible/module_utils/api.py +1 -2
- ansible/module_utils/basic.py +113 -158
- ansible/module_utils/common/_collections_compat.py +1 -2
- ansible/module_utils/common/_utils.py +1 -3
- ansible/module_utils/common/arg_spec.py +1 -2
- ansible/module_utils/common/collections.py +1 -2
- ansible/module_utils/common/dict_transformations.py +1 -2
- ansible/module_utils/common/file.py +10 -5
- ansible/module_utils/common/json.py +1 -3
- ansible/module_utils/common/locale.py +1 -2
- ansible/module_utils/common/network.py +2 -3
- ansible/module_utils/common/parameters.py +9 -9
- ansible/module_utils/common/process.py +12 -5
- ansible/module_utils/common/respawn.py +2 -3
- ansible/module_utils/common/sys_info.py +1 -2
- ansible/module_utils/common/text/converters.py +1 -2
- ansible/module_utils/common/text/formatters.py +1 -2
- ansible/module_utils/common/validation.py +5 -6
- ansible/module_utils/common/warnings.py +1 -2
- ansible/module_utils/common/yaml.py +1 -2
- ansible/module_utils/compat/datetime.py +1 -3
- ansible/module_utils/compat/importlib.py +21 -13
- ansible/module_utils/compat/paramiko.py +1 -2
- ansible/module_utils/compat/selectors.py +10 -34
- ansible/module_utils/compat/selinux.py +1 -2
- ansible/module_utils/compat/typing.py +1 -2
- ansible/module_utils/compat/version.py +1 -2
- ansible/module_utils/connection.py +1 -2
- ansible/module_utils/csharp/Ansible.Basic.cs +20 -3
- ansible/module_utils/distro/__init__.py +3 -4
- ansible/module_utils/distro/_distro.py +230 -234
- ansible/module_utils/errors.py +1 -2
- ansible/module_utils/facts/__init__.py +1 -2
- ansible/module_utils/facts/ansible_collector.py +1 -2
- ansible/module_utils/facts/collector.py +1 -2
- ansible/module_utils/facts/compat.py +1 -2
- ansible/module_utils/facts/default_collectors.py +1 -2
- ansible/module_utils/facts/hardware/aix.py +1 -2
- ansible/module_utils/facts/hardware/base.py +1 -2
- ansible/module_utils/facts/hardware/darwin.py +1 -2
- ansible/module_utils/facts/hardware/dragonfly.py +1 -2
- ansible/module_utils/facts/hardware/freebsd.py +1 -2
- ansible/module_utils/facts/hardware/hpux.py +1 -2
- ansible/module_utils/facts/hardware/hurd.py +1 -2
- ansible/module_utils/facts/hardware/linux.py +8 -6
- ansible/module_utils/facts/hardware/netbsd.py +1 -2
- ansible/module_utils/facts/hardware/openbsd.py +1 -2
- ansible/module_utils/facts/hardware/sunos.py +2 -3
- ansible/module_utils/facts/namespace.py +1 -2
- ansible/module_utils/facts/network/aix.py +1 -2
- ansible/module_utils/facts/network/base.py +1 -2
- ansible/module_utils/facts/network/darwin.py +1 -2
- ansible/module_utils/facts/network/dragonfly.py +1 -2
- ansible/module_utils/facts/network/fc_wwn.py +1 -2
- ansible/module_utils/facts/network/freebsd.py +1 -2
- ansible/module_utils/facts/network/generic_bsd.py +1 -2
- ansible/module_utils/facts/network/hpux.py +1 -2
- ansible/module_utils/facts/network/hurd.py +1 -2
- ansible/module_utils/facts/network/iscsi.py +1 -2
- ansible/module_utils/facts/network/linux.py +1 -2
- ansible/module_utils/facts/network/netbsd.py +1 -2
- ansible/module_utils/facts/network/nvme.py +1 -2
- ansible/module_utils/facts/network/openbsd.py +1 -2
- ansible/module_utils/facts/network/sunos.py +1 -2
- ansible/module_utils/facts/other/facter.py +1 -2
- ansible/module_utils/facts/other/ohai.py +1 -2
- ansible/module_utils/facts/packages.py +1 -2
- ansible/module_utils/facts/sysctl.py +1 -2
- ansible/module_utils/facts/system/apparmor.py +1 -2
- ansible/module_utils/facts/system/caps.py +1 -2
- ansible/module_utils/facts/system/chroot.py +1 -2
- ansible/module_utils/facts/system/cmdline.py +1 -2
- ansible/module_utils/facts/system/date_time.py +1 -2
- ansible/module_utils/facts/system/distribution.py +4 -5
- ansible/module_utils/facts/system/dns.py +1 -2
- ansible/module_utils/facts/system/env.py +1 -2
- ansible/module_utils/facts/system/fips.py +1 -2
- ansible/module_utils/facts/system/loadavg.py +1 -2
- ansible/module_utils/facts/system/local.py +1 -2
- ansible/module_utils/facts/system/lsb.py +1 -2
- ansible/module_utils/facts/system/pkg_mgr.py +7 -30
- ansible/module_utils/facts/system/platform.py +1 -2
- ansible/module_utils/facts/system/python.py +1 -2
- ansible/module_utils/facts/system/selinux.py +1 -2
- ansible/module_utils/facts/system/service_mgr.py +1 -2
- ansible/module_utils/facts/system/ssh_pub_keys.py +1 -2
- ansible/module_utils/facts/system/user.py +1 -2
- ansible/module_utils/facts/timeout.py +1 -2
- ansible/module_utils/facts/utils.py +1 -2
- ansible/module_utils/facts/virtual/base.py +1 -2
- ansible/module_utils/facts/virtual/dragonfly.py +1 -2
- ansible/module_utils/facts/virtual/freebsd.py +1 -2
- ansible/module_utils/facts/virtual/hpux.py +1 -2
- ansible/module_utils/facts/virtual/linux.py +1 -2
- ansible/module_utils/facts/virtual/netbsd.py +1 -2
- ansible/module_utils/facts/virtual/openbsd.py +1 -2
- ansible/module_utils/facts/virtual/sunos.py +1 -2
- ansible/module_utils/facts/virtual/sysctl.py +1 -2
- ansible/module_utils/json_utils.py +1 -2
- ansible/module_utils/parsing/convert_bool.py +1 -2
- ansible/module_utils/powershell/Ansible.ModuleUtils.Legacy.psm1 +5 -2
- ansible/module_utils/powershell/Ansible.ModuleUtils.WebRequest.psm1 +1 -1
- ansible/module_utils/pycompat24.py +24 -4
- ansible/module_utils/service.py +31 -5
- ansible/module_utils/six/__init__.py +1 -1
- ansible/module_utils/splitter.py +1 -2
- ansible/module_utils/urls.py +335 -1052
- ansible/module_utils/yumdnf.py +13 -35
- ansible/modules/add_host.py +1 -2
- ansible/modules/apt.py +38 -22
- ansible/modules/apt_key.py +1 -2
- ansible/modules/apt_repository.py +18 -10
- ansible/modules/assemble.py +1 -2
- ansible/modules/assert.py +8 -4
- ansible/modules/async_status.py +17 -14
- ansible/modules/async_wrapper.py +11 -9
- ansible/modules/blockinfile.py +2 -3
- ansible/modules/command.py +1 -2
- ansible/modules/copy.py +4 -76
- ansible/modules/cron.py +3 -3
- ansible/modules/deb822_repository.py +5 -5
- ansible/modules/debconf.py +19 -8
- ansible/modules/debug.py +1 -2
- ansible/modules/dnf.py +39 -46
- ansible/modules/dnf5.py +28 -26
- ansible/modules/dpkg_selections.py +1 -2
- ansible/modules/expect.py +23 -15
- ansible/modules/fail.py +1 -2
- ansible/modules/fetch.py +1 -2
- ansible/modules/file.py +4 -3
- ansible/modules/find.py +18 -5
- ansible/modules/gather_facts.py +1 -2
- ansible/modules/get_url.py +2 -3
- ansible/modules/getent.py +2 -3
- ansible/modules/git.py +28 -17
- ansible/modules/group.py +1 -2
- ansible/modules/group_by.py +1 -2
- ansible/modules/hostname.py +2 -19
- ansible/modules/import_playbook.py +1 -2
- ansible/modules/import_role.py +9 -2
- ansible/modules/import_tasks.py +1 -2
- ansible/modules/include_role.py +1 -2
- ansible/modules/include_tasks.py +1 -2
- ansible/modules/include_vars.py +1 -2
- ansible/modules/iptables.py +38 -21
- ansible/modules/known_hosts.py +15 -8
- ansible/modules/lineinfile.py +1 -6
- ansible/modules/meta.py +3 -2
- ansible/modules/package.py +6 -5
- ansible/modules/package_facts.py +1 -2
- ansible/modules/pause.py +2 -3
- ansible/modules/ping.py +1 -2
- ansible/modules/pip.py +40 -20
- ansible/modules/raw.py +1 -2
- ansible/modules/reboot.py +1 -2
- ansible/modules/replace.py +7 -5
- ansible/modules/rpm_key.py +1 -2
- ansible/modules/script.py +1 -2
- ansible/modules/service.py +3 -21
- ansible/modules/service_facts.py +3 -12
- ansible/modules/set_fact.py +1 -2
- ansible/modules/set_stats.py +1 -2
- ansible/modules/setup.py +1 -2
- ansible/modules/shell.py +1 -2
- ansible/modules/slurp.py +1 -2
- ansible/modules/stat.py +1 -2
- ansible/modules/subversion.py +2 -3
- ansible/modules/systemd.py +12 -9
- ansible/modules/systemd_service.py +12 -9
- ansible/modules/sysvinit.py +7 -2
- ansible/modules/tempfile.py +7 -2
- ansible/modules/template.py +2 -3
- ansible/modules/unarchive.py +13 -3
- ansible/modules/uri.py +12 -15
- ansible/modules/user.py +11 -4
- ansible/modules/validate_argument_spec.py +15 -16
- ansible/modules/wait_for.py +1 -2
- ansible/modules/wait_for_connection.py +1 -2
- ansible/modules/yum_repository.py +2 -3
- ansible/parsing/__init__.py +1 -3
- ansible/parsing/ajson.py +1 -3
- ansible/parsing/dataloader.py +23 -12
- ansible/parsing/mod_args.py +6 -4
- ansible/parsing/plugin_docs.py +1 -2
- ansible/parsing/quoting.py +1 -3
- ansible/parsing/splitter.py +1 -3
- ansible/parsing/utils/__init__.py +1 -3
- ansible/parsing/utils/addresses.py +1 -3
- ansible/parsing/utils/jsonify.py +1 -3
- ansible/parsing/utils/yaml.py +1 -3
- ansible/parsing/vault/__init__.py +6 -8
- ansible/parsing/yaml/__init__.py +1 -3
- ansible/parsing/yaml/constructor.py +1 -3
- ansible/parsing/yaml/dumper.py +1 -3
- ansible/parsing/yaml/loader.py +1 -3
- ansible/parsing/yaml/objects.py +1 -3
- ansible/playbook/__init__.py +1 -3
- ansible/playbook/attribute.py +1 -3
- ansible/playbook/base.py +2 -3
- ansible/playbook/block.py +1 -3
- ansible/playbook/collectionsearch.py +1 -2
- ansible/playbook/conditional.py +1 -3
- ansible/playbook/delegatable.py +1 -0
- ansible/playbook/handler.py +2 -4
- ansible/playbook/handler_task_include.py +1 -3
- ansible/playbook/helpers.py +1 -4
- ansible/playbook/included_file.py +4 -4
- ansible/playbook/loop_control.py +1 -3
- ansible/playbook/notifiable.py +1 -0
- ansible/playbook/play.py +1 -3
- ansible/playbook/play_context.py +1 -3
- ansible/playbook/playbook_include.py +1 -3
- ansible/playbook/role/__init__.py +1 -3
- ansible/playbook/role/definition.py +1 -3
- ansible/playbook/role/include.py +1 -3
- ansible/playbook/role/metadata.py +1 -3
- ansible/playbook/role/requirement.py +1 -3
- ansible/playbook/role_include.py +2 -10
- ansible/playbook/taggable.py +1 -3
- ansible/playbook/task.py +2 -4
- ansible/playbook/task_include.py +1 -3
- ansible/plugins/__init__.py +4 -5
- ansible/plugins/action/__init__.py +19 -13
- ansible/plugins/action/add_host.py +2 -4
- ansible/plugins/action/assemble.py +2 -3
- ansible/plugins/action/assert.py +1 -2
- ansible/plugins/action/async_status.py +1 -2
- ansible/plugins/action/command.py +1 -2
- ansible/plugins/action/copy.py +12 -9
- ansible/plugins/action/debug.py +1 -2
- ansible/plugins/action/dnf.py +4 -4
- ansible/plugins/action/fail.py +1 -2
- ansible/plugins/action/fetch.py +2 -3
- ansible/plugins/action/gather_facts.py +3 -4
- ansible/plugins/action/group_by.py +1 -2
- ansible/plugins/action/include_vars.py +1 -2
- ansible/plugins/action/normal.py +1 -2
- ansible/plugins/action/package.py +36 -21
- ansible/plugins/action/pause.py +1 -2
- ansible/plugins/action/raw.py +2 -3
- ansible/plugins/action/reboot.py +30 -15
- ansible/plugins/action/script.py +3 -4
- ansible/plugins/action/service.py +1 -2
- ansible/plugins/action/set_fact.py +1 -2
- ansible/plugins/action/set_stats.py +1 -2
- ansible/plugins/action/shell.py +1 -2
- ansible/plugins/action/template.py +1 -2
- ansible/plugins/action/unarchive.py +1 -2
- ansible/plugins/action/uri.py +2 -3
- ansible/plugins/action/validate_argument_spec.py +1 -2
- ansible/plugins/action/wait_for_connection.py +2 -3
- ansible/plugins/become/__init__.py +1 -2
- ansible/plugins/become/runas.py +1 -2
- ansible/plugins/become/su.py +1 -2
- ansible/plugins/become/sudo.py +1 -2
- ansible/plugins/cache/__init__.py +3 -3
- ansible/plugins/cache/base.py +1 -2
- ansible/plugins/cache/jsonfile.py +1 -3
- ansible/plugins/cache/memory.py +1 -2
- ansible/plugins/callback/__init__.py +2 -4
- ansible/plugins/callback/default.py +2 -3
- ansible/plugins/callback/junit.py +1 -2
- ansible/plugins/callback/minimal.py +1 -3
- ansible/plugins/callback/oneline.py +1 -3
- ansible/plugins/callback/tree.py +1 -2
- ansible/plugins/cliconf/__init__.py +1 -2
- ansible/plugins/connection/__init__.py +4 -5
- ansible/plugins/connection/local.py +3 -4
- ansible/plugins/connection/paramiko_ssh.py +1 -2
- ansible/plugins/connection/psrp.py +1 -2
- ansible/plugins/connection/ssh.py +18 -54
- ansible/plugins/connection/winrm.py +3 -4
- ansible/plugins/doc_fragments/action_common_attributes.py +2 -3
- ansible/plugins/doc_fragments/action_core.py +3 -4
- ansible/plugins/doc_fragments/backup.py +1 -2
- ansible/plugins/doc_fragments/connection_pipelining.py +1 -2
- ansible/plugins/doc_fragments/constructed.py +1 -2
- ansible/plugins/doc_fragments/decrypt.py +2 -3
- ansible/plugins/doc_fragments/default_callback.py +1 -2
- ansible/plugins/doc_fragments/files.py +1 -2
- ansible/plugins/doc_fragments/inventory_cache.py +1 -2
- ansible/plugins/doc_fragments/result_format_callback.py +1 -2
- ansible/plugins/doc_fragments/return_common.py +1 -2
- ansible/plugins/doc_fragments/shell_common.py +1 -2
- ansible/plugins/doc_fragments/shell_windows.py +1 -2
- ansible/plugins/doc_fragments/template_common.py +1 -2
- ansible/plugins/doc_fragments/url.py +1 -2
- ansible/plugins/doc_fragments/url_windows.py +1 -2
- ansible/plugins/doc_fragments/validate.py +1 -2
- ansible/plugins/doc_fragments/vars_plugin_staging.py +1 -2
- ansible/plugins/filter/__init__.py +1 -2
- ansible/plugins/filter/b64decode.yml +8 -8
- ansible/plugins/filter/b64encode.yml +4 -4
- ansible/plugins/filter/comment.yml +1 -1
- ansible/plugins/filter/core.py +11 -9
- ansible/plugins/filter/encryption.py +1 -3
- ansible/plugins/filter/extract.yml +1 -1
- ansible/plugins/filter/from_yaml_all.yml +1 -1
- ansible/plugins/filter/human_readable.yml +3 -3
- ansible/plugins/filter/human_to_bytes.yml +2 -2
- ansible/plugins/filter/mandatory.yml +1 -1
- ansible/plugins/filter/mathstuff.py +2 -2
- ansible/plugins/filter/password_hash.yml +3 -2
- ansible/plugins/filter/regex_replace.yml +15 -0
- ansible/plugins/filter/regex_search.yml +12 -0
- ansible/plugins/filter/strftime.yml +2 -9
- ansible/plugins/filter/to_datetime.yml +17 -2
- ansible/plugins/filter/to_nice_json.yml +4 -0
- ansible/plugins/filter/union.yml +1 -1
- ansible/plugins/filter/urls.py +1 -2
- ansible/plugins/filter/urlsplit.py +1 -2
- ansible/plugins/filter/zip.yml +2 -2
- ansible/plugins/filter/zip_longest.yml +1 -1
- ansible/plugins/httpapi/__init__.py +1 -2
- ansible/plugins/inventory/__init__.py +2 -4
- ansible/plugins/inventory/advanced_host_list.py +1 -2
- ansible/plugins/inventory/auto.py +2 -3
- ansible/plugins/inventory/constructed.py +3 -2
- ansible/plugins/inventory/generator.py +1 -2
- ansible/plugins/inventory/host_list.py +1 -2
- ansible/plugins/inventory/ini.py +1 -2
- ansible/plugins/inventory/script.py +122 -3
- ansible/plugins/inventory/toml.py +1 -2
- ansible/plugins/inventory/yaml.py +3 -4
- ansible/plugins/list.py +2 -3
- ansible/plugins/loader.py +10 -11
- ansible/plugins/lookup/__init__.py +1 -3
- ansible/plugins/lookup/config.py +19 -15
- ansible/plugins/lookup/csvfile.py +16 -7
- ansible/plugins/lookup/dict.py +2 -3
- ansible/plugins/lookup/env.py +4 -4
- ansible/plugins/lookup/file.py +1 -2
- ansible/plugins/lookup/fileglob.py +1 -2
- ansible/plugins/lookup/first_found.py +8 -7
- ansible/plugins/lookup/indexed_items.py +1 -2
- ansible/plugins/lookup/ini.py +6 -3
- ansible/plugins/lookup/inventory_hostnames.py +1 -2
- ansible/plugins/lookup/items.py +1 -2
- ansible/plugins/lookup/lines.py +1 -2
- ansible/plugins/lookup/list.py +1 -3
- ansible/plugins/lookup/nested.py +1 -2
- ansible/plugins/lookup/password.py +16 -14
- ansible/plugins/lookup/pipe.py +1 -2
- ansible/plugins/lookup/random_choice.py +1 -2
- ansible/plugins/lookup/sequence.py +21 -52
- ansible/plugins/lookup/subelements.py +1 -2
- ansible/plugins/lookup/template.py +1 -2
- ansible/plugins/lookup/together.py +1 -2
- ansible/plugins/lookup/unvault.py +1 -2
- ansible/plugins/lookup/url.py +9 -11
- ansible/plugins/lookup/varnames.py +1 -2
- ansible/plugins/lookup/vars.py +1 -2
- ansible/plugins/netconf/__init__.py +1 -2
- ansible/plugins/shell/__init__.py +3 -4
- ansible/plugins/shell/cmd.py +1 -2
- ansible/plugins/shell/powershell.py +1 -2
- ansible/plugins/shell/sh.py +1 -2
- ansible/plugins/strategy/__init__.py +33 -21
- ansible/plugins/strategy/debug.py +1 -2
- ansible/plugins/strategy/free.py +17 -7
- ansible/plugins/strategy/host_pinned.py +1 -3
- ansible/plugins/strategy/linear.py +22 -22
- ansible/plugins/terminal/__init__.py +2 -3
- ansible/plugins/test/__init__.py +1 -2
- ansible/plugins/test/change.yml +1 -1
- ansible/plugins/test/changed.yml +1 -1
- ansible/plugins/test/contains.yml +1 -1
- ansible/plugins/test/core.py +2 -4
- ansible/plugins/test/exists.yml +1 -1
- ansible/plugins/test/failed.yml +1 -1
- ansible/plugins/test/failure.yml +1 -1
- ansible/plugins/test/files.py +1 -3
- ansible/plugins/test/finished.yml +3 -3
- ansible/plugins/test/issuperset.yml +1 -1
- ansible/plugins/test/match.yml +1 -1
- ansible/plugins/test/mathstuff.py +1 -2
- ansible/plugins/test/reachable.yml +1 -1
- ansible/plugins/test/regex.yml +1 -1
- ansible/plugins/test/search.yml +1 -1
- ansible/plugins/test/skip.yml +1 -1
- ansible/plugins/test/skipped.yml +1 -1
- ansible/plugins/test/started.yml +1 -1
- ansible/plugins/test/succeeded.yml +1 -1
- ansible/plugins/test/success.yml +1 -1
- ansible/plugins/test/successful.yml +1 -1
- ansible/plugins/test/superset.yml +1 -1
- ansible/plugins/test/unreachable.yml +1 -1
- ansible/plugins/test/uri.py +1 -3
- ansible/plugins/vars/__init__.py +1 -2
- ansible/plugins/vars/host_group_vars.py +2 -3
- ansible/release.py +3 -5
- ansible/template/__init__.py +14 -27
- ansible/template/native_helpers.py +1 -3
- ansible/template/template.py +1 -3
- ansible/template/vars.py +1 -0
- ansible/utils/__init__.py +1 -3
- ansible/utils/cmd_functions.py +1 -2
- ansible/utils/collection_loader/__init__.py +1 -2
- ansible/utils/collection_loader/_collection_config.py +1 -2
- ansible/utils/collection_loader/_collection_finder.py +1 -2
- ansible/utils/collection_loader/_collection_meta.py +1 -2
- ansible/utils/color.py +1 -2
- ansible/utils/context_objects.py +1 -4
- ansible/utils/display.py +89 -30
- ansible/utils/encrypt.py +4 -105
- ansible/utils/fqcn.py +1 -2
- ansible/utils/galaxy.py +1 -3
- ansible/utils/hashing.py +1 -3
- ansible/utils/helpers.py +1 -3
- ansible/utils/jsonrpc.py +1 -2
- ansible/utils/listify.py +1 -3
- ansible/utils/lock.py +1 -3
- ansible/utils/multiprocessing.py +1 -3
- ansible/utils/native_jinja.py +1 -3
- ansible/utils/path.py +1 -2
- ansible/utils/plugin_docs.py +7 -6
- ansible/utils/py3compat.py +17 -55
- ansible/utils/sentinel.py +1 -3
- ansible/utils/shlex.py +1 -3
- ansible/utils/singleton.py +1 -3
- ansible/utils/ssh_functions.py +1 -3
- ansible/utils/unicode.py +1 -3
- ansible/utils/unsafe_proxy.py +1 -2
- ansible/utils/vars.py +6 -8
- ansible/utils/version.py +1 -3
- ansible/vars/clean.py +1 -3
- ansible/vars/fact_cache.py +1 -2
- ansible/vars/hostvars.py +3 -7
- ansible/vars/manager.py +24 -6
- ansible/vars/reserved.py +1 -3
- {ansible_core-2.16.7.data → ansible_core-2.17.0.data}/scripts/ansible-test +1 -2
- {ansible_core-2.16.7.dist-info → ansible_core-2.17.0.dist-info}/METADATA +3 -3
- ansible_core-2.17.0.dist-info/RECORD +987 -0
- ansible_test/__init__.py +1 -2
- ansible_test/_data/completion/docker.txt +7 -9
- ansible_test/_data/completion/remote.txt +6 -7
- ansible_test/_data/requirements/ansible-test.txt +0 -2
- ansible_test/_data/requirements/constraints.txt +1 -6
- ansible_test/_data/requirements/sanity.ansible-doc.txt +3 -3
- ansible_test/_data/requirements/sanity.changelog.txt +3 -3
- ansible_test/_data/requirements/sanity.import.plugin.txt +2 -2
- 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 +7 -7
- ansible_test/_data/requirements/sanity.runtime-metadata.txt +1 -1
- ansible_test/_data/requirements/sanity.validate-modules.txt +3 -3
- ansible_test/_data/requirements/sanity.yamllint.txt +2 -2
- ansible_test/_internal/bootstrap.py +2 -2
- ansible_test/_internal/classification/__init__.py +0 -5
- ansible_test/_internal/commands/integration/cloud/cs.py +1 -1
- ansible_test/_internal/commands/integration/cloud/nios.py +1 -1
- ansible_test/_internal/commands/sanity/__init__.py +1 -27
- ansible_test/_internal/commands/sanity/import.py +0 -18
- ansible_test/_internal/commands/sanity/mypy.py +7 -10
- ansible_test/_internal/commands/units/__init__.py +1 -1
- ansible_test/_internal/config.py +0 -1
- ansible_test/_internal/content_config.py +0 -5
- ansible_test/_internal/coverage_util.py +0 -1
- ansible_test/_internal/docker_util.py +1 -1
- ansible_test/_internal/host_profiles.py +5 -4
- ansible_test/_internal/pypi_proxy.py +1 -8
- ansible_test/_internal/python_requirements.py +1 -119
- ansible_test/_internal/ssh.py +1 -0
- ansible_test/_internal/util.py +1 -1
- ansible_test/_internal/util_common.py +1 -1
- ansible_test/_internal/venv.py +10 -108
- ansible_test/_util/__init__.py +1 -2
- ansible_test/_util/controller/sanity/mypy/ansible-core.ini +0 -6
- ansible_test/_util/controller/sanity/mypy/modules.ini +0 -6
- ansible_test/_util/controller/sanity/pylint/config/ansible-test-target.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/config/ansible-test.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/config/code-smell.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/config/collection.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/config/default.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py +1 -2
- ansible_test/_util/controller/sanity/shellcheck/exclude.txt +0 -1
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py +31 -59
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/module_args.py +0 -7
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py +10 -2
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/utils.py +1 -1
- ansible_test/_util/controller/sanity/yamllint/yamllinter.py +16 -4
- ansible_test/_util/target/__init__.py +1 -2
- ansible_test/_util/target/cli/ansible_test_cli_stub.py +1 -2
- ansible_test/_util/target/common/constants.py +1 -4
- ansible_test/_util/target/injector/python.py +4 -19
- ansible_test/_util/target/pytest/plugins/ansible_forked.py +2 -9
- ansible_test/_util/target/pytest/plugins/ansible_pytest_collections.py +1 -5
- ansible_test/_util/target/pytest/plugins/ansible_pytest_coverage.py +1 -2
- ansible_test/_util/target/sanity/compile/compile.py +3 -12
- ansible_test/_util/target/sanity/import/importer.py +1 -12
- ansible_test/_util/target/setup/bootstrap.sh +49 -105
- ansible_test/_util/target/setup/probe_cgroups.py +1 -2
- ansible_test/_util/target/setup/quiet_pip.py +1 -16
- ansible_test/_util/target/setup/requirements.py +9 -2
- ansible_test/_util/target/tools/virtualenvcheck.py +1 -2
- ansible_test/_util/target/tools/yamlcheck.py +1 -2
- ansible/module_utils/common/_json_compat.py +0 -16
- ansible/module_utils/compat/_selectors2.py +0 -655
- ansible/modules/yum.py +0 -1821
- ansible/plugins/action/yum.py +0 -111
- ansible_core-2.16.7.dist-info/RECORD +0 -1009
- ansible_test/_util/controller/sanity/code-smell/future-import-boilerplate.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/future-import-boilerplate.py +0 -46
- ansible_test/_util/controller/sanity/code-smell/metaclass-boilerplate.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/metaclass-boilerplate.py +0 -44
- ansible_test/_util/controller/sanity/code-smell/no-basestring.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/no-basestring.py +0 -21
- ansible_test/_util/controller/sanity/code-smell/no-dict-iteritems.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/no-dict-iteritems.py +0 -21
- ansible_test/_util/controller/sanity/code-smell/no-dict-iterkeys.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/no-dict-iterkeys.py +0 -21
- ansible_test/_util/controller/sanity/code-smell/no-dict-itervalues.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/no-dict-itervalues.py +0 -21
- ansible_test/_util/controller/sanity/code-smell/no-main-display.json +0 -10
- ansible_test/_util/controller/sanity/code-smell/no-main-display.py +0 -21
- ansible_test/_util/controller/sanity/code-smell/no-unicode-literals.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/no-unicode-literals.py +0 -21
- ansible_test/_util/controller/tools/sslcheck.py +0 -22
- ansible_test/_util/target/common/__init__.py +0 -2
- {ansible_core-2.16.7.dist-info → ansible_core-2.17.0.dist-info}/COPYING +0 -0
- {ansible_core-2.16.7.dist-info → ansible_core-2.17.0.dist-info}/WHEEL +0 -0
- {ansible_core-2.16.7.dist-info → ansible_core-2.17.0.dist-info}/entry_points.txt +0 -0
- {ansible_core-2.16.7.dist-info → ansible_core-2.17.0.dist-info}/top_level.txt +0 -0
ansible/modules/copy.py
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
# Copyright: (c) 2017, Ansible Project
|
|
5
5
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
6
6
|
|
|
7
|
-
from __future__ import
|
|
8
|
-
__metaclass__ = type
|
|
7
|
+
from __future__ import annotations
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
DOCUMENTATION = r'''
|
|
@@ -96,7 +95,7 @@ options:
|
|
|
96
95
|
- If V(true) it will search for O(src) on the managed (remote) node.
|
|
97
96
|
- O(remote_src) supports recursive copying as of version 2.8.
|
|
98
97
|
- O(remote_src) only works with O(mode=preserve) as of version 2.6.
|
|
99
|
-
-
|
|
98
|
+
- Auto-decryption of files does not work when O(remote_src=yes).
|
|
100
99
|
type: bool
|
|
101
100
|
default: no
|
|
102
101
|
version_added: '2.0'
|
|
@@ -273,7 +272,7 @@ mode:
|
|
|
273
272
|
description: Permissions of the target, after execution.
|
|
274
273
|
returned: success
|
|
275
274
|
type: str
|
|
276
|
-
sample:
|
|
275
|
+
sample: '0644'
|
|
277
276
|
size:
|
|
278
277
|
description: Size of the target, after execution.
|
|
279
278
|
returned: success
|
|
@@ -291,7 +290,6 @@ import filecmp
|
|
|
291
290
|
import grp
|
|
292
291
|
import os
|
|
293
292
|
import os.path
|
|
294
|
-
import platform
|
|
295
293
|
import pwd
|
|
296
294
|
import shutil
|
|
297
295
|
import stat
|
|
@@ -300,13 +298,6 @@ import traceback
|
|
|
300
298
|
|
|
301
299
|
from ansible.module_utils.common.text.converters import to_bytes, to_native
|
|
302
300
|
from ansible.module_utils.basic import AnsibleModule
|
|
303
|
-
from ansible.module_utils.common.process import get_bin_path
|
|
304
|
-
from ansible.module_utils.common.locale import get_best_parsable_locale
|
|
305
|
-
from ansible.module_utils.six import PY3
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
# The AnsibleModule object
|
|
309
|
-
module = None
|
|
310
301
|
|
|
311
302
|
|
|
312
303
|
class AnsibleModuleError(Exception):
|
|
@@ -314,21 +305,6 @@ class AnsibleModuleError(Exception):
|
|
|
314
305
|
self.results = results
|
|
315
306
|
|
|
316
307
|
|
|
317
|
-
# Once we get run_command moved into common, we can move this into a common/files module. We can't
|
|
318
|
-
# until then because of the module.run_command() method. We may need to move it into
|
|
319
|
-
# basic::AnsibleModule() until then but if so, make it a private function so that we don't have to
|
|
320
|
-
# keep it for backwards compatibility later.
|
|
321
|
-
def clear_facls(path):
|
|
322
|
-
setfacl = get_bin_path('setfacl')
|
|
323
|
-
# FIXME "setfacl -b" is available on Linux and FreeBSD. There is "setfacl -D e" on z/OS. Others?
|
|
324
|
-
acl_command = [setfacl, '-b', path]
|
|
325
|
-
b_acl_command = [to_bytes(x) for x in acl_command]
|
|
326
|
-
locale = get_best_parsable_locale(module)
|
|
327
|
-
rc, out, err = module.run_command(b_acl_command, environ_update=dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale))
|
|
328
|
-
if rc != 0:
|
|
329
|
-
raise RuntimeError('Error running "{0}": stdout: "{1}"; stderr: "{2}"'.format(' '.join(b_acl_command), out, err))
|
|
330
|
-
|
|
331
|
-
|
|
332
308
|
def split_pre_existing_dir(dirname):
|
|
333
309
|
'''
|
|
334
310
|
Return the first pre-existing directory and a list of the new directories that will be created.
|
|
@@ -529,8 +505,6 @@ def copy_common_dirs(src, dest, module):
|
|
|
529
505
|
|
|
530
506
|
def main():
|
|
531
507
|
|
|
532
|
-
global module
|
|
533
|
-
|
|
534
508
|
module = AnsibleModule(
|
|
535
509
|
# not checking because of daisy chain to file module
|
|
536
510
|
argument_spec=dict(
|
|
@@ -705,54 +679,8 @@ def main():
|
|
|
705
679
|
else:
|
|
706
680
|
raise
|
|
707
681
|
|
|
708
|
-
# might be needed below
|
|
709
|
-
if PY3 and hasattr(os, 'listxattr'):
|
|
710
|
-
try:
|
|
711
|
-
src_has_acls = 'system.posix_acl_access' in os.listxattr(src)
|
|
712
|
-
except Exception as e:
|
|
713
|
-
# assume unwanted ACLs by default
|
|
714
|
-
src_has_acls = True
|
|
715
|
-
|
|
716
682
|
# at this point we should always have tmp file
|
|
717
|
-
module.atomic_move(b_mysrc, dest, unsafe_writes=module.params['unsafe_writes'])
|
|
718
|
-
|
|
719
|
-
if PY3 and hasattr(os, 'listxattr') and platform.system() == 'Linux' and not remote_src:
|
|
720
|
-
# atomic_move used above to copy src into dest might, in some cases,
|
|
721
|
-
# use shutil.copy2 which in turn uses shutil.copystat.
|
|
722
|
-
# Since Python 3.3, shutil.copystat copies file extended attributes:
|
|
723
|
-
# https://docs.python.org/3/library/shutil.html#shutil.copystat
|
|
724
|
-
# os.listxattr (along with others) was added to handle the operation.
|
|
725
|
-
|
|
726
|
-
# This means that on Python 3 we are copying the extended attributes which includes
|
|
727
|
-
# the ACLs on some systems - further limited to Linux as the documentation above claims
|
|
728
|
-
# that the extended attributes are copied only on Linux. Also, os.listxattr is only
|
|
729
|
-
# available on Linux.
|
|
730
|
-
|
|
731
|
-
# If not remote_src, then the file was copied from the controller. In that
|
|
732
|
-
# case, any filesystem ACLs are artifacts of the copy rather than preservation
|
|
733
|
-
# of existing attributes. Get rid of them:
|
|
734
|
-
|
|
735
|
-
if src_has_acls:
|
|
736
|
-
# FIXME If dest has any default ACLs, there are not applied to src now because
|
|
737
|
-
# they were overridden by copystat. Should/can we do anything about this?
|
|
738
|
-
# 'system.posix_acl_default' in os.listxattr(os.path.dirname(b_dest))
|
|
739
|
-
|
|
740
|
-
try:
|
|
741
|
-
clear_facls(dest)
|
|
742
|
-
except ValueError as e:
|
|
743
|
-
if 'setfacl' in to_native(e):
|
|
744
|
-
# No setfacl so we're okay. The controller couldn't have set a facl
|
|
745
|
-
# without the setfacl command
|
|
746
|
-
pass
|
|
747
|
-
else:
|
|
748
|
-
raise
|
|
749
|
-
except RuntimeError as e:
|
|
750
|
-
# setfacl failed.
|
|
751
|
-
if 'Operation not supported' in to_native(e):
|
|
752
|
-
# The file system does not support ACLs.
|
|
753
|
-
pass
|
|
754
|
-
else:
|
|
755
|
-
raise
|
|
683
|
+
module.atomic_move(b_mysrc, dest, unsafe_writes=module.params['unsafe_writes'], keep_dest_attrs=not remote_src)
|
|
756
684
|
|
|
757
685
|
except (IOError, OSError):
|
|
758
686
|
module.fail_json(msg="failed to copy: %s to %s" % (src, dest), traceback=traceback.format_exc())
|
ansible/modules/cron.py
CHANGED
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
# Copyright: (c) 2015, Luca Berruti <nadirio@gmail.com>
|
|
8
8
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
9
9
|
|
|
10
|
-
from __future__ import
|
|
11
|
-
__metaclass__ = type
|
|
10
|
+
from __future__ import annotations
|
|
12
11
|
|
|
13
12
|
|
|
14
13
|
DOCUMENTATION = r'''
|
|
@@ -215,6 +214,7 @@ import sys
|
|
|
215
214
|
import tempfile
|
|
216
215
|
|
|
217
216
|
from ansible.module_utils.basic import AnsibleModule
|
|
217
|
+
from ansible.module_utils.common.file import S_IRWU_RWG_RWO
|
|
218
218
|
from ansible.module_utils.common.text.converters import to_bytes, to_native
|
|
219
219
|
from ansible.module_utils.six.moves import shlex_quote
|
|
220
220
|
|
|
@@ -308,7 +308,7 @@ class CronTab(object):
|
|
|
308
308
|
fileh = open(self.b_cron_file, 'wb')
|
|
309
309
|
else:
|
|
310
310
|
filed, path = tempfile.mkstemp(prefix='crontab')
|
|
311
|
-
os.chmod(path,
|
|
311
|
+
os.chmod(path, S_IRWU_RWG_RWO)
|
|
312
312
|
fileh = os.fdopen(filed, 'wb')
|
|
313
313
|
|
|
314
314
|
fileh.write(to_bytes(self.render()))
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
# Copyright: Contributors to the Ansible project
|
|
3
3
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
4
4
|
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
DOCUMENTATION = '''
|
|
9
8
|
author: 'Ansible Core Team (@ansible)'
|
|
@@ -237,6 +236,7 @@ import traceback
|
|
|
237
236
|
from ansible.module_utils.basic import AnsibleModule
|
|
238
237
|
from ansible.module_utils.basic import missing_required_lib
|
|
239
238
|
from ansible.module_utils.common.collections import is_sequence
|
|
239
|
+
from ansible.module_utils.common.file import S_IRWXU_RXG_RXO, S_IRWU_RG_RO
|
|
240
240
|
from ansible.module_utils.common.text.converters import to_bytes
|
|
241
241
|
from ansible.module_utils.common.text.converters import to_native
|
|
242
242
|
from ansible.module_utils.six import raise_from # type: ignore[attr-defined]
|
|
@@ -260,7 +260,7 @@ def ensure_keyrings_dir(module):
|
|
|
260
260
|
changed = False
|
|
261
261
|
if not os.path.isdir(KEYRINGS_DIR):
|
|
262
262
|
if not module.check_mode:
|
|
263
|
-
os.mkdir(KEYRINGS_DIR,
|
|
263
|
+
os.mkdir(KEYRINGS_DIR, S_IRWXU_RXG_RXO)
|
|
264
264
|
changed |= True
|
|
265
265
|
|
|
266
266
|
changed |= module.set_fs_attributes_if_different(
|
|
@@ -354,7 +354,7 @@ def write_signed_by_key(module, v, slug):
|
|
|
354
354
|
module.atomic_move(tmpfile, filename)
|
|
355
355
|
changed |= True
|
|
356
356
|
|
|
357
|
-
changed |= module.set_mode_if_different(filename,
|
|
357
|
+
changed |= module.set_mode_if_different(filename, S_IRWU_RG_RO, False)
|
|
358
358
|
|
|
359
359
|
return changed, filename, None
|
|
360
360
|
|
|
@@ -501,7 +501,7 @@ def main():
|
|
|
501
501
|
|
|
502
502
|
deb822 = Deb822()
|
|
503
503
|
signed_by_filename = None
|
|
504
|
-
for key, value in params.items():
|
|
504
|
+
for key, value in sorted(params.items()):
|
|
505
505
|
if value is None:
|
|
506
506
|
continue
|
|
507
507
|
|
ansible/modules/debconf.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: (c) 2014, Brian Coca <briancoca+ansible@gmail.com>
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
DOCUMENTATION = r'''
|
|
@@ -71,12 +70,14 @@ options:
|
|
|
71
70
|
- The type of the value supplied.
|
|
72
71
|
- It is highly recommended to add C(no_log=True) to task while specifying O(vtype=password).
|
|
73
72
|
- V(seen) was added in Ansible 2.2.
|
|
73
|
+
- After Ansible 2.17, user can specify C(value) as a list, if C(vtype) is set as V(multiselect).
|
|
74
74
|
type: str
|
|
75
75
|
choices: [ boolean, error, multiselect, note, password, seen, select, string, text, title ]
|
|
76
76
|
value:
|
|
77
77
|
description:
|
|
78
|
-
-
|
|
79
|
-
|
|
78
|
+
- Value to set the configuration to.
|
|
79
|
+
- After Ansible 2.17, C(value) is of type 'raw'.
|
|
80
|
+
type: raw
|
|
80
81
|
aliases: [ answer ]
|
|
81
82
|
unseen:
|
|
82
83
|
description:
|
|
@@ -124,7 +125,7 @@ EXAMPLES = r'''
|
|
|
124
125
|
|
|
125
126
|
RETURN = r'''#'''
|
|
126
127
|
|
|
127
|
-
from ansible.module_utils.common.text.converters import to_text
|
|
128
|
+
from ansible.module_utils.common.text.converters import to_text, to_native
|
|
128
129
|
from ansible.module_utils.basic import AnsibleModule
|
|
129
130
|
|
|
130
131
|
|
|
@@ -185,7 +186,7 @@ def main():
|
|
|
185
186
|
name=dict(type='str', required=True, aliases=['pkg']),
|
|
186
187
|
question=dict(type='str', aliases=['selection', 'setting']),
|
|
187
188
|
vtype=dict(type='str', choices=['boolean', 'error', 'multiselect', 'note', 'password', 'seen', 'select', 'string', 'text', 'title']),
|
|
188
|
-
value=dict(type='
|
|
189
|
+
value=dict(type='raw', aliases=['answer']),
|
|
189
190
|
unseen=dict(type='bool', default=False),
|
|
190
191
|
),
|
|
191
192
|
required_together=(['question', 'vtype', 'value'],),
|
|
@@ -218,15 +219,25 @@ def main():
|
|
|
218
219
|
if vtype == 'boolean':
|
|
219
220
|
value = to_text(value).lower()
|
|
220
221
|
existing = to_text(prev[question]).lower()
|
|
221
|
-
|
|
222
|
-
if vtype == 'password':
|
|
222
|
+
elif vtype == 'password':
|
|
223
223
|
existing = get_password_value(module, pkg, question, vtype)
|
|
224
|
+
elif vtype == 'multiselect' and isinstance(value, list):
|
|
225
|
+
try:
|
|
226
|
+
value = sorted(value)
|
|
227
|
+
except TypeError as exc:
|
|
228
|
+
module.fail_json(msg="Invalid value provided for 'multiselect': %s" % to_native(exc))
|
|
229
|
+
existing = sorted([i.strip() for i in existing.split(",")])
|
|
224
230
|
|
|
225
231
|
if value != existing:
|
|
226
232
|
changed = True
|
|
227
233
|
|
|
228
234
|
if changed:
|
|
229
235
|
if not module.check_mode:
|
|
236
|
+
if vtype == 'multiselect' and isinstance(value, list):
|
|
237
|
+
try:
|
|
238
|
+
value = ", ".join(value)
|
|
239
|
+
except TypeError as exc:
|
|
240
|
+
module.fail_json(msg="Invalid value provided for 'multiselect': %s" % to_native(exc))
|
|
230
241
|
rc, msg, e = set_selection(module, pkg, question, vtype, value, unseen)
|
|
231
242
|
if rc:
|
|
232
243
|
module.fail_json(msg=e)
|
ansible/modules/debug.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: (c) 2012 Dag Wieers <dag@wieers.com>
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
DOCUMENTATION = r'''
|
ansible/modules/dnf.py
CHANGED
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
#
|
|
7
7
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
8
8
|
|
|
9
|
-
from __future__ import
|
|
10
|
-
__metaclass__ = type
|
|
9
|
+
from __future__ import annotations
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
DOCUMENTATION = '''
|
|
@@ -22,7 +21,7 @@ options:
|
|
|
22
21
|
description:
|
|
23
22
|
- By default, this module will select the backend based on the C(ansible_pkg_mgr) fact.
|
|
24
23
|
default: "auto"
|
|
25
|
-
choices: [ auto, dnf4, dnf5 ]
|
|
24
|
+
choices: [ auto, yum, yum4, dnf4, dnf5 ]
|
|
26
25
|
type: str
|
|
27
26
|
version_added: 2.15
|
|
28
27
|
name:
|
|
@@ -207,8 +206,8 @@ options:
|
|
|
207
206
|
version_added: "2.7"
|
|
208
207
|
install_repoquery:
|
|
209
208
|
description:
|
|
210
|
-
- This is effectively a no-op in DNF as it is not needed with DNF
|
|
211
|
-
|
|
209
|
+
- This is effectively a no-op in DNF as it is not needed with DNF.
|
|
210
|
+
- This option is deprecated and will be removed in ansible-core 2.20.
|
|
212
211
|
type: bool
|
|
213
212
|
default: "yes"
|
|
214
213
|
version_added: "2.7"
|
|
@@ -246,11 +245,19 @@ options:
|
|
|
246
245
|
version_added: "2.10"
|
|
247
246
|
nobest:
|
|
248
247
|
description:
|
|
249
|
-
-
|
|
248
|
+
- This is the opposite of the O(best) option kept for backwards compatibility.
|
|
249
|
+
- Since ansible-core 2.17 the default value is set by the operating system distribution.
|
|
250
250
|
required: false
|
|
251
251
|
type: bool
|
|
252
|
-
default: "no"
|
|
253
252
|
version_added: "2.11"
|
|
253
|
+
best:
|
|
254
|
+
description:
|
|
255
|
+
- When set to V(true), either use a package with the highest version available or fail.
|
|
256
|
+
- When set to V(false), if the latest version cannot be installed go with the lower version.
|
|
257
|
+
- Default is set by the operating system distribution.
|
|
258
|
+
required: false
|
|
259
|
+
type: bool
|
|
260
|
+
version_added: "2.17"
|
|
254
261
|
cacheonly:
|
|
255
262
|
description:
|
|
256
263
|
- Tells dnf to run entirely from system cache; does not download or update metadata.
|
|
@@ -262,7 +269,7 @@ extends_documentation_fragment:
|
|
|
262
269
|
- action_common_attributes.flow
|
|
263
270
|
attributes:
|
|
264
271
|
action:
|
|
265
|
-
details:
|
|
272
|
+
details: dnf has 2 action plugins that use it under the hood, M(ansible.builtin.dnf) and M(ansible.builtin.package).
|
|
266
273
|
support: partial
|
|
267
274
|
async:
|
|
268
275
|
support: none
|
|
@@ -409,7 +416,6 @@ class DnfModule(YumDnf):
|
|
|
409
416
|
super(DnfModule, self).__init__(module)
|
|
410
417
|
|
|
411
418
|
self._ensure_dnf()
|
|
412
|
-
self.lockfile = "/var/cache/dnf/*_lock.pid"
|
|
413
419
|
self.pkg_mgr_name = "dnf"
|
|
414
420
|
|
|
415
421
|
try:
|
|
@@ -417,15 +423,6 @@ class DnfModule(YumDnf):
|
|
|
417
423
|
except AttributeError:
|
|
418
424
|
self.with_modules = False
|
|
419
425
|
|
|
420
|
-
# DNF specific args that are not part of YumDnf
|
|
421
|
-
self.allowerasing = self.module.params['allowerasing']
|
|
422
|
-
self.nobest = self.module.params['nobest']
|
|
423
|
-
|
|
424
|
-
def is_lockfile_pid_valid(self):
|
|
425
|
-
# FIXME? it looks like DNF takes care of invalid lock files itself?
|
|
426
|
-
# https://github.com/ansible/ansible/issues/57189
|
|
427
|
-
return True
|
|
428
|
-
|
|
429
426
|
def _sanitize_dnf_error_msg_install(self, spec, error):
|
|
430
427
|
"""
|
|
431
428
|
For unhandled dnf.exceptions.Error scenarios, there are certain error
|
|
@@ -467,7 +464,7 @@ class DnfModule(YumDnf):
|
|
|
467
464
|
'version': package.version,
|
|
468
465
|
'repo': package.repoid}
|
|
469
466
|
|
|
470
|
-
# envra format for
|
|
467
|
+
# envra format for backwards compat
|
|
471
468
|
result['envra'] = '{epoch}:{name}-{version}-{release}.{arch}'.format(**result)
|
|
472
469
|
|
|
473
470
|
# keep nevra key for backwards compat as it was previously
|
|
@@ -599,9 +596,11 @@ class DnfModule(YumDnf):
|
|
|
599
596
|
if self.skip_broken:
|
|
600
597
|
conf.strict = 0
|
|
601
598
|
|
|
602
|
-
#
|
|
603
|
-
if self.nobest:
|
|
604
|
-
conf.best =
|
|
599
|
+
# best and nobest are mutually exclusive
|
|
600
|
+
if self.nobest is not None:
|
|
601
|
+
conf.best = not self.nobest
|
|
602
|
+
elif self.best is not None:
|
|
603
|
+
conf.best = self.best
|
|
605
604
|
|
|
606
605
|
if self.download_only:
|
|
607
606
|
conf.downloadonly = True
|
|
@@ -634,6 +633,11 @@ class DnfModule(YumDnf):
|
|
|
634
633
|
for repo in repos.get_matching(repo_pattern):
|
|
635
634
|
repo.enable()
|
|
636
635
|
|
|
636
|
+
for repo in base.repos.iter_enabled():
|
|
637
|
+
if self.disable_gpg_check:
|
|
638
|
+
repo.gpgcheck = False
|
|
639
|
+
repo.repo_gpgcheck = False
|
|
640
|
+
|
|
637
641
|
def _base(self, conf_file, disable_gpg_check, disablerepo, enablerepo, installroot, sslverify):
|
|
638
642
|
"""Return a fully configured dnf Base object."""
|
|
639
643
|
base = dnf.Base()
|
|
@@ -740,6 +744,7 @@ class DnfModule(YumDnf):
|
|
|
740
744
|
"""Mark the package for install."""
|
|
741
745
|
is_newer_version_installed = self._is_newer_version_installed(pkg_spec)
|
|
742
746
|
is_installed = self._is_installed(pkg_spec)
|
|
747
|
+
msg = ''
|
|
743
748
|
try:
|
|
744
749
|
if is_newer_version_installed:
|
|
745
750
|
if self.allow_downgrade:
|
|
@@ -773,18 +778,16 @@ class DnfModule(YumDnf):
|
|
|
773
778
|
pass
|
|
774
779
|
else: # Case 7, The package is not installed, simply install it
|
|
775
780
|
self.base.install(pkg_spec, strict=self.base.conf.strict)
|
|
776
|
-
|
|
777
|
-
return {'failed': False, 'msg': '', 'failure': '', 'rc': 0}
|
|
778
|
-
|
|
779
781
|
except dnf.exceptions.MarkingError as e:
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
782
|
+
msg = "No package {0} available.".format(pkg_spec)
|
|
783
|
+
if self.base.conf.strict:
|
|
784
|
+
return {
|
|
785
|
+
'failed': True,
|
|
786
|
+
'msg': msg,
|
|
787
|
+
'failure': " ".join((pkg_spec, to_native(e))),
|
|
788
|
+
'rc': 1,
|
|
789
|
+
"results": []
|
|
790
|
+
}
|
|
788
791
|
except dnf.exceptions.DepsolveError as e:
|
|
789
792
|
return {
|
|
790
793
|
'failed': True,
|
|
@@ -793,7 +796,6 @@ class DnfModule(YumDnf):
|
|
|
793
796
|
'rc': 1,
|
|
794
797
|
"results": []
|
|
795
798
|
}
|
|
796
|
-
|
|
797
799
|
except dnf.exceptions.Error as e:
|
|
798
800
|
if to_text("already installed") in to_text(e):
|
|
799
801
|
return {'failed': False, 'msg': '', 'failure': ''}
|
|
@@ -806,6 +808,8 @@ class DnfModule(YumDnf):
|
|
|
806
808
|
"results": []
|
|
807
809
|
}
|
|
808
810
|
|
|
811
|
+
return {'failed': False, 'msg': msg, 'failure': '', 'rc': 0}
|
|
812
|
+
|
|
809
813
|
def _parse_spec_group_file(self):
|
|
810
814
|
pkg_specs, grp_specs, module_specs, filenames = [], [], [], []
|
|
811
815
|
already_loaded_comps = False # Only load this if necessary, it's slow
|
|
@@ -1081,13 +1085,6 @@ class DnfModule(YumDnf):
|
|
|
1081
1085
|
response['results'].append("Packages providing %s not installed due to update_only specified" % spec)
|
|
1082
1086
|
else:
|
|
1083
1087
|
for pkg_spec in pkg_specs:
|
|
1084
|
-
# Previously we forced base.conf.best=True here.
|
|
1085
|
-
# However in 2.11+ there is a self.nobest option, so defer to that.
|
|
1086
|
-
# Note, however, that just because nobest isn't set, doesn't mean that
|
|
1087
|
-
# base.conf.best is actually true. We only force it false in
|
|
1088
|
-
# _configure_base(), we never set it to true, and it can default to false.
|
|
1089
|
-
# Thus, we still need to explicitly set it here.
|
|
1090
|
-
self.base.conf.best = not self.nobest
|
|
1091
1088
|
install_result = self._mark_package_install(pkg_spec, upgrade=True)
|
|
1092
1089
|
if install_result['failed']:
|
|
1093
1090
|
if install_result['msg']:
|
|
@@ -1339,11 +1336,7 @@ def main():
|
|
|
1339
1336
|
# list=repos
|
|
1340
1337
|
# list=pkgspec
|
|
1341
1338
|
|
|
1342
|
-
|
|
1343
|
-
# backported to yum because yum is now in "maintenance mode" upstream
|
|
1344
|
-
yumdnf_argument_spec['argument_spec']['allowerasing'] = dict(default=False, type='bool')
|
|
1345
|
-
yumdnf_argument_spec['argument_spec']['nobest'] = dict(default=False, type='bool')
|
|
1346
|
-
yumdnf_argument_spec['argument_spec']['use_backend'] = dict(default='auto', choices=['auto', 'dnf4', 'dnf5'])
|
|
1339
|
+
yumdnf_argument_spec['argument_spec']['use_backend'] = dict(default='auto', choices=['auto', 'yum', 'yum4', 'dnf4', 'dnf5'])
|
|
1347
1340
|
|
|
1348
1341
|
module = AnsibleModule(
|
|
1349
1342
|
**yumdnf_argument_spec
|
ansible/modules/dnf5.py
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
# Copyright 2023 Ansible Project
|
|
3
3
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
4
4
|
|
|
5
|
-
from __future__ import
|
|
5
|
+
from __future__ import annotations
|
|
6
6
|
|
|
7
|
-
__metaclass__ = type
|
|
8
7
|
|
|
9
8
|
DOCUMENTATION = """
|
|
10
9
|
module: dnf5
|
|
@@ -152,7 +151,7 @@ options:
|
|
|
152
151
|
validate_certs:
|
|
153
152
|
description:
|
|
154
153
|
- 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 M(ansible.builtin.
|
|
154
|
+
but is an accepted parameter for feature parity/compatibility with the M(ansible.builtin.dnf) module.
|
|
156
155
|
type: bool
|
|
157
156
|
default: "yes"
|
|
158
157
|
sslverify:
|
|
@@ -175,8 +174,8 @@ options:
|
|
|
175
174
|
default: "no"
|
|
176
175
|
install_repoquery:
|
|
177
176
|
description:
|
|
178
|
-
- This is effectively a no-op in DNF as it is not needed with DNF
|
|
179
|
-
|
|
177
|
+
- This is effectively a no-op in DNF as it is not needed with DNF.
|
|
178
|
+
- This option is deprecated and will be removed in ansible-core 2.20.
|
|
180
179
|
type: bool
|
|
181
180
|
default: "yes"
|
|
182
181
|
download_only:
|
|
@@ -209,10 +208,18 @@ options:
|
|
|
209
208
|
default: "no"
|
|
210
209
|
nobest:
|
|
211
210
|
description:
|
|
212
|
-
-
|
|
211
|
+
- This is the opposite of the O(best) option kept for backwards compatibility.
|
|
212
|
+
- Since ansible-core 2.17 the default value is set by the operating system distribution.
|
|
213
213
|
required: false
|
|
214
214
|
type: bool
|
|
215
|
-
|
|
215
|
+
best:
|
|
216
|
+
description:
|
|
217
|
+
- When set to V(true), either use a package with the highest version available or fail.
|
|
218
|
+
- When set to V(false), if the latest version cannot be installed go with the lower version.
|
|
219
|
+
- Default is set by the operating system distribution.
|
|
220
|
+
required: false
|
|
221
|
+
type: bool
|
|
222
|
+
version_added: "2.17"
|
|
216
223
|
cacheonly:
|
|
217
224
|
description:
|
|
218
225
|
- Tells dnf to run entirely from system cache; does not download or update metadata.
|
|
@@ -223,7 +230,7 @@ extends_documentation_fragment:
|
|
|
223
230
|
- action_common_attributes.flow
|
|
224
231
|
attributes:
|
|
225
232
|
action:
|
|
226
|
-
details:
|
|
233
|
+
details: dnf5 has 2 action plugins that use it under the hood, M(ansible.builtin.dnf) and M(ansible.builtin.package).
|
|
227
234
|
support: partial
|
|
228
235
|
async:
|
|
229
236
|
support: none
|
|
@@ -357,9 +364,15 @@ def is_installed(base, spec):
|
|
|
357
364
|
|
|
358
365
|
|
|
359
366
|
def is_newer_version_installed(base, spec):
|
|
367
|
+
# FIXME investigate whether this function can be replaced by dnf5's allow_downgrade option
|
|
368
|
+
if "/" in spec:
|
|
369
|
+
spec = spec.split("/")[-1]
|
|
370
|
+
if spec.endswith(".rpm"):
|
|
371
|
+
spec = spec[:-4]
|
|
372
|
+
|
|
360
373
|
try:
|
|
361
374
|
spec_nevra = next(iter(libdnf5.rpm.Nevra.parse(spec)))
|
|
362
|
-
except RuntimeError:
|
|
375
|
+
except (RuntimeError, StopIteration):
|
|
363
376
|
return False
|
|
364
377
|
|
|
365
378
|
spec_version = spec_nevra.get_version()
|
|
@@ -412,8 +425,7 @@ def get_unneeded_pkgs(base):
|
|
|
412
425
|
query = libdnf5.rpm.PackageQuery(base)
|
|
413
426
|
query.filter_installed()
|
|
414
427
|
query.filter_unneeded()
|
|
415
|
-
|
|
416
|
-
yield pkg
|
|
428
|
+
yield from query
|
|
417
429
|
|
|
418
430
|
|
|
419
431
|
class Dnf5Module(YumDnf):
|
|
@@ -421,14 +433,8 @@ class Dnf5Module(YumDnf):
|
|
|
421
433
|
super(Dnf5Module, self).__init__(module)
|
|
422
434
|
self._ensure_dnf()
|
|
423
435
|
|
|
424
|
-
# FIXME https://github.com/rpm-software-management/dnf5/issues/402
|
|
425
|
-
self.lockfile = ""
|
|
426
436
|
self.pkg_mgr_name = "dnf5"
|
|
427
437
|
|
|
428
|
-
# DNF specific args that are not part of YumDnf
|
|
429
|
-
self.allowerasing = self.module.params["allowerasing"]
|
|
430
|
-
self.nobest = self.module.params["nobest"]
|
|
431
|
-
|
|
432
438
|
def _ensure_dnf(self):
|
|
433
439
|
locale = get_best_parsable_locale(self.module)
|
|
434
440
|
os.environ["LC_ALL"] = os.environ["LC_MESSAGES"] = locale
|
|
@@ -470,10 +476,6 @@ class Dnf5Module(YumDnf):
|
|
|
470
476
|
failures=[],
|
|
471
477
|
)
|
|
472
478
|
|
|
473
|
-
def is_lockfile_pid_valid(self):
|
|
474
|
-
# FIXME https://github.com/rpm-software-management/dnf5/issues/402
|
|
475
|
-
return True
|
|
476
|
-
|
|
477
479
|
def run(self):
|
|
478
480
|
if sys.version_info.major < 3:
|
|
479
481
|
self.module.fail_json(
|
|
@@ -521,7 +523,11 @@ class Dnf5Module(YumDnf):
|
|
|
521
523
|
self.disable_excludes = "*"
|
|
522
524
|
conf.disable_excludes = self.disable_excludes
|
|
523
525
|
conf.skip_broken = self.skip_broken
|
|
524
|
-
|
|
526
|
+
# best and nobest are mutually exclusive
|
|
527
|
+
if self.nobest is not None:
|
|
528
|
+
conf.best = not self.nobest
|
|
529
|
+
elif self.best is not None:
|
|
530
|
+
conf.best = self.best
|
|
525
531
|
conf.install_weak_deps = self.install_weak_deps
|
|
526
532
|
conf.gpgcheck = not self.disable_gpg_check
|
|
527
533
|
conf.localpkg_gpgcheck = not self.disable_gpg_check
|
|
@@ -718,10 +724,6 @@ class Dnf5Module(YumDnf):
|
|
|
718
724
|
|
|
719
725
|
|
|
720
726
|
def main():
|
|
721
|
-
# Extend yumdnf_argument_spec with dnf-specific features that will never be
|
|
722
|
-
# backported to yum because yum is now in "maintenance mode" upstream
|
|
723
|
-
yumdnf_argument_spec["argument_spec"]["allowerasing"] = dict(default=False, type="bool")
|
|
724
|
-
yumdnf_argument_spec["argument_spec"]["nobest"] = dict(default=False, type="bool")
|
|
725
727
|
Dnf5Module(AnsibleModule(**yumdnf_argument_spec)).run()
|
|
726
728
|
|
|
727
729
|
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: Ansible Project
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
DOCUMENTATION = '''
|