ansible-core 2.16.5__py3-none-any.whl → 2.17.0b1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ansible-core might be problematic. Click here for more details.
- 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 +320 -198
- ansible/cli/galaxy.py +9 -3
- ansible/cli/inventory.py +5 -27
- 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 +32 -25
- ansible/constants.py +41 -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 +10 -5
- 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 +2 -3
- 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 +2 -3
- 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 +3 -4
- 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 +63 -188
- ansible/modules/dnf5.py +57 -43
- 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 +25 -9
- 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 +14 -4
- ansible/modules/uri.py +5 -8
- ansible/modules/user.py +11 -10
- 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 +14 -8
- 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 +2 -4
- 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 +20 -14
- 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 +6 -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 -2
- 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 +17 -6
- 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 -3
- 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 +18 -8
- ansible/plugins/strategy/host_pinned.py +1 -3
- ansible/plugins/strategy/linear.py +23 -23
- 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 +88 -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 +9 -29
- ansible/vars/manager.py +24 -6
- ansible/vars/reserved.py +1 -3
- {ansible_core-2.16.5.data → ansible_core-2.17.0b1.data}/scripts/ansible-test +1 -2
- {ansible_core-2.16.5.dist-info → ansible_core-2.17.0b1.dist-info}/METADATA +3 -3
- ansible_core-2.17.0b1.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/ansible_doc.py +1 -1
- 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/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.5.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.5.dist-info → ansible_core-2.17.0b1.dist-info}/COPYING +0 -0
- {ansible_core-2.16.5.dist-info → ansible_core-2.17.0b1.dist-info}/WHEEL +0 -0
- {ansible_core-2.16.5.dist-info → ansible_core-2.17.0b1.dist-info}/entry_points.txt +0 -0
- {ansible_core-2.16.5.dist-info → ansible_core-2.17.0b1.dist-info}/top_level.txt +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Copyright (c) 2018, Ansible Project
|
|
2
2
|
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
|
3
3
|
|
|
4
|
-
from __future__ import
|
|
5
|
-
__metaclass__ = type
|
|
4
|
+
from __future__ import annotations
|
|
6
5
|
|
|
7
6
|
import os
|
|
8
7
|
import stat
|
|
@@ -45,9 +44,15 @@ USERS_RE = re.compile(r'[^ugo]')
|
|
|
45
44
|
PERMS_RE = re.compile(r'[^rwxXstugo]')
|
|
46
45
|
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
S_IRANY = 0o0444 # read by user, group, others
|
|
48
|
+
S_IWANY = 0o0222 # write by user, group, others
|
|
49
|
+
S_IXANY = 0o0111 # execute by user, group, others
|
|
50
|
+
S_IRWU_RWG_RWO = S_IRANY | S_IWANY # read, write by user, group, others
|
|
51
|
+
S_IRWU_RG_RO = S_IRANY | stat.S_IWUSR # read by user, group, others and write only by user
|
|
52
|
+
S_IRWXU_RXG_RXO = S_IRANY | S_IXANY | stat.S_IWUSR # read, execute by user, group, others and write only by user
|
|
53
|
+
_PERM_BITS = 0o7777 # file mode permission bits
|
|
54
|
+
_EXEC_PERM_BITS = S_IXANY # execute permission bits
|
|
55
|
+
_DEFAULT_PERM = S_IRWU_RWG_RWO # default file permission bits
|
|
51
56
|
|
|
52
57
|
|
|
53
58
|
def is_executable(path):
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
# Copyright (c) 2019 Ansible Project
|
|
3
3
|
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
from __future__ import (absolute_import, division, print_function)
|
|
7
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
8
6
|
|
|
9
7
|
import json
|
|
10
8
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Copyright (c), Ansible Project
|
|
2
2
|
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
|
3
3
|
|
|
4
|
-
from __future__ import
|
|
5
|
-
__metaclass__ = type
|
|
4
|
+
from __future__ import annotations
|
|
6
5
|
|
|
7
6
|
from ansible.module_utils.common.text.converters import to_native
|
|
8
7
|
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# General networking tools that may be used by all modules
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
import re
|
|
10
9
|
from struct import pack
|
|
@@ -62,7 +61,7 @@ def to_masklen(val):
|
|
|
62
61
|
|
|
63
62
|
|
|
64
63
|
def to_subnet(addr, mask, dotted_notation=False):
|
|
65
|
-
"""
|
|
64
|
+
""" converts an addr / mask pair to a subnet in cidr notation """
|
|
66
65
|
try:
|
|
67
66
|
if not is_masklen(mask):
|
|
68
67
|
raise ValueError
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
# Copyright (c) 2019 Ansible Project
|
|
3
3
|
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
|
4
4
|
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
import datetime
|
|
9
8
|
import os
|
|
@@ -83,14 +82,17 @@ _ADDITIONAL_CHECKS = (
|
|
|
83
82
|
|
|
84
83
|
# if adding boolean attribute, also add to PASS_BOOL
|
|
85
84
|
# some of this dupes defaults from controller config
|
|
85
|
+
# keep in sync with copy in lib/ansible/module_utils/csharp/Ansible.Basic.cs
|
|
86
86
|
PASS_VARS = {
|
|
87
87
|
'check_mode': ('check_mode', False),
|
|
88
88
|
'debug': ('_debug', False),
|
|
89
89
|
'diff': ('_diff', False),
|
|
90
90
|
'keep_remote_files': ('_keep_remote_files', False),
|
|
91
|
+
'ignore_unknown_opts': ('_ignore_unknown_opts', False),
|
|
91
92
|
'module_name': ('_name', None),
|
|
92
93
|
'no_log': ('no_log', False),
|
|
93
94
|
'remote_tmp': ('_remote_tmp', None),
|
|
95
|
+
'target_log_info': ('_target_log_info', None),
|
|
94
96
|
'selinux_special_fs': ('_selinux_special_fs', ['fuse', 'nfs', 'vboxsf', 'ramfs', '9p', 'vfat']),
|
|
95
97
|
'shell_executable': ('_shell', '/bin/sh'),
|
|
96
98
|
'socket': ('_socket_path', None),
|
|
@@ -101,7 +103,7 @@ PASS_VARS = {
|
|
|
101
103
|
'version': ('ansible_version', '0.0'),
|
|
102
104
|
}
|
|
103
105
|
|
|
104
|
-
PASS_BOOLS = ('check_mode', 'debug', 'diff', 'keep_remote_files', 'no_log')
|
|
106
|
+
PASS_BOOLS = ('check_mode', 'debug', 'diff', 'keep_remote_files', 'ignore_unknown_opts', 'no_log')
|
|
105
107
|
|
|
106
108
|
DEFAULT_TYPE_VALIDATORS = {
|
|
107
109
|
'str': check_type_str,
|
|
@@ -345,7 +347,7 @@ def _list_no_log_values(argument_spec, params):
|
|
|
345
347
|
sub_param = check_type_dict(sub_param)
|
|
346
348
|
|
|
347
349
|
if not isinstance(sub_param, Mapping):
|
|
348
|
-
raise TypeError("Value '{1}' in the sub parameter field '{0}' must
|
|
350
|
+
raise TypeError("Value '{1}' in the sub parameter field '{0}' must be a {2}, "
|
|
349
351
|
"not '{1.__class__.__name__}'".format(arg_name, sub_param, wanted_type))
|
|
350
352
|
|
|
351
353
|
no_log_values.update(_list_no_log_values(sub_argument_spec, sub_param))
|
|
@@ -363,12 +365,10 @@ def _return_datastructure_name(obj):
|
|
|
363
365
|
return
|
|
364
366
|
elif isinstance(obj, Mapping):
|
|
365
367
|
for element in obj.items():
|
|
366
|
-
|
|
367
|
-
yield subelement
|
|
368
|
+
yield from _return_datastructure_name(element[1])
|
|
368
369
|
elif is_iterable(obj):
|
|
369
370
|
for element in obj:
|
|
370
|
-
|
|
371
|
-
yield subelement
|
|
371
|
+
yield from _return_datastructure_name(element)
|
|
372
372
|
elif obj is None or isinstance(obj, bool):
|
|
373
373
|
# This must come before int because bools are also ints
|
|
374
374
|
return
|
|
@@ -663,7 +663,7 @@ def _validate_argument_values(argument_spec, parameters, options_context=None, e
|
|
|
663
663
|
diff_list = [item for item in parameters[param] if item not in choices]
|
|
664
664
|
if diff_list:
|
|
665
665
|
choices_str = ", ".join([to_native(c) for c in choices])
|
|
666
|
-
diff_str = ", ".join(diff_list)
|
|
666
|
+
diff_str = ", ".join([to_native(c) for c in diff_list])
|
|
667
667
|
msg = "value of %s must be one or more of: %s. Got no match for: %s" % (param, choices_str, diff_str)
|
|
668
668
|
if options_context:
|
|
669
669
|
msg = "{0} found in {1}".format(msg, " -> ".join(options_context))
|
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
# Copyright (c) 2018, Ansible Project
|
|
2
2
|
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
|
3
3
|
|
|
4
|
-
from __future__ import
|
|
5
|
-
__metaclass__ = type
|
|
4
|
+
from __future__ import annotations
|
|
6
5
|
|
|
7
6
|
import os
|
|
8
7
|
|
|
9
8
|
from ansible.module_utils.common.file import is_executable
|
|
9
|
+
from ansible.module_utils.common.warnings import deprecate
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
def get_bin_path(arg, opt_dirs=None, required=None):
|
|
13
13
|
'''
|
|
14
|
-
Find system executable in PATH. Raises ValueError if executable is not found.
|
|
14
|
+
Find system executable in PATH. Raises ValueError if the executable is not found.
|
|
15
15
|
Optional arguments:
|
|
16
|
-
- required: [Deprecated]
|
|
17
|
-
In 2.10 and later, an Exception is always raised. This parameter will be removed in 2.
|
|
16
|
+
- required: [Deprecated] Before 2.10, if executable is not found and required is true it raises an Exception.
|
|
17
|
+
In 2.10 and later, an Exception is always raised. This parameter will be removed in 2.21.
|
|
18
18
|
- opt_dirs: optional list of directories to search in addition to PATH
|
|
19
19
|
In addition to PATH and opt_dirs, this function also looks through /sbin, /usr/sbin and /usr/local/sbin. A lot of
|
|
20
20
|
modules, especially for gathering facts, depend on this behaviour.
|
|
21
21
|
If found return full path, otherwise raise ValueError.
|
|
22
22
|
'''
|
|
23
|
+
if required is not None:
|
|
24
|
+
deprecate(
|
|
25
|
+
msg="The `required` parameter in `get_bin_path` API is deprecated.",
|
|
26
|
+
version="2.21",
|
|
27
|
+
collection_name="ansible.builtin",
|
|
28
|
+
)
|
|
29
|
+
|
|
23
30
|
opt_dirs = [] if opt_dirs is None else opt_dirs
|
|
24
31
|
|
|
25
32
|
sbin_paths = ['/sbin', '/usr/sbin', '/usr/local/sbin']
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Copyright: (c) 2021, 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 subprocess
|
|
@@ -20,7 +19,7 @@ def respawn_module(interpreter_path):
|
|
|
20
19
|
Respawn the currently-running Ansible Python module under the specified Python interpreter.
|
|
21
20
|
|
|
22
21
|
Ansible modules that require libraries that are typically available only under well-known interpreters
|
|
23
|
-
(eg, ``
|
|
22
|
+
(eg, ``apt``, ``dnf``) can use bespoke logic to determine the libraries they need are not
|
|
24
23
|
available, then call `respawn_module` to re-execute the current module under a different interpreter
|
|
25
24
|
and exit the current process when the new subprocess has completed. The respawned process inherits only
|
|
26
25
|
stdout/stderr from the current process.
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
# Copyright (c), Toshio Kuratomi <tkuratomi@ansible.com> 2016
|
|
3
3
|
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
|
4
4
|
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
import platform
|
|
9
8
|
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com>
|
|
4
4
|
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
import codecs
|
|
10
9
|
import datetime
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
# Copyright (c) 2019 Ansible Project
|
|
3
3
|
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
|
4
4
|
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
import re
|
|
9
8
|
|
|
@@ -2,15 +2,14 @@
|
|
|
2
2
|
# Copyright (c) 2019 Ansible Project
|
|
3
3
|
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
|
4
4
|
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
7
|
+
import json
|
|
8
8
|
import os
|
|
9
9
|
import re
|
|
10
10
|
|
|
11
11
|
from ast import literal_eval
|
|
12
12
|
from ansible.module_utils.common.text.converters import to_native
|
|
13
|
-
from ansible.module_utils.common._json_compat import json
|
|
14
13
|
from ansible.module_utils.common.collections import is_iterable
|
|
15
14
|
from ansible.module_utils.common.text.converters import jsonify
|
|
16
15
|
from ansible.module_utils.common.text.formatters import human_to_bytes
|
|
@@ -543,7 +542,7 @@ def check_type_raw(value):
|
|
|
543
542
|
def check_type_bytes(value):
|
|
544
543
|
"""Convert a human-readable string value to bytes
|
|
545
544
|
|
|
546
|
-
Raises :class:`TypeError` if unable to
|
|
545
|
+
Raises :class:`TypeError` if unable to convert the value
|
|
547
546
|
"""
|
|
548
547
|
try:
|
|
549
548
|
return human_to_bytes(value)
|
|
@@ -556,7 +555,7 @@ def check_type_bits(value):
|
|
|
556
555
|
|
|
557
556
|
Example: ``check_type_bits('1Mb')`` returns integer 1048576.
|
|
558
557
|
|
|
559
|
-
Raises :class:`TypeError` if unable to
|
|
558
|
+
Raises :class:`TypeError` if unable to convert the value.
|
|
560
559
|
"""
|
|
561
560
|
try:
|
|
562
561
|
return human_to_bytes(value, isbits=True)
|
|
@@ -568,7 +567,7 @@ def check_type_jsonarg(value):
|
|
|
568
567
|
"""Return a jsonified string. Sometimes the controller turns a json string
|
|
569
568
|
into a dict/list so transform it back into json here
|
|
570
569
|
|
|
571
|
-
Raises :class:`TypeError` if unable to
|
|
570
|
+
Raises :class:`TypeError` if unable to convert the value
|
|
572
571
|
|
|
573
572
|
"""
|
|
574
573
|
if isinstance(value, (text_type, binary_type)):
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
# Copyright (c) 2019 Ansible Project
|
|
3
3
|
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
|
4
4
|
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
from ansible.module_utils.six import string_types
|
|
9
8
|
|
|
@@ -6,8 +6,7 @@ This file provides ease of use shortcuts for loading and dumping YAML,
|
|
|
6
6
|
preferring the YAML compiled C extensions to reduce duplicated code.
|
|
7
7
|
"""
|
|
8
8
|
|
|
9
|
-
from __future__ import
|
|
10
|
-
__metaclass__ = type
|
|
9
|
+
from __future__ import annotations
|
|
11
10
|
|
|
12
11
|
from functools import partial as _partial
|
|
13
12
|
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
# Copyright (c) 2023 Ansible
|
|
2
2
|
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
from __future__ import (absolute_import, division, print_function)
|
|
6
|
-
__metaclass__ = type
|
|
4
|
+
from __future__ import annotations
|
|
7
5
|
|
|
8
6
|
from ansible.module_utils.six import PY3
|
|
9
7
|
|
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
# Copyright (c) 2020 Matt Martz <matt@sivel.net>
|
|
2
2
|
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
from __future__ import (absolute_import, division, print_function)
|
|
6
|
-
__metaclass__ = type
|
|
4
|
+
from __future__ import annotations
|
|
7
5
|
|
|
8
|
-
import
|
|
6
|
+
from ansible.module_utils.common.warnings import deprecate
|
|
9
7
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
|
|
9
|
+
def __getattr__(importable_name):
|
|
10
|
+
"""Inject import-time deprecation warnings.
|
|
11
|
+
|
|
12
|
+
Specifically, for ``import_module()``.
|
|
13
|
+
"""
|
|
14
|
+
if importable_name == 'import_module':
|
|
15
|
+
deprecate(
|
|
16
|
+
msg=f'The `ansible.module_utils.compat.importlib.'
|
|
17
|
+
f'{importable_name}` function is deprecated.',
|
|
18
|
+
version='2.19',
|
|
19
|
+
)
|
|
20
|
+
from importlib import import_module
|
|
21
|
+
return import_module
|
|
22
|
+
|
|
23
|
+
raise AttributeError(
|
|
24
|
+
f'cannot import name {importable_name !r} '
|
|
25
|
+
f'has no attribute ({__file__ !s})',
|
|
26
|
+
)
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
# Copyright (c) 2019 Ansible Project
|
|
3
3
|
# Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause)
|
|
4
4
|
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
import types # pylint: disable=unused-import
|
|
9
8
|
import warnings
|
|
@@ -15,42 +15,18 @@
|
|
|
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
|
-
|
|
19
|
-
from __future__ import (absolute_import, division, print_function)
|
|
20
|
-
__metaclass__ = type
|
|
21
|
-
|
|
22
|
-
'''
|
|
23
|
-
Compat selectors library. Python-3.5 has this builtin. The selectors2
|
|
24
|
-
package exists on pypi to backport the functionality as far as python-2.6.
|
|
25
|
-
'''
|
|
26
|
-
# The following makes it easier for us to script updates of the bundled code
|
|
27
|
-
_BUNDLED_METADATA = {"pypi_name": "selectors2", "version": "1.1.1", "version_constraints": ">1.0,<2.0"}
|
|
28
|
-
|
|
29
|
-
# Added these bugfix commits from 2.1.0:
|
|
30
|
-
# * https://github.com/SethMichaelLarson/selectors2/commit/3bd74f2033363b606e1e849528ccaa76f5067590
|
|
31
|
-
# Wrap kqueue.control so that timeout is a keyword arg
|
|
32
|
-
# * https://github.com/SethMichaelLarson/selectors2/commit/6f6a26f42086d8aab273b30be492beecb373646b
|
|
33
|
-
# Fix formatting of the kqueue.control patch for pylint
|
|
34
|
-
# * https://github.com/SethMichaelLarson/selectors2/commit/f0c2c6c66cfa7662bc52beaf4e2d65adfa25e189
|
|
35
|
-
# Fix use of OSError exception for py3 and use the wrapper of kqueue.control so retries of
|
|
36
|
-
# interrupted syscalls work with kqueue
|
|
18
|
+
from __future__ import annotations
|
|
37
19
|
|
|
20
|
+
import selectors
|
|
38
21
|
import sys
|
|
39
|
-
import types # pylint: disable=unused-import
|
|
40
22
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
import selectors as _system_selectors
|
|
44
|
-
except ImportError:
|
|
45
|
-
try:
|
|
46
|
-
# backport package installed in the system
|
|
47
|
-
import selectors2 as _system_selectors # type: ignore[no-redef]
|
|
48
|
-
except ImportError:
|
|
49
|
-
_system_selectors = None # type: types.ModuleType | None # type: ignore[no-redef]
|
|
23
|
+
from ansible.module_utils.common.warnings import deprecate
|
|
24
|
+
|
|
50
25
|
|
|
51
|
-
if _system_selectors:
|
|
52
|
-
selectors = _system_selectors
|
|
53
|
-
else:
|
|
54
|
-
# Our bundled copy
|
|
55
|
-
from ansible.module_utils.compat import _selectors2 as selectors # type: ignore[no-redef]
|
|
56
26
|
sys.modules['ansible.module_utils.compat.selectors'] = selectors
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
deprecate(
|
|
30
|
+
msg='The `ansible.module_utils.compat.selectors` module is deprecated.',
|
|
31
|
+
version='2.19',
|
|
32
|
+
)
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Copyright: (c) 2021, 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 sys
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"""Compatibility layer for the `typing` module, providing all Python versions access to the newest type-hinting features."""
|
|
2
|
-
from __future__ import
|
|
3
|
-
__metaclass__ = type
|
|
2
|
+
from __future__ import annotations
|
|
4
3
|
|
|
5
4
|
# pylint: disable=wildcard-import,unused-wildcard-import
|
|
6
5
|
|
|
@@ -25,8 +25,7 @@ Every version number class implements the following interface:
|
|
|
25
25
|
of the same class, thus must follow the same rules)
|
|
26
26
|
"""
|
|
27
27
|
|
|
28
|
-
from __future__ import
|
|
29
|
-
__metaclass__ = type
|
|
28
|
+
from __future__ import annotations
|
|
30
29
|
|
|
31
30
|
import re
|
|
32
31
|
|
|
@@ -26,8 +26,7 @@
|
|
|
26
26
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
|
27
27
|
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
28
|
|
|
29
|
-
from __future__ import
|
|
30
|
-
__metaclass__ = type
|
|
29
|
+
from __future__ import annotations
|
|
31
30
|
|
|
32
31
|
import os
|
|
33
32
|
import hashlib
|
|
@@ -49,6 +49,7 @@ namespace Ansible.Basic
|
|
|
49
49
|
private static List<string> BOOLEANS_TRUE = new List<string>() { "y", "yes", "on", "1", "true", "t", "1.0" };
|
|
50
50
|
private static List<string> BOOLEANS_FALSE = new List<string>() { "n", "no", "off", "0", "false", "f", "0.0" };
|
|
51
51
|
|
|
52
|
+
private bool ignoreUnknownOpts = false;
|
|
52
53
|
private string remoteTmp = Path.GetTempPath();
|
|
53
54
|
private string tmpdir = null;
|
|
54
55
|
private HashSet<string> noLogValues = new HashSet<string>();
|
|
@@ -60,10 +61,12 @@ namespace Ansible.Basic
|
|
|
60
61
|
private Dictionary<string, string> passVars = new Dictionary<string, string>()
|
|
61
62
|
{
|
|
62
63
|
// null values means no mapping, not used in Ansible.Basic.AnsibleModule
|
|
64
|
+
// keep in sync with python counterpart in lib/ansible/module_utils/common/parameters.py
|
|
63
65
|
{ "check_mode", "CheckMode" },
|
|
64
66
|
{ "debug", "DebugMode" },
|
|
65
67
|
{ "diff", "DiffMode" },
|
|
66
68
|
{ "keep_remote_files", "KeepRemoteFiles" },
|
|
69
|
+
{ "ignore_unknown_opts", "ignoreUnknownOpts" },
|
|
67
70
|
{ "module_name", "ModuleName" },
|
|
68
71
|
{ "no_log", "NoLog" },
|
|
69
72
|
{ "remote_tmp", "remoteTmp" },
|
|
@@ -72,11 +75,12 @@ namespace Ansible.Basic
|
|
|
72
75
|
{ "socket", null },
|
|
73
76
|
{ "string_conversion_action", null },
|
|
74
77
|
{ "syslog_facility", null },
|
|
78
|
+
{ "target_log_info", "TargetLogInfo"},
|
|
75
79
|
{ "tmpdir", "tmpdir" },
|
|
76
80
|
{ "verbosity", "Verbosity" },
|
|
77
81
|
{ "version", "AnsibleVersion" },
|
|
78
82
|
};
|
|
79
|
-
private List<string> passBools = new List<string>() { "check_mode", "debug", "diff", "keep_remote_files", "no_log" };
|
|
83
|
+
private List<string> passBools = new List<string>() { "check_mode", "debug", "diff", "keep_remote_files", "ignore_unknown_opts", "no_log" };
|
|
80
84
|
private List<string> passInts = new List<string>() { "verbosity" };
|
|
81
85
|
private Dictionary<string, List<object>> specDefaults = new Dictionary<string, List<object>>()
|
|
82
86
|
{
|
|
@@ -125,6 +129,7 @@ namespace Ansible.Basic
|
|
|
125
129
|
public bool KeepRemoteFiles { get; private set; }
|
|
126
130
|
public string ModuleName { get; private set; }
|
|
127
131
|
public bool NoLog { get; private set; }
|
|
132
|
+
public string TargetLogInfo { get; private set; }
|
|
128
133
|
public int Verbosity { get; private set; }
|
|
129
134
|
public string AnsibleVersion { get; private set; }
|
|
130
135
|
|
|
@@ -257,6 +262,7 @@ namespace Ansible.Basic
|
|
|
257
262
|
DiffMode = false;
|
|
258
263
|
KeepRemoteFiles = false;
|
|
259
264
|
ModuleName = "undefined win module";
|
|
265
|
+
TargetLogInfo = "";
|
|
260
266
|
NoLog = (bool)argumentSpec["no_log"];
|
|
261
267
|
Verbosity = 0;
|
|
262
268
|
AppDomain.CurrentDomain.ProcessExit += CleanupFiles;
|
|
@@ -372,9 +378,20 @@ namespace Ansible.Basic
|
|
|
372
378
|
logSource = "Application";
|
|
373
379
|
}
|
|
374
380
|
}
|
|
381
|
+
|
|
382
|
+
if (String.IsNullOrWhiteSpace(TargetLogInfo))
|
|
383
|
+
{
|
|
384
|
+
message = String.Format("{0} - {1}", ModuleName, message);
|
|
385
|
+
}
|
|
386
|
+
else
|
|
387
|
+
{
|
|
388
|
+
message = String.Format("{0} {1} - {2}", ModuleName, TargetLogInfo, message);
|
|
389
|
+
}
|
|
390
|
+
|
|
375
391
|
if (sanitise)
|
|
392
|
+
{
|
|
376
393
|
message = (string)RemoveNoLogValues(message, noLogValues);
|
|
377
|
-
|
|
394
|
+
}
|
|
378
395
|
|
|
379
396
|
using (EventLog eventLog = new EventLog("Application"))
|
|
380
397
|
{
|
|
@@ -1043,7 +1060,7 @@ namespace Ansible.Basic
|
|
|
1043
1060
|
foreach (string parameter in removedParameters)
|
|
1044
1061
|
param.Remove(parameter);
|
|
1045
1062
|
|
|
1046
|
-
if (unsupportedParameters.Count > 0)
|
|
1063
|
+
if (unsupportedParameters.Count > 0 && !ignoreUnknownOpts)
|
|
1047
1064
|
{
|
|
1048
1065
|
legalInputs.RemoveAll(x => passVars.Keys.Contains(x.Replace("_ansible_", "")));
|
|
1049
1066
|
string msg = String.Format("Unsupported parameters for ({0}) module: {1}", ModuleName, String.Join(", ", unsupportedParameters));
|
|
@@ -15,13 +15,12 @@
|
|
|
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
|
-
# Make coding more python3-ish
|
|
19
|
-
from __future__ import (absolute_import, division, print_function)
|
|
20
|
-
__metaclass__ = type
|
|
21
18
|
|
|
22
19
|
'''
|
|
23
20
|
Compat distro library.
|
|
24
21
|
'''
|
|
22
|
+
from __future__ import annotations
|
|
23
|
+
|
|
25
24
|
# The following makes it easier for us to script updates of the bundled code
|
|
26
25
|
_BUNDLED_METADATA = {"pypi_name": "distro", "version": "1.6.0"}
|
|
27
26
|
|