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
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
# Copyright: (c) 2018, 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
|
-
|
|
7
|
-
from __future__ import (absolute_import, division, print_function)
|
|
8
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
9
7
|
|
|
10
8
|
import base64
|
|
11
9
|
import json
|
|
@@ -102,7 +100,7 @@ class ActionBase(ABC):
|
|
|
102
100
|
etc) associated with this task.
|
|
103
101
|
:returns: dictionary of results from the module
|
|
104
102
|
|
|
105
|
-
|
|
103
|
+
Implementers of action modules may find the following variables especially useful:
|
|
106
104
|
|
|
107
105
|
* Module parameters. These are stored in self._task.args
|
|
108
106
|
"""
|
|
@@ -117,11 +115,9 @@ class ActionBase(ABC):
|
|
|
117
115
|
del tmp
|
|
118
116
|
|
|
119
117
|
if self._task.async_val and not self._supports_async:
|
|
120
|
-
raise AnsibleActionFail('
|
|
118
|
+
raise AnsibleActionFail('This action (%s) does not support async.' % self._task.action)
|
|
121
119
|
elif self._task.check_mode and not self._supports_check_mode:
|
|
122
|
-
raise AnsibleActionSkip('
|
|
123
|
-
elif self._task.async_val and self._task.check_mode:
|
|
124
|
-
raise AnsibleActionFail('check mode and async cannot be used on same task.')
|
|
120
|
+
raise AnsibleActionSkip('This action (%s) does not support check mode.' % self._task.action)
|
|
125
121
|
|
|
126
122
|
# Error if invalid argument is passed
|
|
127
123
|
if self._VALID_ARGS:
|
|
@@ -851,10 +847,13 @@ class ActionBase(ABC):
|
|
|
851
847
|
path=path,
|
|
852
848
|
follow=follow,
|
|
853
849
|
get_checksum=checksum,
|
|
850
|
+
get_size=False, # ansible.windows.win_stat added this in 1.11.0
|
|
854
851
|
checksum_algorithm='sha1',
|
|
855
852
|
)
|
|
853
|
+
# Unknown opts are ignored as module_args could be specific for the
|
|
854
|
+
# module that is being executed.
|
|
856
855
|
mystat = self._execute_module(module_name='ansible.legacy.stat', module_args=module_args, task_vars=all_vars,
|
|
857
|
-
wrap_async=False)
|
|
856
|
+
wrap_async=False, ignore_unknown_opts=True)
|
|
858
857
|
|
|
859
858
|
if mystat.get('failed'):
|
|
860
859
|
msg = mystat.get('module_stderr')
|
|
@@ -938,7 +937,7 @@ class ActionBase(ABC):
|
|
|
938
937
|
data = re.sub(r'^((\r)?\n)?BECOME-SUCCESS.*(\r)?\n', '', data)
|
|
939
938
|
return data
|
|
940
939
|
|
|
941
|
-
def _update_module_args(self, module_name, module_args, task_vars):
|
|
940
|
+
def _update_module_args(self, module_name, module_args, task_vars, ignore_unknown_opts: bool = False):
|
|
942
941
|
|
|
943
942
|
# set check mode in the module arguments, if required
|
|
944
943
|
if self._task.check_mode:
|
|
@@ -996,7 +995,14 @@ class ActionBase(ABC):
|
|
|
996
995
|
# make sure the remote_tmp value is sent through in case modules needs to create their own
|
|
997
996
|
module_args['_ansible_remote_tmp'] = self.get_shell_option('remote_tmp', default='~/.ansible/tmp')
|
|
998
997
|
|
|
999
|
-
|
|
998
|
+
# tells the module to ignore options that are not in its argspec.
|
|
999
|
+
module_args['_ansible_ignore_unknown_opts'] = ignore_unknown_opts
|
|
1000
|
+
|
|
1001
|
+
# allow user to insert string to add context to remote loggging
|
|
1002
|
+
module_args['_ansible_target_log_info'] = C.config.get_config_value('TARGET_LOG_INFO', variables=task_vars)
|
|
1003
|
+
|
|
1004
|
+
def _execute_module(self, module_name=None, module_args=None, tmp=None, task_vars=None, persist_files=False, delete_remote_tmp=None, wrap_async=False,
|
|
1005
|
+
ignore_unknown_opts: bool = False):
|
|
1000
1006
|
'''
|
|
1001
1007
|
Transfer and run a module along with its arguments.
|
|
1002
1008
|
'''
|
|
@@ -1032,7 +1038,7 @@ class ActionBase(ABC):
|
|
|
1032
1038
|
if module_args is None:
|
|
1033
1039
|
module_args = self._task.args
|
|
1034
1040
|
|
|
1035
|
-
self._update_module_args(module_name, module_args, task_vars)
|
|
1041
|
+
self._update_module_args(module_name, module_args, task_vars, ignore_unknown_opts=ignore_unknown_opts)
|
|
1036
1042
|
|
|
1037
1043
|
remove_async_dir = None
|
|
1038
1044
|
if wrap_async or self._task.async_val:
|
|
@@ -1157,7 +1163,7 @@ class ActionBase(ABC):
|
|
|
1157
1163
|
if data.pop("_ansible_suppress_tmpdir_delete", False):
|
|
1158
1164
|
self._cleanup_remote_tmp = False
|
|
1159
1165
|
|
|
1160
|
-
# NOTE:
|
|
1166
|
+
# NOTE: dnf returns results .. but that made it 'compatible' with squashing, so we allow mappings, for now
|
|
1161
1167
|
if 'results' in data and (not isinstance(data['results'], Sequence) or isinstance(data['results'], string_types)):
|
|
1162
1168
|
data['ansible_module_results'] = data['results']
|
|
1163
1169
|
del data['results']
|
|
@@ -16,9 +16,7 @@
|
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
|
17
17
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
from __future__ import (absolute_import, division, print_function)
|
|
21
|
-
__metaclass__ = type
|
|
19
|
+
from __future__ import annotations
|
|
22
20
|
|
|
23
21
|
from collections.abc import Mapping
|
|
24
22
|
|
|
@@ -51,7 +49,7 @@ class ActionModule(ActionBase):
|
|
|
51
49
|
# TODO: create 'conflict' detection in base class to deal with repeats and aliases and warn user
|
|
52
50
|
args = combine_vars(raw, args)
|
|
53
51
|
else:
|
|
54
|
-
raise AnsibleActionFail('Invalid raw parameters passed, requires a
|
|
52
|
+
raise AnsibleActionFail('Invalid raw parameters passed, requires a dictionary/mapping got a %s' % type(raw))
|
|
55
53
|
|
|
56
54
|
# Parse out any hostname:port patterns
|
|
57
55
|
new_name = args.get('name', args.get('hostname', args.get('host', None)))
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
# GNU General Public License for more details.
|
|
17
17
|
#
|
|
18
18
|
# You should have received a copy of the GNU General Public License
|
|
19
|
-
from __future__ import
|
|
20
|
-
__metaclass__ = type
|
|
19
|
+
from __future__ import annotations
|
|
21
20
|
|
|
22
21
|
import codecs
|
|
23
22
|
import os
|
|
@@ -140,7 +139,7 @@ class ActionModule(ActionBase):
|
|
|
140
139
|
|
|
141
140
|
if path_checksum != dest_stat['checksum']:
|
|
142
141
|
|
|
143
|
-
if self.
|
|
142
|
+
if self._task.diff:
|
|
144
143
|
diff = self._get_diff_data(dest, path, task_vars)
|
|
145
144
|
|
|
146
145
|
remote_path = self._connection._shell.join_path(self._connection._shell.tmpdir, 'src')
|
ansible/plugins/action/assert.py
CHANGED
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
#
|
|
15
15
|
# You should have received a copy of the GNU General Public License
|
|
16
16
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
from __future__ import
|
|
18
|
-
__metaclass__ = type
|
|
17
|
+
from __future__ import annotations
|
|
19
18
|
|
|
20
19
|
from ansible.errors import AnsibleError
|
|
21
20
|
from ansible.playbook.conditional import Conditional
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Copyright: (c) 2018, Ansible Project
|
|
2
2
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
3
3
|
|
|
4
|
-
from __future__ import
|
|
5
|
-
__metaclass__ = type
|
|
4
|
+
from __future__ import annotations
|
|
6
5
|
|
|
7
6
|
from ansible.plugins.action import ActionBase
|
|
8
7
|
from ansible.utils.vars import merge_hash
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Copyright: (c) 2017, Ansible Project
|
|
2
2
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
3
3
|
|
|
4
|
-
from __future__ import
|
|
5
|
-
__metaclass__ = type
|
|
4
|
+
from __future__ import annotations
|
|
6
5
|
|
|
7
6
|
from ansible.plugins.action import ActionBase
|
|
8
7
|
from ansible.utils.vars import merge_hash
|
ansible/plugins/action/copy.py
CHANGED
|
@@ -16,9 +16,7 @@
|
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
|
17
17
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
from __future__ import (absolute_import, division, print_function)
|
|
21
|
-
__metaclass__ = type
|
|
19
|
+
from __future__ import annotations
|
|
22
20
|
|
|
23
21
|
import json
|
|
24
22
|
import os
|
|
@@ -151,7 +149,7 @@ def _walk_dirs(topdir, base_path=None, local_follow=False, trailing_slash_detect
|
|
|
151
149
|
new_parents.add((parent_stat.st_dev, parent_stat.st_ino))
|
|
152
150
|
|
|
153
151
|
if (dir_stats.st_dev, dir_stats.st_ino) in new_parents:
|
|
154
|
-
# This was a
|
|
152
|
+
# This was a circular symlink. So add it as
|
|
155
153
|
# a symlink
|
|
156
154
|
r_files['symlinks'].append((os.readlink(dirpath), dest_dirpath))
|
|
157
155
|
else:
|
|
@@ -212,7 +210,7 @@ class ActionModule(ActionBase):
|
|
|
212
210
|
# NOTE: do not add to this. This should be made a generic function for action plugins.
|
|
213
211
|
# This should also use the same argspec as the module instead of keeping it in sync.
|
|
214
212
|
if 'invocation' not in result:
|
|
215
|
-
if self.
|
|
213
|
+
if self._task.no_log:
|
|
216
214
|
result['invocation'] = "CENSORED: no_log is set"
|
|
217
215
|
else:
|
|
218
216
|
# NOTE: Should be removed in the future. For now keep this broken
|
|
@@ -285,16 +283,21 @@ class ActionModule(ActionBase):
|
|
|
285
283
|
if local_checksum != dest_status['checksum']:
|
|
286
284
|
# The checksums don't match and we will change or error out.
|
|
287
285
|
|
|
288
|
-
if self.
|
|
286
|
+
if self._task.diff and not raw:
|
|
289
287
|
result['diff'].append(self._get_diff_data(dest_file, source_full, task_vars, content))
|
|
290
288
|
|
|
291
|
-
if self.
|
|
289
|
+
if self._task.check_mode:
|
|
292
290
|
self._remove_tempfile_if_content_defined(content, content_tempfile)
|
|
293
291
|
result['changed'] = True
|
|
294
292
|
return result
|
|
295
293
|
|
|
296
294
|
# Define a remote directory that we will copy the file to.
|
|
297
|
-
tmp_src = self._connection._shell.join_path(self._connection._shell.tmpdir, 'source')
|
|
295
|
+
tmp_src = self._connection._shell.join_path(self._connection._shell.tmpdir, '.source')
|
|
296
|
+
|
|
297
|
+
# ensure we keep suffix for validate
|
|
298
|
+
suffix = os.path.splitext(dest_file)[1]
|
|
299
|
+
if suffix:
|
|
300
|
+
tmp_src += suffix
|
|
298
301
|
|
|
299
302
|
remote_path = None
|
|
300
303
|
|
|
@@ -387,7 +390,7 @@ class ActionModule(ActionBase):
|
|
|
387
390
|
|
|
388
391
|
def _create_content_tempfile(self, content):
|
|
389
392
|
''' Create a tempfile containing defined content '''
|
|
390
|
-
fd, content_tempfile = tempfile.mkstemp(dir=C.DEFAULT_LOCAL_TMP)
|
|
393
|
+
fd, content_tempfile = tempfile.mkstemp(dir=C.DEFAULT_LOCAL_TMP, prefix='.')
|
|
391
394
|
f = os.fdopen(fd, 'wb')
|
|
392
395
|
content = to_bytes(content)
|
|
393
396
|
try:
|
ansible/plugins/action/debug.py
CHANGED
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
#
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
|
17
17
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
-
from __future__ import
|
|
19
|
-
__metaclass__ = type
|
|
18
|
+
from __future__ import annotations
|
|
20
19
|
|
|
21
20
|
from ansible.errors import AnsibleUndefinedVariable
|
|
22
21
|
from ansible.module_utils.six import string_types
|
ansible/plugins/action/dnf.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# Copyright: (c) 2023, Ansible Project
|
|
2
2
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
3
|
+
from __future__ import annotations
|
|
3
4
|
|
|
4
5
|
from ansible.errors import AnsibleActionFail
|
|
5
6
|
from ansible.plugins.action import ActionBase
|
|
@@ -7,10 +8,9 @@ from ansible.utils.display import Display
|
|
|
7
8
|
|
|
8
9
|
display = Display()
|
|
9
10
|
|
|
10
|
-
VALID_BACKENDS = frozenset(("dnf", "dnf4", "dnf5"))
|
|
11
|
+
VALID_BACKENDS = frozenset(("yum", "yum4", "dnf", "dnf4", "dnf5"))
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
# FIXME mostly duplicate of the yum action plugin
|
|
14
14
|
class ActionModule(ActionBase):
|
|
15
15
|
|
|
16
16
|
TRANSFERS_FILES = False
|
|
@@ -28,7 +28,7 @@ class ActionModule(ActionBase):
|
|
|
28
28
|
|
|
29
29
|
module = self._task.args.get('use', self._task.args.get('use_backend', 'auto'))
|
|
30
30
|
|
|
31
|
-
if module
|
|
31
|
+
if module in {'yum', 'auto'}:
|
|
32
32
|
try:
|
|
33
33
|
if self._task.delegate_to: # if we delegate, we should use delegated host's facts
|
|
34
34
|
module = self._templar.template("{{hostvars['%s']['ansible_facts']['pkg_mgr']}}" % self._task.delegate_to)
|
|
@@ -56,7 +56,7 @@ class ActionModule(ActionBase):
|
|
|
56
56
|
)
|
|
57
57
|
|
|
58
58
|
else:
|
|
59
|
-
if module
|
|
59
|
+
if module in {"yum4", "dnf4"}:
|
|
60
60
|
module = "dnf"
|
|
61
61
|
|
|
62
62
|
# eliminate collisions with collections search while still allowing local override
|
ansible/plugins/action/fail.py
CHANGED
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
#
|
|
16
16
|
# You should have received a copy of the GNU General Public License
|
|
17
17
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
-
from __future__ import
|
|
19
|
-
__metaclass__ = type
|
|
18
|
+
from __future__ import annotations
|
|
20
19
|
|
|
21
20
|
from ansible.plugins.action import ActionBase
|
|
22
21
|
|
ansible/plugins/action/fetch.py
CHANGED
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
#
|
|
15
15
|
# You should have received a copy of the GNU General Public License
|
|
16
16
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
from __future__ import
|
|
18
|
-
__metaclass__ = type
|
|
17
|
+
from __future__ import annotations
|
|
19
18
|
|
|
20
19
|
import os
|
|
21
20
|
import base64
|
|
@@ -42,7 +41,7 @@ class ActionModule(ActionBase):
|
|
|
42
41
|
del tmp # tmp no longer has any effect
|
|
43
42
|
|
|
44
43
|
try:
|
|
45
|
-
if self.
|
|
44
|
+
if self._task.check_mode:
|
|
46
45
|
raise AnsibleActionSkip('check mode not (yet) supported for this module')
|
|
47
46
|
|
|
48
47
|
source = self._task.args.get('src', None)
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Copyright (c) 2017 Ansible Project
|
|
2
2
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
3
3
|
|
|
4
|
-
from __future__ import
|
|
5
|
-
__metaclass__ = type
|
|
4
|
+
from __future__ import annotations
|
|
6
5
|
|
|
7
6
|
import os
|
|
8
7
|
import time
|
|
@@ -26,7 +25,7 @@ class ActionModule(ActionBase):
|
|
|
26
25
|
# deal with 'setup specific arguments'
|
|
27
26
|
if fact_module not in C._ACTION_SETUP:
|
|
28
27
|
|
|
29
|
-
# TODO: remove in favor of controller side argspec
|
|
28
|
+
# TODO: remove in favor of controller side argspec detecting valid arguments
|
|
30
29
|
# network facts modules must support gather_subset
|
|
31
30
|
try:
|
|
32
31
|
name = self._connection.ansible_name.removeprefix('ansible.netcommon.')
|
|
@@ -123,7 +122,7 @@ class ActionModule(ActionBase):
|
|
|
123
122
|
mod_args = self._get_module_args(fact_module, task_vars)
|
|
124
123
|
|
|
125
124
|
# if module does not handle timeout, use timeout to handle module, hijack async_val as this is what async_wrapper uses
|
|
126
|
-
# TODO: make this action
|
|
125
|
+
# TODO: make this action complain about async/async settings, use parallel option instead .. or remove parallel in favor of async settings?
|
|
127
126
|
if timeout and 'gather_timeout' not in mod_args:
|
|
128
127
|
self._task.async_val = int(timeout)
|
|
129
128
|
elif async_val != 0:
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
#
|
|
15
15
|
# You should have received a copy of the GNU General Public License
|
|
16
16
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
from __future__ import
|
|
18
|
-
__metaclass__ = type
|
|
17
|
+
from __future__ import annotations
|
|
19
18
|
|
|
20
19
|
from ansible.plugins.action import ActionBase
|
|
21
20
|
from ansible.module_utils.six import string_types
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Copyright: (c) 2016, Allen Sanabria <asanabria@linuxdynasty.org>
|
|
2
2
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
3
3
|
|
|
4
|
-
from __future__ import
|
|
5
|
-
__metaclass__ = type
|
|
4
|
+
from __future__ import annotations
|
|
6
5
|
|
|
7
6
|
from os import path, walk
|
|
8
7
|
import re
|
ansible/plugins/action/normal.py
CHANGED
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
#
|
|
15
15
|
# You should have received a copy of the GNU General Public License
|
|
16
16
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
from __future__ import
|
|
18
|
-
__metaclass__ = type
|
|
17
|
+
from __future__ import annotations
|
|
19
18
|
|
|
20
19
|
from ansible import constants as C
|
|
21
20
|
from ansible.plugins.action import ActionBase
|
|
@@ -14,14 +14,14 @@
|
|
|
14
14
|
#
|
|
15
15
|
# You should have received a copy of the GNU General Public License
|
|
16
16
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
from __future__ import
|
|
18
|
-
__metaclass__ = type
|
|
17
|
+
from __future__ import annotations
|
|
19
18
|
|
|
20
19
|
from ansible.errors import AnsibleAction, AnsibleActionFail
|
|
21
20
|
from ansible.executor.module_common import get_action_args_with_defaults
|
|
22
21
|
from ansible.module_utils.facts.system.pkg_mgr import PKG_MGRS
|
|
23
22
|
from ansible.plugins.action import ActionBase
|
|
24
23
|
from ansible.utils.display import Display
|
|
24
|
+
from ansible.utils.vars import combine_vars
|
|
25
25
|
|
|
26
26
|
display = Display()
|
|
27
27
|
|
|
@@ -39,31 +39,46 @@ class ActionModule(ActionBase):
|
|
|
39
39
|
self._supports_async = True
|
|
40
40
|
|
|
41
41
|
result = super(ActionModule, self).run(tmp, task_vars)
|
|
42
|
-
del tmp # tmp no longer has any effect
|
|
43
42
|
|
|
44
43
|
module = self._task.args.get('use', 'auto')
|
|
45
44
|
|
|
46
|
-
if module == 'auto':
|
|
47
|
-
try:
|
|
48
|
-
if self._task.delegate_to: # if we delegate, we should use delegated host's facts
|
|
49
|
-
module = self._templar.template("{{hostvars['%s']['ansible_facts']['pkg_mgr']}}" % self._task.delegate_to)
|
|
50
|
-
else:
|
|
51
|
-
module = self._templar.template('{{ansible_facts.pkg_mgr}}')
|
|
52
|
-
except Exception:
|
|
53
|
-
pass # could not get it from template!
|
|
54
|
-
|
|
55
45
|
try:
|
|
56
46
|
if module == 'auto':
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
47
|
+
|
|
48
|
+
if self._task.delegate_to:
|
|
49
|
+
hosts_vars = task_vars['hostvars'][self._task.delegate_to]
|
|
50
|
+
tvars = combine_vars(self._task.vars, task_vars.get('delegated_vars', {}))
|
|
51
|
+
else:
|
|
52
|
+
hosts_vars = task_vars
|
|
53
|
+
tvars = task_vars
|
|
54
|
+
|
|
55
|
+
# use config
|
|
56
|
+
module = tvars.get('ansible_package_use', None)
|
|
57
|
+
|
|
58
|
+
if not module:
|
|
59
|
+
# no use, no config, get from facts
|
|
60
|
+
if hosts_vars.get('ansible_facts', {}).get('pkg_mgr', False):
|
|
61
|
+
facts = hosts_vars
|
|
62
|
+
pmgr = 'pkg_mgr'
|
|
63
|
+
else:
|
|
64
|
+
# we had no facts, so generate them
|
|
65
|
+
# very expensive step, we actually run fact gathering because we don't have facts for this host.
|
|
66
|
+
facts = self._execute_module(
|
|
67
|
+
module_name='ansible.legacy.setup',
|
|
68
|
+
module_args=dict(filter='ansible_pkg_mgr', gather_subset='!all'),
|
|
69
|
+
task_vars=task_vars,
|
|
70
|
+
)
|
|
71
|
+
pmgr = 'ansible_pkg_mgr'
|
|
72
|
+
|
|
73
|
+
try:
|
|
74
|
+
# actually get from facts
|
|
75
|
+
module = facts['ansible_facts'][pmgr]
|
|
76
|
+
except KeyError:
|
|
77
|
+
raise AnsibleActionFail('Could not detect a package manager. Try using the "use" option.')
|
|
78
|
+
|
|
79
|
+
if module and module != 'auto':
|
|
65
80
|
if not self._shared_loader_obj.module_loader.has_plugin(module):
|
|
66
|
-
raise AnsibleActionFail('Could not find a
|
|
81
|
+
raise AnsibleActionFail('Could not find a matching action for the "%s" package manager.' % module)
|
|
67
82
|
else:
|
|
68
83
|
# run the 'package' module
|
|
69
84
|
new_module_args = self._task.args.copy()
|
ansible/plugins/action/pause.py
CHANGED
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
#
|
|
15
15
|
# You should have received a copy of the GNU General Public License
|
|
16
16
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
from __future__ import
|
|
18
|
-
__metaclass__ = type
|
|
17
|
+
from __future__ import annotations
|
|
19
18
|
|
|
20
19
|
import datetime
|
|
21
20
|
import time
|
ansible/plugins/action/raw.py
CHANGED
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
#
|
|
15
15
|
# You should have received a copy of the GNU General Public License
|
|
16
16
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
from __future__ import
|
|
18
|
-
__metaclass__ = type
|
|
17
|
+
from __future__ import annotations
|
|
19
18
|
|
|
20
19
|
from ansible.plugins.action import ActionBase
|
|
21
20
|
|
|
@@ -33,7 +32,7 @@ class ActionModule(ActionBase):
|
|
|
33
32
|
result = super(ActionModule, self).run(tmp, task_vars)
|
|
34
33
|
del tmp # tmp no longer has any effect
|
|
35
34
|
|
|
36
|
-
if self.
|
|
35
|
+
if self._task.check_mode:
|
|
37
36
|
# in --check mode, always skip this module execution
|
|
38
37
|
result['skipped'] = True
|
|
39
38
|
return result
|
ansible/plugins/action/reboot.py
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
# Copyright: (c) 2018, Sam Doran <sdoran@redhat.com>
|
|
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
|
import random
|
|
9
8
|
import time
|
|
@@ -241,9 +240,13 @@ class ActionModule(ActionBase):
|
|
|
241
240
|
try:
|
|
242
241
|
display.debug("{action}: setting connect_timeout to {value}".format(action=self._task.action, value=connect_timeout))
|
|
243
242
|
self._connection.set_option("connection_timeout", connect_timeout)
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
243
|
+
except AnsibleError:
|
|
244
|
+
try:
|
|
245
|
+
self._connection.set_option("timeout", connect_timeout)
|
|
246
|
+
except (AnsibleError, AttributeError):
|
|
247
|
+
display.warning("Connection plugin does not allow the connection timeout to be overridden")
|
|
248
|
+
|
|
249
|
+
self._connection.reset()
|
|
247
250
|
|
|
248
251
|
# try and get boot time
|
|
249
252
|
try:
|
|
@@ -373,17 +376,25 @@ class ActionModule(ActionBase):
|
|
|
373
376
|
try:
|
|
374
377
|
connect_timeout = self._connection.get_option('connection_timeout')
|
|
375
378
|
except KeyError:
|
|
376
|
-
|
|
379
|
+
try:
|
|
380
|
+
connect_timeout = self._connection.get_option('timeout')
|
|
381
|
+
except KeyError:
|
|
382
|
+
pass
|
|
377
383
|
else:
|
|
378
384
|
if original_connection_timeout != connect_timeout:
|
|
379
385
|
try:
|
|
380
|
-
display.debug("{action}: setting connect_timeout back to original value of {value}".format(
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
386
|
+
display.debug("{action}: setting connect_timeout/timeout back to original value of {value}".format(action=self._task.action,
|
|
387
|
+
value=original_connection_timeout))
|
|
388
|
+
try:
|
|
389
|
+
self._connection.set_option("connection_timeout", original_connection_timeout)
|
|
390
|
+
except AnsibleError:
|
|
391
|
+
try:
|
|
392
|
+
self._connection.set_option("timeout", original_connection_timeout)
|
|
393
|
+
except AnsibleError:
|
|
394
|
+
raise
|
|
395
|
+
# reset the connection to clear the custom connection timeout
|
|
384
396
|
self._connection.reset()
|
|
385
397
|
except (AnsibleError, AttributeError) as e:
|
|
386
|
-
# reset the connection to clear the custom connection timeout
|
|
387
398
|
display.debug("{action}: failed to reset connection_timeout back to default: {error}".format(action=self._task.action,
|
|
388
399
|
error=to_text(e)))
|
|
389
400
|
|
|
@@ -409,14 +420,13 @@ class ActionModule(ActionBase):
|
|
|
409
420
|
|
|
410
421
|
def run(self, tmp=None, task_vars=None):
|
|
411
422
|
self._supports_check_mode = True
|
|
412
|
-
self._supports_async = True
|
|
413
423
|
|
|
414
424
|
# If running with local connection, fail so we don't reboot ourselves
|
|
415
425
|
if self._connection.transport == 'local':
|
|
416
426
|
msg = 'Running {0} with local connection would reboot the control node.'.format(self._task.action)
|
|
417
427
|
return {'changed': False, 'elapsed': 0, 'rebooted': False, 'failed': True, 'msg': msg}
|
|
418
428
|
|
|
419
|
-
if self.
|
|
429
|
+
if self._task.check_mode:
|
|
420
430
|
return {'changed': True, 'elapsed': 0, 'rebooted': True}
|
|
421
431
|
|
|
422
432
|
if task_vars is None:
|
|
@@ -442,11 +452,16 @@ class ActionModule(ActionBase):
|
|
|
442
452
|
|
|
443
453
|
# Get the original connection_timeout option var so it can be reset after
|
|
444
454
|
original_connection_timeout = None
|
|
455
|
+
|
|
456
|
+
display.debug("{action}: saving original connect_timeout of {timeout}".format(action=self._task.action, timeout=original_connection_timeout))
|
|
445
457
|
try:
|
|
446
458
|
original_connection_timeout = self._connection.get_option('connection_timeout')
|
|
447
|
-
display.debug("{action}: saving original connect_timeout of {timeout}".format(action=self._task.action, timeout=original_connection_timeout))
|
|
448
459
|
except KeyError:
|
|
449
|
-
|
|
460
|
+
try:
|
|
461
|
+
original_connection_timeout = self._connection.get_option('timeout')
|
|
462
|
+
except KeyError:
|
|
463
|
+
display.debug("{action}: connect_timeout connection option has not been set".format(action=self._task.action))
|
|
464
|
+
|
|
450
465
|
# Initiate reboot
|
|
451
466
|
reboot_result = self.perform_reboot(task_vars, distribution)
|
|
452
467
|
|
ansible/plugins/action/script.py
CHANGED
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
#
|
|
15
15
|
# You should have received a copy of the GNU General Public License
|
|
16
16
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
from __future__ import
|
|
18
|
-
__metaclass__ = type
|
|
17
|
+
from __future__ import annotations
|
|
19
18
|
|
|
20
19
|
import os
|
|
21
20
|
import re
|
|
@@ -151,11 +150,11 @@ class ActionModule(ActionBase):
|
|
|
151
150
|
# like become and environment args
|
|
152
151
|
if getattr(self._connection._shell, "_IS_WINDOWS", False):
|
|
153
152
|
# FUTURE: use a more public method to get the exec payload
|
|
154
|
-
pc = self.
|
|
153
|
+
pc = self._task
|
|
155
154
|
exec_data = ps_manifest._create_powershell_wrapper(
|
|
156
155
|
to_bytes(script_cmd), source, {}, env_dict, self._task.async_val,
|
|
157
156
|
pc.become, pc.become_method, pc.become_user,
|
|
158
|
-
|
|
157
|
+
self._play_context.become_pass, pc.become_flags, "script", task_vars, None
|
|
159
158
|
)
|
|
160
159
|
# build the necessary exec wrapper command
|
|
161
160
|
# FUTURE: this still doesn't let script work on Windows with non-pipelined connections or
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
#
|
|
15
15
|
# You should have received a copy of the GNU General Public License
|
|
16
16
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
17
|
-
from __future__ import
|
|
18
|
-
__metaclass__ = type
|
|
17
|
+
from __future__ import annotations
|
|
19
18
|
|
|
20
19
|
|
|
21
20
|
from ansible.errors import AnsibleAction, AnsibleActionFail
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
# You should have received a copy of the GNU General Public License
|
|
16
16
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
|
|
18
|
-
from __future__ import
|
|
19
|
-
__metaclass__ = type
|
|
18
|
+
from __future__ import annotations
|
|
20
19
|
|
|
21
20
|
from ansible.errors import AnsibleActionFail
|
|
22
21
|
from ansible.module_utils.six import string_types
|
|
@@ -15,8 +15,7 @@
|
|
|
15
15
|
# You should have received a copy of the GNU General Public License
|
|
16
16
|
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
|
|
18
|
-
from __future__ import
|
|
19
|
-
__metaclass__ = type
|
|
18
|
+
from __future__ import annotations
|
|
20
19
|
|
|
21
20
|
from ansible.module_utils.parsing.convert_bool import boolean
|
|
22
21
|
from ansible.plugins.action import ActionBase
|
ansible/plugins/action/shell.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Copyright: (c) 2017, Ansible Project
|
|
2
2
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
3
3
|
|
|
4
|
-
from __future__ import
|
|
5
|
-
__metaclass__ = type
|
|
4
|
+
from __future__ import annotations
|
|
6
5
|
|
|
7
6
|
from ansible.errors import AnsibleActionFail
|
|
8
7
|
from ansible.plugins.action import ActionBase
|