ansible-core 2.16.6__py3-none-any.whl → 2.17.0rc1__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 +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 +2 -4
- 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 +12 -15
- 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 +59 -186
- 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 +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 +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 +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 +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 +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 -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 +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 +24 -37
- 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 +3 -7
- ansible/vars/manager.py +24 -6
- ansible/vars/reserved.py +1 -3
- {ansible_core-2.16.6.data → ansible_core-2.17.0rc1.data}/scripts/ansible-test +1 -2
- {ansible_core-2.16.6.dist-info → ansible_core-2.17.0rc1.dist-info}/METADATA +3 -3
- ansible_core-2.17.0rc1.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/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.6.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.6.dist-info → ansible_core-2.17.0rc1.dist-info}/COPYING +0 -0
- {ansible_core-2.16.6.dist-info → ansible_core-2.17.0rc1.dist-info}/WHEEL +0 -0
- {ansible_core-2.16.6.dist-info → ansible_core-2.17.0rc1.dist-info}/entry_points.txt +0 -0
- {ansible_core-2.16.6.dist-info → ansible_core-2.17.0rc1.dist-info}/top_level.txt +0 -0
ansible/modules/expect.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# (c) 2015, Matt Martz <matt@sivel.net>
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
DOCUMENTATION = r'''
|
|
@@ -38,9 +37,11 @@ options:
|
|
|
38
37
|
responses:
|
|
39
38
|
type: dict
|
|
40
39
|
description:
|
|
41
|
-
- Mapping of
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
- Mapping of prompt regular expressions and corresponding answer(s).
|
|
41
|
+
- Each key in O(responses) is a Python regex U(https://docs.python.org/3/library/re.html#regular-expression-syntax).
|
|
42
|
+
- The value of each key is a string or list of strings.
|
|
43
|
+
If the value is a string and the prompt is encountered multiple times, the answer will be repeated.
|
|
44
|
+
Provide the value as a list to give different answers for successive matches.
|
|
44
45
|
required: true
|
|
45
46
|
timeout:
|
|
46
47
|
type: raw
|
|
@@ -69,15 +70,10 @@ notes:
|
|
|
69
70
|
- If you want to run a command through the shell (say you are using C(<),
|
|
70
71
|
C(>), C(|), and so on), you must specify a shell in the command such as
|
|
71
72
|
C(/bin/bash -c "/path/to/something | grep else").
|
|
72
|
-
-
|
|
73
|
-
insensitive searches are indicated with a prefix of C(?i).
|
|
73
|
+
- Case insensitive searches are indicated with a prefix of C(?i).
|
|
74
74
|
- The C(pexpect) library used by this module operates with a search window
|
|
75
75
|
of 2000 bytes, and does not use a multiline regex match. To perform a
|
|
76
76
|
start of line bound match, use a pattern like ``(?m)^pattern``
|
|
77
|
-
- By default, if a question is encountered multiple times, its string
|
|
78
|
-
response will be repeated. If you need different responses for successive
|
|
79
|
-
question matches, instead of a string response, use a list of strings as
|
|
80
|
-
the response. The list functionality is new in 2.1.
|
|
81
77
|
- The M(ansible.builtin.expect) module is designed for simple scenarios.
|
|
82
78
|
For more complex needs, consider the use of expect code with the M(ansible.builtin.shell)
|
|
83
79
|
or M(ansible.builtin.script) modules. (An example is part of the M(ansible.builtin.shell) module documentation).
|
|
@@ -98,14 +94,28 @@ EXAMPLES = r'''
|
|
|
98
94
|
# you don't want to show passwords in your logs
|
|
99
95
|
no_log: true
|
|
100
96
|
|
|
101
|
-
- name:
|
|
97
|
+
- name: Match multiple regular expressions and demonstrate individual and repeated responses
|
|
102
98
|
ansible.builtin.expect:
|
|
103
99
|
command: /path/to/custom/command
|
|
104
100
|
responses:
|
|
105
101
|
Question:
|
|
102
|
+
# give a unique response for each of the 3 hypothetical prompts matched
|
|
106
103
|
- response1
|
|
107
104
|
- response2
|
|
108
105
|
- response3
|
|
106
|
+
# give the same response for every matching prompt
|
|
107
|
+
"^Match another prompt$": "response"
|
|
108
|
+
|
|
109
|
+
- name: Multiple questions with responses
|
|
110
|
+
ansible.builtin.expect:
|
|
111
|
+
command: /path/to/custom/command
|
|
112
|
+
responses:
|
|
113
|
+
"Please provide your name":
|
|
114
|
+
- "Anna"
|
|
115
|
+
"Database user":
|
|
116
|
+
- "{{ db_username }}"
|
|
117
|
+
"Database password":
|
|
118
|
+
- "{{ db_password }}"
|
|
109
119
|
'''
|
|
110
120
|
|
|
111
121
|
import datetime
|
|
@@ -167,9 +177,7 @@ def main():
|
|
|
167
177
|
try:
|
|
168
178
|
timeout = check_type_int(timeout)
|
|
169
179
|
except TypeError as te:
|
|
170
|
-
module.fail_json(
|
|
171
|
-
msg="argument 'timeout' is of type {timeout_type} and we were unable to convert to int: {te}".format(timeout_type=type(timeout), te=te)
|
|
172
|
-
)
|
|
180
|
+
module.fail_json(msg=f"argument 'timeout' is of type {type(timeout)} and we were unable to convert to int: {te}")
|
|
173
181
|
echo = module.params['echo']
|
|
174
182
|
|
|
175
183
|
events = dict()
|
ansible/modules/fail.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: (c) 2012, Dag Wieers <dag@wieers.com>
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
DOCUMENTATION = r'''
|
ansible/modules/fetch.py
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
# This is a virtual module that is entirely implemented as an action plugin and runs on the controller
|
|
7
7
|
|
|
8
|
-
from __future__ import
|
|
9
|
-
__metaclass__ = type
|
|
8
|
+
from __future__ import annotations
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
DOCUMENTATION = r'''
|
ansible/modules/file.py
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
# Copyright: (c) 2017, Ansible Project
|
|
5
5
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
6
6
|
|
|
7
|
-
from __future__ import
|
|
8
|
-
__metaclass__ = type
|
|
7
|
+
from __future__ import annotations
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
DOCUMENTATION = r'''
|
|
@@ -66,7 +65,7 @@ options:
|
|
|
66
65
|
- >
|
|
67
66
|
Force the creation of the symlinks in two cases: the source file does
|
|
68
67
|
not exist (but will appear later); the destination exists and is a file (so, we need to unlink the
|
|
69
|
-
O(path) file and create symlink to the O(src) file in place of it).
|
|
68
|
+
O(path) file and create a symlink to the O(src) file in place of it).
|
|
70
69
|
type: bool
|
|
71
70
|
default: no
|
|
72
71
|
follow:
|
|
@@ -74,6 +73,8 @@ options:
|
|
|
74
73
|
- This flag indicates that filesystem links, if they exist, should be followed.
|
|
75
74
|
- O(follow=yes) and O(state=link) can modify O(src) when combined with parameters such as O(mode).
|
|
76
75
|
- Previous to Ansible 2.5, this was V(false) by default.
|
|
76
|
+
- While creating a symlink with a non-existent destination, set O(follow) to V(false) to avoid a warning message related to permission issues.
|
|
77
|
+
The warning message is added to notify the user that we can not set permissions to the non-existent destination.
|
|
77
78
|
type: bool
|
|
78
79
|
default: yes
|
|
79
80
|
version_added: '1.8'
|
ansible/modules/find.py
CHANGED
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
# Copyright: (c) 2017, Ansible Project
|
|
7
7
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
8
8
|
|
|
9
|
-
from __future__ import
|
|
10
|
-
__metaclass__ = type
|
|
9
|
+
from __future__ import annotations
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
DOCUMENTATION = r'''
|
|
@@ -150,6 +149,11 @@ options:
|
|
|
150
149
|
- Default is unlimited depth.
|
|
151
150
|
type: int
|
|
152
151
|
version_added: "2.6"
|
|
152
|
+
encoding:
|
|
153
|
+
description:
|
|
154
|
+
- When doing a C(contains) search, determine the encoding of the files to be searched.
|
|
155
|
+
type: str
|
|
156
|
+
version_added: "2.17"
|
|
153
157
|
extends_documentation_fragment: action_common_attributes
|
|
154
158
|
attributes:
|
|
155
159
|
check_mode:
|
|
@@ -339,11 +343,12 @@ def sizefilter(st, size):
|
|
|
339
343
|
return False
|
|
340
344
|
|
|
341
345
|
|
|
342
|
-
def contentfilter(fsname, pattern, read_whole_file=False):
|
|
346
|
+
def contentfilter(fsname, pattern, encoding, read_whole_file=False):
|
|
343
347
|
"""
|
|
344
348
|
Filter files which contain the given expression
|
|
345
349
|
:arg fsname: Filename to scan for lines matching a pattern
|
|
346
350
|
:arg pattern: Pattern to look for inside of line
|
|
351
|
+
:arg encoding: Encoding of the file to be scanned
|
|
347
352
|
:arg read_whole_file: If true, the whole file is read into memory before the regex is applied against it. Otherwise, the regex is applied line-by-line.
|
|
348
353
|
:rtype: bool
|
|
349
354
|
:returns: True if one of the lines in fsname matches the pattern. Otherwise False
|
|
@@ -354,7 +359,7 @@ def contentfilter(fsname, pattern, read_whole_file=False):
|
|
|
354
359
|
prog = re.compile(pattern)
|
|
355
360
|
|
|
356
361
|
try:
|
|
357
|
-
with open(fsname) as f:
|
|
362
|
+
with open(fsname, encoding=encoding) as f:
|
|
358
363
|
if read_whole_file:
|
|
359
364
|
return bool(prog.search(f.read()))
|
|
360
365
|
|
|
@@ -362,6 +367,13 @@ def contentfilter(fsname, pattern, read_whole_file=False):
|
|
|
362
367
|
if prog.match(line):
|
|
363
368
|
return True
|
|
364
369
|
|
|
370
|
+
except LookupError as e:
|
|
371
|
+
raise e
|
|
372
|
+
except UnicodeDecodeError as e:
|
|
373
|
+
if encoding is None:
|
|
374
|
+
encoding = 'None (default determined by the Python built-in function "open")'
|
|
375
|
+
msg = f'Failed to read the file {fsname} due to an encoding error. current encoding: {encoding}'
|
|
376
|
+
raise Exception(msg) from e
|
|
365
377
|
except Exception:
|
|
366
378
|
pass
|
|
367
379
|
|
|
@@ -455,6 +467,7 @@ def main():
|
|
|
455
467
|
depth=dict(type='int'),
|
|
456
468
|
mode=dict(type='raw'),
|
|
457
469
|
exact_mode=dict(type='bool', default=True),
|
|
470
|
+
encoding=dict(type='str')
|
|
458
471
|
),
|
|
459
472
|
supports_check_mode=True,
|
|
460
473
|
)
|
|
@@ -567,7 +580,7 @@ def main():
|
|
|
567
580
|
if (pfilter(fsobj, params['patterns'], params['excludes'], params['use_regex']) and
|
|
568
581
|
agefilter(st, now, age, params['age_stamp']) and
|
|
569
582
|
sizefilter(st, size) and
|
|
570
|
-
contentfilter(fsname, params['contains'], params['read_whole_file']) and
|
|
583
|
+
contentfilter(fsname, params['contains'], params['encoding'], params['read_whole_file']) and
|
|
571
584
|
mode_filter(st, params['mode'], params['exact_mode'], module)):
|
|
572
585
|
|
|
573
586
|
r.update(statinfo(st))
|
ansible/modules/gather_facts.py
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
# Copyright (c) 2017 Ansible Project
|
|
3
3
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
4
4
|
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
DOCUMENTATION = '''
|
ansible/modules/get_url.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: (c) 2012, Jan-Piet Mens <jpmens () gmail.com>
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
DOCUMENTATION = r'''
|
|
@@ -261,7 +260,7 @@ EXAMPLES = r'''
|
|
|
261
260
|
|
|
262
261
|
- name: Download file from a file path
|
|
263
262
|
ansible.builtin.get_url:
|
|
264
|
-
url: file:///tmp/
|
|
263
|
+
url: file:///tmp/a_file.txt
|
|
265
264
|
dest: /tmp/afilecopy.txt
|
|
266
265
|
|
|
267
266
|
- name: < Fetch file that requires authentication.
|
ansible/modules/getent.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: (c) 2014, Brian Coca <brian.coca+dev@gmail.com>
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
DOCUMENTATION = r'''
|
|
@@ -110,7 +109,7 @@ ansible_facts:
|
|
|
110
109
|
description:
|
|
111
110
|
- A list of results or a single result as a list of the fields the db provides
|
|
112
111
|
- The list elements depend on the database queried, see getent man page for the structure
|
|
113
|
-
- Starting at 2.11 it now returns multiple duplicate entries,
|
|
112
|
+
- Starting at 2.11 it now returns multiple duplicate entries, previously it only returned the last one
|
|
114
113
|
returned: always
|
|
115
114
|
type: list
|
|
116
115
|
'''
|
ansible/modules/git.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
DOCUMENTATION = '''
|
|
@@ -208,15 +207,18 @@ options:
|
|
|
208
207
|
type: path
|
|
209
208
|
version_added: "2.7"
|
|
210
209
|
|
|
211
|
-
|
|
210
|
+
gpg_allowlist:
|
|
212
211
|
description:
|
|
213
212
|
- A list of trusted GPG fingerprints to compare to the fingerprint of the
|
|
214
213
|
GPG-signed commit.
|
|
215
214
|
- Only used when O(verify_commit=yes).
|
|
216
215
|
- Use of this feature requires Git 2.6+ due to its reliance on git's C(--raw) flag to C(verify-commit) and C(verify-tag).
|
|
216
|
+
- Alias O(gpg_allowlist) is added in version 2.17.
|
|
217
|
+
- Alias O(gpg_whitelist) is deprecated and will be removed in version 2.21.
|
|
217
218
|
type: list
|
|
218
219
|
elements: str
|
|
219
220
|
default: []
|
|
221
|
+
aliases: [ gpg_whitelist ]
|
|
220
222
|
version_added: "2.9"
|
|
221
223
|
|
|
222
224
|
requirements:
|
|
@@ -568,7 +570,7 @@ def get_submodule_versions(git_path, module, dest, version='HEAD'):
|
|
|
568
570
|
|
|
569
571
|
|
|
570
572
|
def clone(git_path, module, repo, dest, remote, depth, version, bare,
|
|
571
|
-
reference, refspec, git_version_used, verify_commit, separate_git_dir, result,
|
|
573
|
+
reference, refspec, git_version_used, verify_commit, separate_git_dir, result, gpg_allowlist, single_branch):
|
|
572
574
|
''' makes a new git repo if it does not already exist '''
|
|
573
575
|
dest_dirname = os.path.dirname(dest)
|
|
574
576
|
try:
|
|
@@ -635,7 +637,7 @@ def clone(git_path, module, repo, dest, remote, depth, version, bare,
|
|
|
635
637
|
module.run_command(cmd, check_rc=True, cwd=dest)
|
|
636
638
|
|
|
637
639
|
if verify_commit:
|
|
638
|
-
verify_commit_sign(git_path, module, dest, version,
|
|
640
|
+
verify_commit_sign(git_path, module, dest, version, gpg_allowlist)
|
|
639
641
|
|
|
640
642
|
|
|
641
643
|
def has_local_mods(module, git_path, dest, bare):
|
|
@@ -1016,7 +1018,7 @@ def set_remote_branch(git_path, module, dest, remote, version, depth):
|
|
|
1016
1018
|
module.fail_json(msg="Failed to fetch branch from remote: %s" % version, stdout=out, stderr=err, rc=rc)
|
|
1017
1019
|
|
|
1018
1020
|
|
|
1019
|
-
def switch_version(git_path, module, dest, remote, version, verify_commit, depth,
|
|
1021
|
+
def switch_version(git_path, module, dest, remote, version, verify_commit, depth, gpg_allowlist):
|
|
1020
1022
|
cmd = ''
|
|
1021
1023
|
if version == 'HEAD':
|
|
1022
1024
|
branch = get_head_branch(git_path, module, dest, remote)
|
|
@@ -1052,26 +1054,26 @@ def switch_version(git_path, module, dest, remote, version, verify_commit, depth
|
|
|
1052
1054
|
stdout=out1, stderr=err1, rc=rc, cmd=cmd)
|
|
1053
1055
|
|
|
1054
1056
|
if verify_commit:
|
|
1055
|
-
verify_commit_sign(git_path, module, dest, version,
|
|
1057
|
+
verify_commit_sign(git_path, module, dest, version, gpg_allowlist)
|
|
1056
1058
|
|
|
1057
1059
|
return (rc, out1, err1)
|
|
1058
1060
|
|
|
1059
1061
|
|
|
1060
|
-
def verify_commit_sign(git_path, module, dest, version,
|
|
1062
|
+
def verify_commit_sign(git_path, module, dest, version, gpg_allowlist):
|
|
1061
1063
|
if version in get_annotated_tags(git_path, module, dest):
|
|
1062
1064
|
git_sub = "verify-tag"
|
|
1063
1065
|
else:
|
|
1064
1066
|
git_sub = "verify-commit"
|
|
1065
1067
|
cmd = "%s %s %s" % (git_path, git_sub, version)
|
|
1066
|
-
if
|
|
1068
|
+
if gpg_allowlist:
|
|
1067
1069
|
cmd += " --raw"
|
|
1068
1070
|
(rc, out, err) = module.run_command(cmd, cwd=dest)
|
|
1069
1071
|
if rc != 0:
|
|
1070
1072
|
module.fail_json(msg='Failed to verify GPG signature of commit/tag "%s"' % version, stdout=out, stderr=err, rc=rc)
|
|
1071
|
-
if
|
|
1073
|
+
if gpg_allowlist:
|
|
1072
1074
|
fingerprint = get_gpg_fingerprint(err)
|
|
1073
|
-
if fingerprint not in
|
|
1074
|
-
module.fail_json(msg='The
|
|
1075
|
+
if fingerprint not in gpg_allowlist:
|
|
1076
|
+
module.fail_json(msg='The gpg_allowlist does not include the public key "%s" for this commit' % fingerprint, stdout=out, stderr=err, rc=rc)
|
|
1075
1077
|
return (rc, out, err)
|
|
1076
1078
|
|
|
1077
1079
|
|
|
@@ -1184,7 +1186,16 @@ def main():
|
|
|
1184
1186
|
clone=dict(default='yes', type='bool'),
|
|
1185
1187
|
update=dict(default='yes', type='bool'),
|
|
1186
1188
|
verify_commit=dict(default='no', type='bool'),
|
|
1187
|
-
|
|
1189
|
+
gpg_allowlist=dict(
|
|
1190
|
+
default=[], type='list', aliases=['gpg_whitelist'], elements='str',
|
|
1191
|
+
deprecated_aliases=[
|
|
1192
|
+
dict(
|
|
1193
|
+
name='gpg_whitelist',
|
|
1194
|
+
version='2.21',
|
|
1195
|
+
collection_name='ansible.builtin',
|
|
1196
|
+
)
|
|
1197
|
+
],
|
|
1198
|
+
),
|
|
1188
1199
|
accept_hostkey=dict(default='no', type='bool'),
|
|
1189
1200
|
accept_newhostkey=dict(default='no', type='bool'),
|
|
1190
1201
|
key_file=dict(default=None, type='path', required=False),
|
|
@@ -1215,7 +1226,7 @@ def main():
|
|
|
1215
1226
|
allow_clone = module.params['clone']
|
|
1216
1227
|
bare = module.params['bare']
|
|
1217
1228
|
verify_commit = module.params['verify_commit']
|
|
1218
|
-
|
|
1229
|
+
gpg_allowlist = module.params['gpg_allowlist']
|
|
1219
1230
|
reference = module.params['reference']
|
|
1220
1231
|
single_branch = module.params['single_branch']
|
|
1221
1232
|
git_path = module.params['executable'] or module.get_bin_path('git', True)
|
|
@@ -1264,7 +1275,7 @@ def main():
|
|
|
1264
1275
|
# We screenscrape a huge amount of git commands so use C locale anytime we
|
|
1265
1276
|
# call run_command()
|
|
1266
1277
|
locale = get_best_parsable_locale(module)
|
|
1267
|
-
module.run_command_environ_update = dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale, LC_CTYPE=locale)
|
|
1278
|
+
module.run_command_environ_update = dict(LANG=locale, LC_ALL=locale, LC_MESSAGES=locale, LC_CTYPE=locale, LANGUAGE=locale)
|
|
1268
1279
|
|
|
1269
1280
|
if separate_git_dir:
|
|
1270
1281
|
separate_git_dir = os.path.realpath(separate_git_dir)
|
|
@@ -1322,7 +1333,7 @@ def main():
|
|
|
1322
1333
|
module.exit_json(**result)
|
|
1323
1334
|
# there's no git config, so clone
|
|
1324
1335
|
clone(git_path, module, repo, dest, remote, depth, version, bare, reference,
|
|
1325
|
-
refspec, git_version_used, verify_commit, separate_git_dir, result,
|
|
1336
|
+
refspec, git_version_used, verify_commit, separate_git_dir, result, gpg_allowlist, single_branch)
|
|
1326
1337
|
elif not update:
|
|
1327
1338
|
# Just return having found a repo already in the dest path
|
|
1328
1339
|
# this does no checking that the repo is the actual repo
|
|
@@ -1377,7 +1388,7 @@ def main():
|
|
|
1377
1388
|
# switch to version specified regardless of whether
|
|
1378
1389
|
# we got new revisions from the repository
|
|
1379
1390
|
if not bare:
|
|
1380
|
-
switch_version(git_path, module, dest, remote, version, verify_commit, depth,
|
|
1391
|
+
switch_version(git_path, module, dest, remote, version, verify_commit, depth, gpg_allowlist)
|
|
1381
1392
|
|
|
1382
1393
|
# Deal with submodules
|
|
1383
1394
|
submodules_updated = False
|
ansible/modules/group.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: (c) 2012, Stephen Fromm <sfromm@gmail.com>
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
DOCUMENTATION = '''
|
ansible/modules/group_by.py
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
# Copyright: Ansible Team
|
|
5
5
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
6
6
|
|
|
7
|
-
from __future__ import
|
|
8
|
-
__metaclass__ = type
|
|
7
|
+
from __future__ import annotations
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
DOCUMENTATION = r'''
|
ansible/modules/hostname.py
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
# Copyright: (c) 2013, Hiroaki Nakamura <hnakamur@gmail.com>
|
|
5
5
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
6
6
|
|
|
7
|
-
from __future__ import
|
|
8
|
-
__metaclass__ = type
|
|
7
|
+
from __future__ import annotations
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
DOCUMENTATION = '''
|
|
@@ -82,7 +81,6 @@ from ansible.module_utils.common.sys_info import get_platform_subclass
|
|
|
82
81
|
from ansible.module_utils.facts.system.service_mgr import ServiceMgrFactCollector
|
|
83
82
|
from ansible.module_utils.facts.utils import get_file_lines, get_file_content
|
|
84
83
|
from ansible.module_utils.common.text.converters import to_native, to_text
|
|
85
|
-
from ansible.module_utils.six import PY3, text_type
|
|
86
84
|
|
|
87
85
|
STRATS = {
|
|
88
86
|
'alpine': 'Alpine',
|
|
@@ -533,21 +531,6 @@ class DarwinStrategy(BaseStrategy):
|
|
|
533
531
|
self.name_types = ('HostName', 'ComputerName', 'LocalHostName')
|
|
534
532
|
self.scrubbed_name = self._scrub_hostname(self.module.params['name'])
|
|
535
533
|
|
|
536
|
-
def _make_translation(self, replace_chars, replacement_chars, delete_chars):
|
|
537
|
-
if PY3:
|
|
538
|
-
return str.maketrans(replace_chars, replacement_chars, delete_chars)
|
|
539
|
-
|
|
540
|
-
if not isinstance(replace_chars, text_type) or not isinstance(replacement_chars, text_type):
|
|
541
|
-
raise ValueError('replace_chars and replacement_chars must both be strings')
|
|
542
|
-
if len(replace_chars) != len(replacement_chars):
|
|
543
|
-
raise ValueError('replacement_chars must be the same length as replace_chars')
|
|
544
|
-
|
|
545
|
-
table = dict(zip((ord(c) for c in replace_chars), replacement_chars))
|
|
546
|
-
for char in delete_chars:
|
|
547
|
-
table[ord(char)] = None
|
|
548
|
-
|
|
549
|
-
return table
|
|
550
|
-
|
|
551
534
|
def _scrub_hostname(self, name):
|
|
552
535
|
"""
|
|
553
536
|
LocalHostName only accepts valid DNS characters while HostName and ComputerName
|
|
@@ -559,7 +542,7 @@ class DarwinStrategy(BaseStrategy):
|
|
|
559
542
|
name = to_text(name)
|
|
560
543
|
replace_chars = u'\'"~`!@#$%^&*(){}[]/=?+\\|-_ '
|
|
561
544
|
delete_chars = u".'"
|
|
562
|
-
table =
|
|
545
|
+
table = str.maketrans(replace_chars, '-' * len(replace_chars), delete_chars)
|
|
563
546
|
name = name.translate(table)
|
|
564
547
|
|
|
565
548
|
# Replace multiple dashes with a single dash
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: Ansible Project
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
DOCUMENTATION = r'''
|
ansible/modules/import_role.py
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
# Copyright: Ansible Project
|
|
3
3
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
4
4
|
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
DOCUMENTATION = r'''
|
|
@@ -56,6 +55,14 @@ options:
|
|
|
56
55
|
type: bool
|
|
57
56
|
default: yes
|
|
58
57
|
version_added: '2.11'
|
|
58
|
+
public:
|
|
59
|
+
description:
|
|
60
|
+
- This option dictates whether the role's C(vars) and C(defaults) are exposed to the play.
|
|
61
|
+
- Variables are exposed to the play at playbook parsing time, and available to earlier roles and tasks as well unlike C(include_role).
|
|
62
|
+
- The default depends on the configuration option :ref:`default_private_role_vars`.
|
|
63
|
+
type: bool
|
|
64
|
+
default: yes
|
|
65
|
+
version_added: '2.17'
|
|
59
66
|
extends_documentation_fragment:
|
|
60
67
|
- action_common_attributes
|
|
61
68
|
- action_common_attributes.conn
|
ansible/modules/import_tasks.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: Ansible Project
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
DOCUMENTATION = r'''
|
ansible/modules/include_role.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: Ansible Project
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
DOCUMENTATION = r'''
|
ansible/modules/include_tasks.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: Ansible Project
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
DOCUMENTATION = r'''
|
ansible/modules/include_vars.py
CHANGED