ansible-core 2.16.5rc1__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.5rc1.data → ansible_core-2.17.0b1.data}/scripts/ansible-test +1 -2
- {ansible_core-2.16.5rc1.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 +58 -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.5rc1.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.5rc1.dist-info → ansible_core-2.17.0b1.dist-info}/COPYING +0 -0
- {ansible_core-2.16.5rc1.dist-info → ansible_core-2.17.0b1.dist-info}/WHEEL +0 -0
- {ansible_core-2.16.5rc1.dist-info → ansible_core-2.17.0b1.dist-info}/entry_points.txt +0 -0
- {ansible_core-2.16.5rc1.dist-info → ansible_core-2.17.0b1.dist-info}/top_level.txt +0 -0
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Copyright: (c) 2015, Ansible, Inc
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class ModuleDocFragment(object):
|
|
@@ -1,7 +1,6 @@
|
|
|
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
|
-
from __future__ import
|
|
4
|
-
__metaclass__ = type
|
|
3
|
+
from __future__ import annotations
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
class ModuleDocFragment(object):
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Copyright: (c) 2017, Ansible Project
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class ModuleDocFragment(object):
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Copyright: (c) 2017, Brian Coca <bcoca@redhat.com>
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class ModuleDocFragment(object):
|
|
@@ -13,7 +12,7 @@ class ModuleDocFragment(object):
|
|
|
13
12
|
options:
|
|
14
13
|
decrypt:
|
|
15
14
|
description:
|
|
16
|
-
- This option controls the
|
|
15
|
+
- This option controls the auto-decryption of source files using vault.
|
|
17
16
|
type: bool
|
|
18
17
|
default: yes
|
|
19
18
|
version_added: '2.4'
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Copyright: (c) 2017, Ansible Project
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class ModuleDocFragment(object):
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Copyright: (c) 2014, 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
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class ModuleDocFragment(object):
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Copyright: (c) 2017, Ansible Project
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class ModuleDocFragment(object):
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Copyright: (c) 2017, Ansible Project
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class ModuleDocFragment(object):
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Copyright: (c) 2016, Ansible, Inc
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class ModuleDocFragment(object):
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# Copyright (c) 2017 Ansible Project
|
|
2
2
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
3
|
-
from __future__ import
|
|
4
|
-
__metaclass__ = type
|
|
3
|
+
from __future__ import annotations
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
class ModuleDocFragment(object):
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# Copyright (c) 2019 Ansible Project
|
|
2
2
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
3
|
-
from __future__ import
|
|
4
|
-
__metaclass__ = type
|
|
3
|
+
from __future__ import annotations
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
class ModuleDocFragment(object):
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright (c) 2019 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
|
class ModuleDocFragment(object):
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Copyright: (c) 2018, John Barker <gundalow@redhat.com>
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class ModuleDocFragment(object):
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright (c) 2019 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
|
class ModuleDocFragment:
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Copyright: (c) 2015, Ansible, Inc
|
|
4
4
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
class ModuleDocFragment(object):
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: (c) 2019, 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
|
class ModuleDocFragment(object):
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# (c) Ansible Project
|
|
2
2
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
3
3
|
|
|
4
|
-
from __future__ import
|
|
5
|
-
__metaclass__ = type
|
|
4
|
+
from __future__ import annotations
|
|
6
5
|
|
|
7
6
|
from ansible import constants as C
|
|
8
7
|
from ansible.plugins import AnsibleJinja2Plugin
|
|
@@ -2,28 +2,28 @@ DOCUMENTATION:
|
|
|
2
2
|
name: b64decode
|
|
3
3
|
author: ansible core team
|
|
4
4
|
version_added: 'historical'
|
|
5
|
-
short_description: Decode a
|
|
5
|
+
short_description: Decode a Base64 string
|
|
6
6
|
description:
|
|
7
7
|
- Base64 decoding function.
|
|
8
8
|
- The return value is a string.
|
|
9
|
-
- Trying to store a binary blob in a string most likely corrupts the binary. To
|
|
10
|
-
use the
|
|
11
|
-
For example, in the ansible.builtin.shell
|
|
9
|
+
- Trying to store a binary blob in a string most likely corrupts the binary. To Base64 decode a binary blob,
|
|
10
|
+
use the I(base64) command and pipe the encoded data through standard input.
|
|
11
|
+
For example, in the M(ansible.builtin.shell) module, ``cmd="base64 --decode > myfile.bin" stdin="{{ encoded }}"``.
|
|
12
12
|
positional: _input
|
|
13
13
|
options:
|
|
14
14
|
_input:
|
|
15
|
-
description: A
|
|
15
|
+
description: A Base64 string to decode.
|
|
16
16
|
type: string
|
|
17
17
|
required: true
|
|
18
18
|
|
|
19
19
|
EXAMPLES: |
|
|
20
|
-
#
|
|
20
|
+
# Base64 decode a string
|
|
21
21
|
lola: "{{ 'bG9sYQ==' | b64decode }}"
|
|
22
22
|
|
|
23
|
-
#
|
|
23
|
+
# Base64 decode the content of 'b64stuff' variable
|
|
24
24
|
stuff: "{{ b64stuff | b64decode }}"
|
|
25
25
|
|
|
26
26
|
RETURN:
|
|
27
27
|
_value:
|
|
28
|
-
description: The contents of the
|
|
28
|
+
description: The contents of the Base64 encoded string.
|
|
29
29
|
type: string
|
|
@@ -2,7 +2,7 @@ DOCUMENTATION:
|
|
|
2
2
|
name: b64encode
|
|
3
3
|
author: ansible core team
|
|
4
4
|
version_added: 'historical'
|
|
5
|
-
short_description: Encode a string as
|
|
5
|
+
short_description: Encode a string as Base64
|
|
6
6
|
description:
|
|
7
7
|
- Base64 encoding function.
|
|
8
8
|
positional: _input
|
|
@@ -13,13 +13,13 @@ DOCUMENTATION:
|
|
|
13
13
|
required: true
|
|
14
14
|
|
|
15
15
|
EXAMPLES: |
|
|
16
|
-
#
|
|
16
|
+
# Base64 encode a string
|
|
17
17
|
b64lola: "{{ 'lola'| b64encode }}"
|
|
18
18
|
|
|
19
|
-
#
|
|
19
|
+
# Base64 encode the content of 'stuff' variable
|
|
20
20
|
b64stuff: "{{ stuff | b64encode }}"
|
|
21
21
|
|
|
22
22
|
RETURN:
|
|
23
23
|
_value:
|
|
24
|
-
description: A
|
|
24
|
+
description: A Base64 encoded string.
|
|
25
25
|
type: string
|
|
@@ -18,7 +18,7 @@ DOCUMENTATION:
|
|
|
18
18
|
decoration:
|
|
19
19
|
description: Indicator for comment or intermediate comment depending on the style.
|
|
20
20
|
type: string
|
|
21
|
-
|
|
21
|
+
beginning:
|
|
22
22
|
description: Indicator of the start of a comment block, only available for styles that support multiline comments.
|
|
23
23
|
type: string
|
|
24
24
|
end:
|
ansible/plugins/filter/core.py
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
# (c) 2012, Jeroen Hoekx <jeroen@hoekx.be>
|
|
2
2
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
from __future__ import (absolute_import, division, print_function)
|
|
6
|
-
__metaclass__ = type
|
|
4
|
+
from __future__ import annotations
|
|
7
5
|
|
|
8
6
|
import base64
|
|
9
7
|
import glob
|
|
@@ -46,7 +44,7 @@ UUID_NAMESPACE_ANSIBLE = uuid.UUID('361E6D51-FAEC-444A-9079-341386DA8E2E')
|
|
|
46
44
|
|
|
47
45
|
|
|
48
46
|
def to_yaml(a, *args, **kw):
|
|
49
|
-
'''Make verbose, human
|
|
47
|
+
'''Make verbose, human-readable yaml'''
|
|
50
48
|
default_flow_style = kw.pop('default_flow_style', None)
|
|
51
49
|
try:
|
|
52
50
|
transformed = yaml.dump(a, Dumper=AnsibleDumper, allow_unicode=True, default_flow_style=default_flow_style, **kw)
|
|
@@ -56,7 +54,7 @@ def to_yaml(a, *args, **kw):
|
|
|
56
54
|
|
|
57
55
|
|
|
58
56
|
def to_nice_yaml(a, indent=4, *args, **kw):
|
|
59
|
-
'''Make verbose, human
|
|
57
|
+
'''Make verbose, human-readable yaml'''
|
|
60
58
|
try:
|
|
61
59
|
transformed = yaml.dump(a, Dumper=AnsibleDumper, indent=indent, allow_unicode=True, default_flow_style=False, **kw)
|
|
62
60
|
except Exception as e:
|
|
@@ -77,7 +75,7 @@ def to_json(a, *args, **kw):
|
|
|
77
75
|
|
|
78
76
|
|
|
79
77
|
def to_nice_json(a, indent=4, sort_keys=True, *args, **kw):
|
|
80
|
-
'''Make verbose, human
|
|
78
|
+
'''Make verbose, human-readable JSON'''
|
|
81
79
|
return to_json(a, indent=indent, sort_keys=sort_keys, separators=(',', ': '), *args, **kw)
|
|
82
80
|
|
|
83
81
|
|
|
@@ -122,7 +120,7 @@ def fileglob(pathname):
|
|
|
122
120
|
return [g for g in glob.glob(pathname) if os.path.isfile(g)]
|
|
123
121
|
|
|
124
122
|
|
|
125
|
-
def regex_replace(value='', pattern='', replacement='', ignorecase=False, multiline=False):
|
|
123
|
+
def regex_replace(value='', pattern='', replacement='', ignorecase=False, multiline=False, count=0, mandatory_count=0):
|
|
126
124
|
''' Perform a `re.sub` returning a string '''
|
|
127
125
|
|
|
128
126
|
value = to_text(value, errors='surrogate_or_strict', nonstring='simplerepr')
|
|
@@ -133,7 +131,11 @@ def regex_replace(value='', pattern='', replacement='', ignorecase=False, multil
|
|
|
133
131
|
if multiline:
|
|
134
132
|
flags |= re.M
|
|
135
133
|
_re = re.compile(pattern, flags=flags)
|
|
136
|
-
|
|
134
|
+
(output, subs) = _re.subn(replacement, value, count=count)
|
|
135
|
+
if mandatory_count and mandatory_count != subs:
|
|
136
|
+
raise AnsibleFilterError("'%s' should match %d times, but matches %d times in '%s'"
|
|
137
|
+
% (pattern, mandatory_count, count, value))
|
|
138
|
+
return output
|
|
137
139
|
|
|
138
140
|
|
|
139
141
|
def regex_findall(value, regex, multiline=False, ignorecase=False):
|
|
@@ -595,7 +597,7 @@ def commonpath(paths):
|
|
|
595
597
|
:rtype: str
|
|
596
598
|
"""
|
|
597
599
|
if not is_sequence(paths):
|
|
598
|
-
raise AnsibleFilterTypeError("|
|
|
600
|
+
raise AnsibleFilterTypeError("|commonpath expects sequence, got %s instead." % type(paths))
|
|
599
601
|
|
|
600
602
|
return os.path.commonpath(paths)
|
|
601
603
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# Copyright: (c) 2021, Ansible Project
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
from __future__ import (absolute_import, division, print_function)
|
|
5
|
-
__metaclass__ = type
|
|
3
|
+
from __future__ import annotations
|
|
6
4
|
|
|
7
5
|
from jinja2.runtime import Undefined
|
|
8
6
|
from jinja2.exceptions import UndefinedError
|
|
@@ -17,7 +17,7 @@ DOCUMENTATION:
|
|
|
17
17
|
type: raw
|
|
18
18
|
required: true
|
|
19
19
|
morekeys:
|
|
20
|
-
description:
|
|
20
|
+
description: Indices or keys to extract from the initial result (subkeys/subindices).
|
|
21
21
|
type: list
|
|
22
22
|
elements: dictionary
|
|
23
23
|
required: true
|
|
@@ -5,7 +5,7 @@ DOCUMENTATION:
|
|
|
5
5
|
description:
|
|
6
6
|
- Converts a YAML documents in a string representation into an equivalent structured Ansible variable.
|
|
7
7
|
- Ansible internally auto-converts YAML strings into variable structures in most contexts, but by default does not handle 'multi document' YAML files or strings.
|
|
8
|
-
- If multiple YAML documents are not supplied, this is the
|
|
8
|
+
- If multiple YAML documents are not supplied, this is the equivalence of using C(from_yaml).
|
|
9
9
|
notes:
|
|
10
10
|
- This filter functions as a wrapper to the Python C(yaml.safe_load_all) function, part of the L(pyyaml Python library, https://pypi.org/project/PyYAML/).
|
|
11
11
|
- Possible conflicts in variable names from the multiple documents are resolved directly by the pyyaml library.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
DOCUMENTATION:
|
|
2
2
|
name: human_redable
|
|
3
3
|
version_added: "historical"
|
|
4
|
-
short_description: Make bytes/bits human
|
|
4
|
+
short_description: Make bytes/bits human-readable
|
|
5
5
|
description:
|
|
6
|
-
- Convert byte or bit figures to more human
|
|
6
|
+
- Convert byte or bit figures to more human-readable formats.
|
|
7
7
|
positional: _input, isbits, unit
|
|
8
8
|
options:
|
|
9
9
|
_input:
|
|
@@ -31,5 +31,5 @@ EXAMPLES: |
|
|
|
31
31
|
|
|
32
32
|
RETURN:
|
|
33
33
|
_value:
|
|
34
|
-
description:
|
|
34
|
+
description: human-readable byte or bit size.
|
|
35
35
|
type: str
|
|
@@ -3,11 +3,11 @@ DOCUMENTATION:
|
|
|
3
3
|
version_added: "historical"
|
|
4
4
|
short_description: Get bytes from string
|
|
5
5
|
description:
|
|
6
|
-
- Convert a human
|
|
6
|
+
- Convert a human-readable byte or bit string into a number bytes.
|
|
7
7
|
positional: _input, default_unit, isbits
|
|
8
8
|
options:
|
|
9
9
|
_input:
|
|
10
|
-
description:
|
|
10
|
+
description: human-readable description of a number of bytes.
|
|
11
11
|
type: int
|
|
12
12
|
required: true
|
|
13
13
|
default_unit:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
DOCUMENTATION:
|
|
2
2
|
name: mandatory
|
|
3
3
|
version_added: "historical"
|
|
4
|
-
short_description: make a variable's
|
|
4
|
+
short_description: make a variable's existence mandatory
|
|
5
5
|
description:
|
|
6
6
|
- Depending on context undefined variables can be ignored or skipped, this ensures they force an error.
|
|
7
7
|
positional: _input
|
|
@@ -145,7 +145,7 @@ def inversepower(x, base=2):
|
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
def human_readable(size, isbits=False, unit=None):
|
|
148
|
-
''' Return a human
|
|
148
|
+
''' Return a human-readable string '''
|
|
149
149
|
try:
|
|
150
150
|
return formatters.bytes_to_human(size, isbits, unit)
|
|
151
151
|
except TypeError as e:
|
|
@@ -155,7 +155,7 @@ def human_readable(size, isbits=False, unit=None):
|
|
|
155
155
|
|
|
156
156
|
|
|
157
157
|
def human_to_bytes(size, default_unit=None, isbits=False):
|
|
158
|
-
''' Return bytes count from a human
|
|
158
|
+
''' Return bytes count from a human-readable string '''
|
|
159
159
|
try:
|
|
160
160
|
return formatters.human_to_bytes(size, default_unit, isbits)
|
|
161
161
|
except TypeError as e:
|
|
@@ -7,6 +7,7 @@ DOCUMENTATION:
|
|
|
7
7
|
positional: _input
|
|
8
8
|
notes:
|
|
9
9
|
- Algorithms available might be restricted by the system.
|
|
10
|
+
- Algorithms may restrict salt length or content. For example, Blowfish/bcrypt requires a 22-character salt.
|
|
10
11
|
options:
|
|
11
12
|
_input:
|
|
12
13
|
description: Secret to hash.
|
|
@@ -18,8 +19,8 @@ DOCUMENTATION:
|
|
|
18
19
|
default: sha512
|
|
19
20
|
choices: [ md5, blowfish, sha256, sha512 ]
|
|
20
21
|
salt:
|
|
21
|
-
description: Secret string
|
|
22
|
-
type:
|
|
22
|
+
description: Secret string used for the hashing. If none is provided a random one can be generated. Use only numbers and letters (characters matching V([./0-9A-Za-z]+)).
|
|
23
|
+
type: string
|
|
23
24
|
rounds:
|
|
24
25
|
description: Number of encryption rounds, default varies by algorithm used.
|
|
25
26
|
type: int
|
|
@@ -6,6 +6,8 @@ DOCUMENTATION:
|
|
|
6
6
|
- Replace a substring defined by a regular expression with another defined by another regular expression based on the first match.
|
|
7
7
|
notes:
|
|
8
8
|
- Maps to Python's C(re.sub).
|
|
9
|
+
- 'The substring matched by the group is accessible via the symbolic group name or
|
|
10
|
+
the ``\{number}`` special sequence. See examples section.'
|
|
9
11
|
positional: _input, _regex_match, _regex_replace
|
|
10
12
|
options:
|
|
11
13
|
_input:
|
|
@@ -28,6 +30,16 @@ DOCUMENTATION:
|
|
|
28
30
|
description: Force the search to be case insensitive if V(True), case sensitive otherwise.
|
|
29
31
|
type: bool
|
|
30
32
|
default: no
|
|
33
|
+
count:
|
|
34
|
+
description: Maximum number of pattern occurrences to replace. If zero, replace all occurrences.
|
|
35
|
+
type: int
|
|
36
|
+
default: 0
|
|
37
|
+
version_added: "2.17"
|
|
38
|
+
mandatory_count:
|
|
39
|
+
description: Except a certain number of replacements. Raises an error otherwise. If zero, ignore.
|
|
40
|
+
type: int
|
|
41
|
+
default: 0
|
|
42
|
+
version_added: "2.17"
|
|
31
43
|
|
|
32
44
|
EXAMPLES: |
|
|
33
45
|
|
|
@@ -46,6 +58,9 @@ EXAMPLES: |
|
|
|
46
58
|
# piratecomment => '#CAR\n#tar\nfoo\n#bar\n'
|
|
47
59
|
piratecomment: "{{ 'CAR\ntar\nfoo\nbar\n' | regex_replace('(?im)^(.ar)$', '#\\1') }}"
|
|
48
60
|
|
|
61
|
+
# 'foo=bar=baz' => 'foo:bar=baz'
|
|
62
|
+
key_value: "{{ 'foo=bar=baz' | regex_replace('=', ':', count=1) }}"
|
|
63
|
+
|
|
49
64
|
RETURN:
|
|
50
65
|
_value:
|
|
51
66
|
description: String with substitution (or original if no match).
|
|
@@ -6,6 +6,8 @@ DOCUMENTATION:
|
|
|
6
6
|
- Search in a string to extract the part that matches the regular expression.
|
|
7
7
|
notes:
|
|
8
8
|
- Maps to Python's C(re.search).
|
|
9
|
+
- 'The substring matched by the group is accessible via the symbolic group name or
|
|
10
|
+
the ``\{number}`` special sequence. See examples section.'
|
|
9
11
|
positional: _input, _regex
|
|
10
12
|
options:
|
|
11
13
|
_input:
|
|
@@ -38,6 +40,16 @@ EXAMPLES: |
|
|
|
38
40
|
# drinkat => 'BAR'
|
|
39
41
|
drinkat: "{{ 'foo\nBAR' | regex_search('^bar', multiline=True, ignorecase=True) }}"
|
|
40
42
|
|
|
43
|
+
# Extracts server and database id from a string using number
|
|
44
|
+
# (the substring matched by the group is accessible via the \number special sequence)
|
|
45
|
+
db: "{{ 'server1/database42' | regex_search('server([0-9]+)/database([0-9]+)', '\\1', '\\2') }}"
|
|
46
|
+
# => ['1', '42']
|
|
47
|
+
|
|
48
|
+
# Extracts dividend and divisor from a division
|
|
49
|
+
# (the substring matched by the group is accessible via the symbolic group name)
|
|
50
|
+
db: "{{ '21/42' | regex_search('(?P<dividend>[0-9]+)/(?P<divisor>[0-9]+)', '\\g<dividend>', '\\g<divisor>') }}"
|
|
51
|
+
# => ['21', '42']
|
|
52
|
+
|
|
41
53
|
RETURN:
|
|
42
54
|
_value:
|
|
43
55
|
description: Matched string or empty string if no match.
|
|
@@ -21,6 +21,7 @@ DOCUMENTATION:
|
|
|
21
21
|
description: Whether time supplied is in UTC.
|
|
22
22
|
type: bool
|
|
23
23
|
default: false
|
|
24
|
+
version_added: '2.14'
|
|
24
25
|
|
|
25
26
|
EXAMPLES: |
|
|
26
27
|
# for a complete set of features go to https://strftime.org/
|
|
@@ -39,15 +40,7 @@ EXAMPLES: |
|
|
|
39
40
|
|
|
40
41
|
# Use arbitrary epoch value
|
|
41
42
|
{{ '%Y-%m-%d' | strftime(0) }} # => 1970-01-01
|
|
42
|
-
{{ '%Y-%m-%d' | strftime(1441357287) }} # => 2015-09-04
|
|
43
|
-
|
|
44
|
-
# complex examples
|
|
45
|
-
vars:
|
|
46
|
-
date1: '2022-11-15T03:23:13.686956868Z'
|
|
47
|
-
date2: '2021-12-15T16:06:24.400087Z'
|
|
48
|
-
date_short: '{{ date1|regex_replace("([^.]+)(\.\d{6})(\d*)(.+)", "\1\2\4") }}' #shorten microseconds
|
|
49
|
-
iso8601format: '%Y-%m-%dT%H:%M:%S.%fZ'
|
|
50
|
-
date_diff_isoed: '{{ (date1|to_datetime(isoformat) - date2|to_datetime(isoformat)).total_seconds() }}'
|
|
43
|
+
{{ '%Y-%m-%d' | strftime(seconds=1441357287, utc=true) }} # => 2015-09-04
|
|
51
44
|
|
|
52
45
|
RETURN:
|
|
53
46
|
_value:
|
|
@@ -4,9 +4,14 @@ DOCUMENTATION:
|
|
|
4
4
|
short_description: Get C(datetime) from string
|
|
5
5
|
description:
|
|
6
6
|
- Using the input string attempt to create a matching Python C(datetime) object.
|
|
7
|
+
- Adding or Subtracting two datetime objects will result in a Python C(timedelta) object.
|
|
7
8
|
notes:
|
|
8
9
|
- For a full list of format codes for working with Python date format strings, see
|
|
9
10
|
L(the Python documentation, https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior).
|
|
11
|
+
- The timedelta object produced by the difference of two datetimes store the days, seconds, and microseconds of
|
|
12
|
+
the delta. This results in the C(seconds) attribute being the total seconds of the minutes and hours of that
|
|
13
|
+
delta. See L(datatime.timedelta, https://docs.python.org/3/library/datetime.html#timedelta-objects) for more
|
|
14
|
+
information about how a timedelta works.
|
|
10
15
|
positional: _input
|
|
11
16
|
options:
|
|
12
17
|
_input:
|
|
@@ -22,13 +27,23 @@ EXAMPLES: |
|
|
|
22
27
|
# Get total amount of seconds between two dates. Default date format is %Y-%m-%d %H:%M:%S but you can pass your own format
|
|
23
28
|
secsdiff: '{{ (("2016-08-14 20:00:12" | to_datetime) - ("2015-12-25" | to_datetime("%Y-%m-%d"))).total_seconds() }}'
|
|
24
29
|
|
|
25
|
-
# Get remaining seconds after delta has been calculated. NOTE: This does NOT convert years
|
|
30
|
+
# Get remaining seconds after delta has been calculated. NOTE: This does NOT convert years and days to seconds. For that, use total_seconds()
|
|
26
31
|
{{ (("2016-08-14 20:00:12" | to_datetime) - ("2016-08-14 18:00:00" | to_datetime)).seconds }}
|
|
27
|
-
# This expression evaluates to "
|
|
32
|
+
# This expression evaluates to "7212". Delta is 2 hours, 12 seconds
|
|
28
33
|
|
|
29
34
|
# get amount of days between two dates. This returns only number of days and discards remaining hours, minutes, and seconds
|
|
30
35
|
{{ (("2016-08-14 20:00:12" | to_datetime) - ("2015-12-25" | to_datetime('%Y-%m-%d'))).days }}
|
|
31
36
|
|
|
37
|
+
# difference between to dotnet (100ns precision) and iso8601 microsecond timestamps
|
|
38
|
+
# the date1_short regex replace will work for any timestamp that has a higher than microsecond precision
|
|
39
|
+
# by cutting off anything more precise than microseconds
|
|
40
|
+
vars:
|
|
41
|
+
date1: '2022-11-15T03:23:13.6869568Z'
|
|
42
|
+
date2: '2021-12-15T16:06:24.400087Z'
|
|
43
|
+
date1_short: '{{ date1|regex_replace("([^.]+)(\.\d{6})(\d*)(.+)", "\1\2\4") }}' # shorten to microseconds
|
|
44
|
+
iso8601format: '%Y-%m-%dT%H:%M:%S.%fZ'
|
|
45
|
+
date_diff_isoed: '{{ (date1_short|to_datetime(iso8601format) - date2|to_datetime(iso8601format)).total_seconds() }}'
|
|
46
|
+
|
|
32
47
|
RETURN:
|
|
33
48
|
_value:
|
|
34
49
|
description: C(datetime) object from the represented value.
|
|
@@ -39,6 +39,10 @@ DOCUMENTATION:
|
|
|
39
39
|
description: If V(True), keys that are not basic Python types will be skipped.
|
|
40
40
|
default: False
|
|
41
41
|
type: bool
|
|
42
|
+
sort_keys:
|
|
43
|
+
description: Affects sorting of dictionary keys.
|
|
44
|
+
default: True
|
|
45
|
+
type: bool
|
|
42
46
|
notes:
|
|
43
47
|
- Both O(vault_to_text) and O(preprocess_unsafe) defaulted to V(False) between Ansible 2.9 and 2.12.
|
|
44
48
|
- 'These parameters to C(json.dumps) will be ignored, they are overridden for internal use: I(cls), I(default), I(indent), I(separators), I(sort_keys).'
|
ansible/plugins/filter/union.yml
CHANGED
|
@@ -29,7 +29,7 @@ EXAMPLES: |
|
|
|
29
29
|
# list1: [1, 2, 5, 1, 3, 4, 10]
|
|
30
30
|
# list2: [1, 2, 3, 4, 5, 11, 99]
|
|
31
31
|
{{ list1 | union(list2) }}
|
|
32
|
-
# => [1, 2, 5,
|
|
32
|
+
# => [1, 2, 5, 3, 4, 10, 11, 99]
|
|
33
33
|
RETURN:
|
|
34
34
|
_value:
|
|
35
35
|
description: A unique list of all the elements from both lists.
|
ansible/plugins/filter/urls.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: (c) 2012, Dag Wieers (@dagwieers) <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
|
from functools import partial
|
|
10
9
|
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
from __future__ import
|
|
6
|
-
__metaclass__ = type
|
|
5
|
+
from __future__ import annotations
|
|
7
6
|
|
|
8
7
|
DOCUMENTATION = r'''
|
|
9
8
|
name: urlsplit
|
ansible/plugins/filter/zip.yml
CHANGED
|
@@ -5,7 +5,7 @@ DOCUMENTATION:
|
|
|
5
5
|
positional: _input, _additional_lists
|
|
6
6
|
description: Iterate over several iterables in parallel, producing tuples with an item from each one.
|
|
7
7
|
notes:
|
|
8
|
-
- This is mostly a
|
|
8
|
+
- This is mostly a passthrough to Python's C(zip) function.
|
|
9
9
|
options:
|
|
10
10
|
_input:
|
|
11
11
|
description: Original list.
|
|
@@ -34,7 +34,7 @@ EXAMPLES: |
|
|
|
34
34
|
shorter: "{{ [1,2,3] | zip(['a','b','c','d','e','f']) }}"
|
|
35
35
|
|
|
36
36
|
# compose dict from lists of keys and values
|
|
37
|
-
|
|
37
|
+
mydict: "{{ dict(keys_list | zip(values_list)) }}"
|
|
38
38
|
|
|
39
39
|
RETURN:
|
|
40
40
|
_value:
|