ansible-core 2.16.7__py3-none-any.whl → 2.17.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ansible-core might be problematic. Click here for more details.
- ansible/__init__.py +1 -3
- ansible/__main__.py +1 -0
- ansible/_vendor/__init__.py +1 -2
- ansible/cli/__init__.py +7 -8
- ansible/cli/adhoc.py +1 -2
- ansible/cli/arguments/__init__.py +1 -2
- ansible/cli/arguments/option_helpers.py +1 -2
- ansible/cli/config.py +1 -2
- ansible/cli/console.py +1 -2
- ansible/cli/doc.py +326 -202
- ansible/cli/galaxy.py +9 -3
- ansible/cli/inventory.py +4 -6
- ansible/cli/playbook.py +1 -2
- ansible/cli/pull.py +4 -5
- ansible/cli/scripts/ansible_connection_cli_stub.py +1 -4
- ansible/cli/vault.py +1 -2
- ansible/collections/list.py +1 -0
- ansible/compat/__init__.py +1 -4
- ansible/compat/importlib_resources.py +1 -2
- ansible/compat/{selectors/__init__.py → selectors.py} +12 -12
- ansible/config/ansible_builtin_runtime.yml +2 -0
- ansible/config/base.yml +154 -149
- ansible/config/manager.py +33 -25
- ansible/constants.py +1 -2
- ansible/context.py +1 -4
- ansible/errors/__init__.py +1 -3
- ansible/errors/yaml_strings.py +1 -3
- ansible/executor/__init__.py +1 -3
- ansible/executor/discovery/python_target.py +1 -2
- ansible/executor/interpreter_discovery.py +9 -8
- ansible/executor/module_common.py +1 -3
- ansible/executor/play_iterator.py +1 -3
- ansible/executor/playbook_executor.py +1 -3
- ansible/executor/powershell/module_manifest.py +2 -3
- ansible/executor/process/__init__.py +1 -3
- ansible/executor/process/worker.py +1 -3
- ansible/executor/stats.py +1 -3
- ansible/executor/task_executor.py +2 -3
- ansible/executor/task_queue_manager.py +1 -3
- ansible/executor/task_result.py +2 -3
- ansible/galaxy/__init__.py +1 -2
- ansible/galaxy/api.py +10 -2
- ansible/galaxy/collection/__init__.py +38 -24
- ansible/galaxy/collection/concrete_artifact_manager.py +1 -2
- ansible/galaxy/collection/galaxy_api_proxy.py +1 -2
- ansible/galaxy/collection/gpg.py +4 -2
- ansible/galaxy/data/apb/meta/main.yml.j2 +0 -15
- ansible/galaxy/data/container/meta/main.yml.j2 +0 -18
- ansible/galaxy/data/default/role/meta/main.yml.j2 +0 -18
- ansible/galaxy/data/network/cliconf_plugins/example.py.j2 +1 -2
- ansible/galaxy/data/network/library/example_command.py.j2 +1 -2
- ansible/galaxy/data/network/library/example_config.py.j2 +1 -2
- ansible/galaxy/data/network/library/example_facts.py.j2 +1 -2
- ansible/galaxy/data/network/meta/main.yml.j2 +0 -15
- ansible/galaxy/data/network/module_utils/example.py.j2 +1 -2
- ansible/galaxy/data/network/netconf_plugins/example.py.j2 +1 -2
- ansible/galaxy/data/network/terminal_plugins/example.py.j2 +1 -2
- ansible/galaxy/dependency_resolution/__init__.py +1 -2
- ansible/galaxy/dependency_resolution/dataclasses.py +5 -6
- ansible/galaxy/dependency_resolution/errors.py +1 -2
- ansible/galaxy/dependency_resolution/providers.py +3 -4
- ansible/galaxy/dependency_resolution/reporters.py +2 -3
- ansible/galaxy/dependency_resolution/resolvers.py +1 -2
- ansible/galaxy/dependency_resolution/versioning.py +1 -2
- ansible/galaxy/role.py +2 -3
- ansible/galaxy/token.py +1 -2
- ansible/galaxy/user_agent.py +1 -2
- ansible/inventory/data.py +1 -2
- ansible/inventory/group.py +1 -2
- ansible/inventory/helpers.py +1 -2
- ansible/inventory/host.py +1 -3
- ansible/inventory/manager.py +1 -2
- ansible/module_utils/_text.py +1 -2
- ansible/module_utils/ansible_release.py +3 -5
- ansible/module_utils/api.py +1 -2
- ansible/module_utils/basic.py +113 -158
- ansible/module_utils/common/_collections_compat.py +1 -2
- ansible/module_utils/common/_utils.py +1 -3
- ansible/module_utils/common/arg_spec.py +1 -2
- ansible/module_utils/common/collections.py +1 -2
- ansible/module_utils/common/dict_transformations.py +1 -2
- ansible/module_utils/common/file.py +10 -5
- ansible/module_utils/common/json.py +1 -3
- ansible/module_utils/common/locale.py +1 -2
- ansible/module_utils/common/network.py +2 -3
- ansible/module_utils/common/parameters.py +9 -9
- ansible/module_utils/common/process.py +12 -5
- ansible/module_utils/common/respawn.py +2 -3
- ansible/module_utils/common/sys_info.py +1 -2
- ansible/module_utils/common/text/converters.py +1 -2
- ansible/module_utils/common/text/formatters.py +1 -2
- ansible/module_utils/common/validation.py +5 -6
- ansible/module_utils/common/warnings.py +1 -2
- ansible/module_utils/common/yaml.py +1 -2
- ansible/module_utils/compat/datetime.py +1 -3
- ansible/module_utils/compat/importlib.py +21 -13
- ansible/module_utils/compat/paramiko.py +1 -2
- ansible/module_utils/compat/selectors.py +10 -34
- ansible/module_utils/compat/selinux.py +1 -2
- ansible/module_utils/compat/typing.py +1 -2
- ansible/module_utils/compat/version.py +1 -2
- ansible/module_utils/connection.py +1 -2
- ansible/module_utils/csharp/Ansible.Basic.cs +20 -3
- ansible/module_utils/distro/__init__.py +3 -4
- ansible/module_utils/distro/_distro.py +230 -234
- ansible/module_utils/errors.py +1 -2
- ansible/module_utils/facts/__init__.py +1 -2
- ansible/module_utils/facts/ansible_collector.py +1 -2
- ansible/module_utils/facts/collector.py +1 -2
- ansible/module_utils/facts/compat.py +1 -2
- ansible/module_utils/facts/default_collectors.py +1 -2
- ansible/module_utils/facts/hardware/aix.py +1 -2
- ansible/module_utils/facts/hardware/base.py +1 -2
- ansible/module_utils/facts/hardware/darwin.py +1 -2
- ansible/module_utils/facts/hardware/dragonfly.py +1 -2
- ansible/module_utils/facts/hardware/freebsd.py +1 -2
- ansible/module_utils/facts/hardware/hpux.py +1 -2
- ansible/module_utils/facts/hardware/hurd.py +1 -2
- ansible/module_utils/facts/hardware/linux.py +8 -6
- ansible/module_utils/facts/hardware/netbsd.py +1 -2
- ansible/module_utils/facts/hardware/openbsd.py +1 -2
- ansible/module_utils/facts/hardware/sunos.py +2 -3
- ansible/module_utils/facts/namespace.py +1 -2
- ansible/module_utils/facts/network/aix.py +1 -2
- ansible/module_utils/facts/network/base.py +1 -2
- ansible/module_utils/facts/network/darwin.py +1 -2
- ansible/module_utils/facts/network/dragonfly.py +1 -2
- ansible/module_utils/facts/network/fc_wwn.py +1 -2
- ansible/module_utils/facts/network/freebsd.py +1 -2
- ansible/module_utils/facts/network/generic_bsd.py +1 -2
- ansible/module_utils/facts/network/hpux.py +1 -2
- ansible/module_utils/facts/network/hurd.py +1 -2
- ansible/module_utils/facts/network/iscsi.py +1 -2
- ansible/module_utils/facts/network/linux.py +1 -2
- ansible/module_utils/facts/network/netbsd.py +1 -2
- ansible/module_utils/facts/network/nvme.py +1 -2
- ansible/module_utils/facts/network/openbsd.py +1 -2
- ansible/module_utils/facts/network/sunos.py +1 -2
- ansible/module_utils/facts/other/facter.py +1 -2
- ansible/module_utils/facts/other/ohai.py +1 -2
- ansible/module_utils/facts/packages.py +1 -2
- ansible/module_utils/facts/sysctl.py +1 -2
- ansible/module_utils/facts/system/apparmor.py +1 -2
- ansible/module_utils/facts/system/caps.py +1 -2
- ansible/module_utils/facts/system/chroot.py +1 -2
- ansible/module_utils/facts/system/cmdline.py +1 -2
- ansible/module_utils/facts/system/date_time.py +1 -2
- ansible/module_utils/facts/system/distribution.py +4 -5
- ansible/module_utils/facts/system/dns.py +1 -2
- ansible/module_utils/facts/system/env.py +1 -2
- ansible/module_utils/facts/system/fips.py +1 -2
- ansible/module_utils/facts/system/loadavg.py +1 -2
- ansible/module_utils/facts/system/local.py +1 -2
- ansible/module_utils/facts/system/lsb.py +1 -2
- ansible/module_utils/facts/system/pkg_mgr.py +7 -30
- ansible/module_utils/facts/system/platform.py +1 -2
- ansible/module_utils/facts/system/python.py +1 -2
- ansible/module_utils/facts/system/selinux.py +1 -2
- ansible/module_utils/facts/system/service_mgr.py +1 -2
- ansible/module_utils/facts/system/ssh_pub_keys.py +1 -2
- ansible/module_utils/facts/system/user.py +1 -2
- ansible/module_utils/facts/timeout.py +1 -2
- ansible/module_utils/facts/utils.py +1 -2
- ansible/module_utils/facts/virtual/base.py +1 -2
- ansible/module_utils/facts/virtual/dragonfly.py +1 -2
- ansible/module_utils/facts/virtual/freebsd.py +1 -2
- ansible/module_utils/facts/virtual/hpux.py +1 -2
- ansible/module_utils/facts/virtual/linux.py +1 -2
- ansible/module_utils/facts/virtual/netbsd.py +1 -2
- ansible/module_utils/facts/virtual/openbsd.py +1 -2
- ansible/module_utils/facts/virtual/sunos.py +1 -2
- ansible/module_utils/facts/virtual/sysctl.py +1 -2
- ansible/module_utils/json_utils.py +1 -2
- ansible/module_utils/parsing/convert_bool.py +1 -2
- ansible/module_utils/powershell/Ansible.ModuleUtils.Legacy.psm1 +5 -2
- ansible/module_utils/powershell/Ansible.ModuleUtils.WebRequest.psm1 +1 -1
- ansible/module_utils/pycompat24.py +24 -4
- ansible/module_utils/service.py +31 -5
- ansible/module_utils/six/__init__.py +1 -1
- ansible/module_utils/splitter.py +1 -2
- ansible/module_utils/urls.py +335 -1052
- ansible/module_utils/yumdnf.py +13 -35
- ansible/modules/add_host.py +1 -2
- ansible/modules/apt.py +38 -22
- ansible/modules/apt_key.py +1 -2
- ansible/modules/apt_repository.py +18 -10
- ansible/modules/assemble.py +1 -2
- ansible/modules/assert.py +8 -4
- ansible/modules/async_status.py +17 -14
- ansible/modules/async_wrapper.py +11 -9
- ansible/modules/blockinfile.py +2 -3
- ansible/modules/command.py +1 -2
- ansible/modules/copy.py +4 -76
- ansible/modules/cron.py +3 -3
- ansible/modules/deb822_repository.py +5 -5
- ansible/modules/debconf.py +19 -8
- ansible/modules/debug.py +1 -2
- ansible/modules/dnf.py +39 -46
- ansible/modules/dnf5.py +28 -26
- ansible/modules/dpkg_selections.py +1 -2
- ansible/modules/expect.py +23 -15
- ansible/modules/fail.py +1 -2
- ansible/modules/fetch.py +1 -2
- ansible/modules/file.py +4 -3
- ansible/modules/find.py +18 -5
- ansible/modules/gather_facts.py +1 -2
- ansible/modules/get_url.py +2 -3
- ansible/modules/getent.py +2 -3
- ansible/modules/git.py +28 -17
- ansible/modules/group.py +1 -2
- ansible/modules/group_by.py +1 -2
- ansible/modules/hostname.py +2 -19
- ansible/modules/import_playbook.py +1 -2
- ansible/modules/import_role.py +9 -2
- ansible/modules/import_tasks.py +1 -2
- ansible/modules/include_role.py +1 -2
- ansible/modules/include_tasks.py +1 -2
- ansible/modules/include_vars.py +1 -2
- ansible/modules/iptables.py +38 -21
- ansible/modules/known_hosts.py +15 -8
- ansible/modules/lineinfile.py +1 -6
- ansible/modules/meta.py +3 -2
- ansible/modules/package.py +6 -5
- ansible/modules/package_facts.py +1 -2
- ansible/modules/pause.py +2 -3
- ansible/modules/ping.py +1 -2
- ansible/modules/pip.py +40 -20
- ansible/modules/raw.py +1 -2
- ansible/modules/reboot.py +1 -2
- ansible/modules/replace.py +7 -5
- ansible/modules/rpm_key.py +1 -2
- ansible/modules/script.py +1 -2
- ansible/modules/service.py +3 -21
- ansible/modules/service_facts.py +3 -12
- ansible/modules/set_fact.py +1 -2
- ansible/modules/set_stats.py +1 -2
- ansible/modules/setup.py +1 -2
- ansible/modules/shell.py +1 -2
- ansible/modules/slurp.py +1 -2
- ansible/modules/stat.py +1 -2
- ansible/modules/subversion.py +2 -3
- ansible/modules/systemd.py +12 -9
- ansible/modules/systemd_service.py +12 -9
- ansible/modules/sysvinit.py +7 -2
- ansible/modules/tempfile.py +7 -2
- ansible/modules/template.py +2 -3
- ansible/modules/unarchive.py +13 -3
- ansible/modules/uri.py +12 -15
- ansible/modules/user.py +11 -4
- ansible/modules/validate_argument_spec.py +15 -16
- ansible/modules/wait_for.py +1 -2
- ansible/modules/wait_for_connection.py +1 -2
- ansible/modules/yum_repository.py +2 -3
- ansible/parsing/__init__.py +1 -3
- ansible/parsing/ajson.py +1 -3
- ansible/parsing/dataloader.py +23 -12
- ansible/parsing/mod_args.py +6 -4
- ansible/parsing/plugin_docs.py +1 -2
- ansible/parsing/quoting.py +1 -3
- ansible/parsing/splitter.py +1 -3
- ansible/parsing/utils/__init__.py +1 -3
- ansible/parsing/utils/addresses.py +1 -3
- ansible/parsing/utils/jsonify.py +1 -3
- ansible/parsing/utils/yaml.py +1 -3
- ansible/parsing/vault/__init__.py +6 -8
- ansible/parsing/yaml/__init__.py +1 -3
- ansible/parsing/yaml/constructor.py +1 -3
- ansible/parsing/yaml/dumper.py +1 -3
- ansible/parsing/yaml/loader.py +1 -3
- ansible/parsing/yaml/objects.py +1 -3
- ansible/playbook/__init__.py +1 -3
- ansible/playbook/attribute.py +1 -3
- ansible/playbook/base.py +2 -3
- ansible/playbook/block.py +1 -3
- ansible/playbook/collectionsearch.py +1 -2
- ansible/playbook/conditional.py +1 -3
- ansible/playbook/delegatable.py +1 -0
- ansible/playbook/handler.py +2 -4
- ansible/playbook/handler_task_include.py +1 -3
- ansible/playbook/helpers.py +1 -4
- ansible/playbook/included_file.py +4 -4
- ansible/playbook/loop_control.py +1 -3
- ansible/playbook/notifiable.py +1 -0
- ansible/playbook/play.py +1 -3
- ansible/playbook/play_context.py +1 -3
- ansible/playbook/playbook_include.py +1 -3
- ansible/playbook/role/__init__.py +1 -3
- ansible/playbook/role/definition.py +1 -3
- ansible/playbook/role/include.py +1 -3
- ansible/playbook/role/metadata.py +1 -3
- ansible/playbook/role/requirement.py +1 -3
- ansible/playbook/role_include.py +2 -10
- ansible/playbook/taggable.py +1 -3
- ansible/playbook/task.py +2 -4
- ansible/playbook/task_include.py +1 -3
- ansible/plugins/__init__.py +4 -5
- ansible/plugins/action/__init__.py +19 -13
- ansible/plugins/action/add_host.py +2 -4
- ansible/plugins/action/assemble.py +2 -3
- ansible/plugins/action/assert.py +1 -2
- ansible/plugins/action/async_status.py +1 -2
- ansible/plugins/action/command.py +1 -2
- ansible/plugins/action/copy.py +12 -9
- ansible/plugins/action/debug.py +1 -2
- ansible/plugins/action/dnf.py +4 -4
- ansible/plugins/action/fail.py +1 -2
- ansible/plugins/action/fetch.py +2 -3
- ansible/plugins/action/gather_facts.py +3 -4
- ansible/plugins/action/group_by.py +1 -2
- ansible/plugins/action/include_vars.py +1 -2
- ansible/plugins/action/normal.py +1 -2
- ansible/plugins/action/package.py +36 -21
- ansible/plugins/action/pause.py +1 -2
- ansible/plugins/action/raw.py +2 -3
- ansible/plugins/action/reboot.py +30 -15
- ansible/plugins/action/script.py +3 -4
- ansible/plugins/action/service.py +1 -2
- ansible/plugins/action/set_fact.py +1 -2
- ansible/plugins/action/set_stats.py +1 -2
- ansible/plugins/action/shell.py +1 -2
- ansible/plugins/action/template.py +1 -2
- ansible/plugins/action/unarchive.py +1 -2
- ansible/plugins/action/uri.py +2 -3
- ansible/plugins/action/validate_argument_spec.py +1 -2
- ansible/plugins/action/wait_for_connection.py +2 -3
- ansible/plugins/become/__init__.py +1 -2
- ansible/plugins/become/runas.py +1 -2
- ansible/plugins/become/su.py +1 -2
- ansible/plugins/become/sudo.py +1 -2
- ansible/plugins/cache/__init__.py +3 -3
- ansible/plugins/cache/base.py +1 -2
- ansible/plugins/cache/jsonfile.py +1 -3
- ansible/plugins/cache/memory.py +1 -2
- ansible/plugins/callback/__init__.py +2 -4
- ansible/plugins/callback/default.py +2 -3
- ansible/plugins/callback/junit.py +1 -2
- ansible/plugins/callback/minimal.py +1 -3
- ansible/plugins/callback/oneline.py +1 -3
- ansible/plugins/callback/tree.py +1 -2
- ansible/plugins/cliconf/__init__.py +1 -2
- ansible/plugins/connection/__init__.py +4 -5
- ansible/plugins/connection/local.py +3 -4
- ansible/plugins/connection/paramiko_ssh.py +1 -2
- ansible/plugins/connection/psrp.py +1 -2
- ansible/plugins/connection/ssh.py +18 -54
- ansible/plugins/connection/winrm.py +3 -4
- ansible/plugins/doc_fragments/action_common_attributes.py +2 -3
- ansible/plugins/doc_fragments/action_core.py +3 -4
- ansible/plugins/doc_fragments/backup.py +1 -2
- ansible/plugins/doc_fragments/connection_pipelining.py +1 -2
- ansible/plugins/doc_fragments/constructed.py +1 -2
- ansible/plugins/doc_fragments/decrypt.py +2 -3
- ansible/plugins/doc_fragments/default_callback.py +1 -2
- ansible/plugins/doc_fragments/files.py +1 -2
- ansible/plugins/doc_fragments/inventory_cache.py +1 -2
- ansible/plugins/doc_fragments/result_format_callback.py +1 -2
- ansible/plugins/doc_fragments/return_common.py +1 -2
- ansible/plugins/doc_fragments/shell_common.py +1 -2
- ansible/plugins/doc_fragments/shell_windows.py +1 -2
- ansible/plugins/doc_fragments/template_common.py +1 -2
- ansible/plugins/doc_fragments/url.py +1 -2
- ansible/plugins/doc_fragments/url_windows.py +1 -2
- ansible/plugins/doc_fragments/validate.py +1 -2
- ansible/plugins/doc_fragments/vars_plugin_staging.py +1 -2
- ansible/plugins/filter/__init__.py +1 -2
- ansible/plugins/filter/b64decode.yml +8 -8
- ansible/plugins/filter/b64encode.yml +4 -4
- ansible/plugins/filter/comment.yml +1 -1
- ansible/plugins/filter/core.py +11 -9
- ansible/plugins/filter/encryption.py +1 -3
- ansible/plugins/filter/extract.yml +1 -1
- ansible/plugins/filter/from_yaml_all.yml +1 -1
- ansible/plugins/filter/human_readable.yml +3 -3
- ansible/plugins/filter/human_to_bytes.yml +2 -2
- ansible/plugins/filter/mandatory.yml +1 -1
- ansible/plugins/filter/mathstuff.py +2 -2
- ansible/plugins/filter/password_hash.yml +3 -2
- ansible/plugins/filter/regex_replace.yml +15 -0
- ansible/plugins/filter/regex_search.yml +12 -0
- ansible/plugins/filter/strftime.yml +2 -9
- ansible/plugins/filter/to_datetime.yml +17 -2
- ansible/plugins/filter/to_nice_json.yml +4 -0
- ansible/plugins/filter/union.yml +1 -1
- ansible/plugins/filter/urls.py +1 -2
- ansible/plugins/filter/urlsplit.py +1 -2
- ansible/plugins/filter/zip.yml +2 -2
- ansible/plugins/filter/zip_longest.yml +1 -1
- ansible/plugins/httpapi/__init__.py +1 -2
- ansible/plugins/inventory/__init__.py +2 -4
- ansible/plugins/inventory/advanced_host_list.py +1 -2
- ansible/plugins/inventory/auto.py +2 -3
- ansible/plugins/inventory/constructed.py +3 -2
- ansible/plugins/inventory/generator.py +1 -2
- ansible/plugins/inventory/host_list.py +1 -2
- ansible/plugins/inventory/ini.py +1 -2
- ansible/plugins/inventory/script.py +122 -3
- ansible/plugins/inventory/toml.py +1 -2
- ansible/plugins/inventory/yaml.py +3 -4
- ansible/plugins/list.py +2 -3
- ansible/plugins/loader.py +10 -11
- ansible/plugins/lookup/__init__.py +1 -3
- ansible/plugins/lookup/config.py +19 -15
- ansible/plugins/lookup/csvfile.py +16 -7
- ansible/plugins/lookup/dict.py +2 -3
- ansible/plugins/lookup/env.py +4 -4
- ansible/plugins/lookup/file.py +1 -2
- ansible/plugins/lookup/fileglob.py +1 -2
- ansible/plugins/lookup/first_found.py +8 -7
- ansible/plugins/lookup/indexed_items.py +1 -2
- ansible/plugins/lookup/ini.py +6 -3
- ansible/plugins/lookup/inventory_hostnames.py +1 -2
- ansible/plugins/lookup/items.py +1 -2
- ansible/plugins/lookup/lines.py +1 -2
- ansible/plugins/lookup/list.py +1 -3
- ansible/plugins/lookup/nested.py +1 -2
- ansible/plugins/lookup/password.py +16 -14
- ansible/plugins/lookup/pipe.py +1 -2
- ansible/plugins/lookup/random_choice.py +1 -2
- ansible/plugins/lookup/sequence.py +21 -52
- ansible/plugins/lookup/subelements.py +1 -2
- ansible/plugins/lookup/template.py +1 -2
- ansible/plugins/lookup/together.py +1 -2
- ansible/plugins/lookup/unvault.py +1 -2
- ansible/plugins/lookup/url.py +9 -11
- ansible/plugins/lookup/varnames.py +1 -2
- ansible/plugins/lookup/vars.py +1 -2
- ansible/plugins/netconf/__init__.py +1 -2
- ansible/plugins/shell/__init__.py +3 -4
- ansible/plugins/shell/cmd.py +1 -2
- ansible/plugins/shell/powershell.py +1 -2
- ansible/plugins/shell/sh.py +1 -2
- ansible/plugins/strategy/__init__.py +33 -21
- ansible/plugins/strategy/debug.py +1 -2
- ansible/plugins/strategy/free.py +17 -7
- ansible/plugins/strategy/host_pinned.py +1 -3
- ansible/plugins/strategy/linear.py +22 -22
- ansible/plugins/terminal/__init__.py +2 -3
- ansible/plugins/test/__init__.py +1 -2
- ansible/plugins/test/change.yml +1 -1
- ansible/plugins/test/changed.yml +1 -1
- ansible/plugins/test/contains.yml +1 -1
- ansible/plugins/test/core.py +2 -4
- ansible/plugins/test/exists.yml +1 -1
- ansible/plugins/test/failed.yml +1 -1
- ansible/plugins/test/failure.yml +1 -1
- ansible/plugins/test/files.py +1 -3
- ansible/plugins/test/finished.yml +3 -3
- ansible/plugins/test/issuperset.yml +1 -1
- ansible/plugins/test/match.yml +1 -1
- ansible/plugins/test/mathstuff.py +1 -2
- ansible/plugins/test/reachable.yml +1 -1
- ansible/plugins/test/regex.yml +1 -1
- ansible/plugins/test/search.yml +1 -1
- ansible/plugins/test/skip.yml +1 -1
- ansible/plugins/test/skipped.yml +1 -1
- ansible/plugins/test/started.yml +1 -1
- ansible/plugins/test/succeeded.yml +1 -1
- ansible/plugins/test/success.yml +1 -1
- ansible/plugins/test/successful.yml +1 -1
- ansible/plugins/test/superset.yml +1 -1
- ansible/plugins/test/unreachable.yml +1 -1
- ansible/plugins/test/uri.py +1 -3
- ansible/plugins/vars/__init__.py +1 -2
- ansible/plugins/vars/host_group_vars.py +2 -3
- ansible/release.py +3 -5
- ansible/template/__init__.py +14 -27
- ansible/template/native_helpers.py +1 -3
- ansible/template/template.py +1 -3
- ansible/template/vars.py +1 -0
- ansible/utils/__init__.py +1 -3
- ansible/utils/cmd_functions.py +1 -2
- ansible/utils/collection_loader/__init__.py +1 -2
- ansible/utils/collection_loader/_collection_config.py +1 -2
- ansible/utils/collection_loader/_collection_finder.py +1 -2
- ansible/utils/collection_loader/_collection_meta.py +1 -2
- ansible/utils/color.py +1 -2
- ansible/utils/context_objects.py +1 -4
- ansible/utils/display.py +89 -30
- ansible/utils/encrypt.py +4 -105
- ansible/utils/fqcn.py +1 -2
- ansible/utils/galaxy.py +1 -3
- ansible/utils/hashing.py +1 -3
- ansible/utils/helpers.py +1 -3
- ansible/utils/jsonrpc.py +1 -2
- ansible/utils/listify.py +1 -3
- ansible/utils/lock.py +1 -3
- ansible/utils/multiprocessing.py +1 -3
- ansible/utils/native_jinja.py +1 -3
- ansible/utils/path.py +1 -2
- ansible/utils/plugin_docs.py +7 -6
- ansible/utils/py3compat.py +17 -55
- ansible/utils/sentinel.py +1 -3
- ansible/utils/shlex.py +1 -3
- ansible/utils/singleton.py +1 -3
- ansible/utils/ssh_functions.py +1 -3
- ansible/utils/unicode.py +1 -3
- ansible/utils/unsafe_proxy.py +1 -2
- ansible/utils/vars.py +6 -8
- ansible/utils/version.py +1 -3
- ansible/vars/clean.py +1 -3
- ansible/vars/fact_cache.py +1 -2
- ansible/vars/hostvars.py +3 -7
- ansible/vars/manager.py +24 -6
- ansible/vars/reserved.py +1 -3
- {ansible_core-2.16.7.data → ansible_core-2.17.0.data}/scripts/ansible-test +1 -2
- {ansible_core-2.16.7.dist-info → ansible_core-2.17.0.dist-info}/METADATA +3 -3
- ansible_core-2.17.0.dist-info/RECORD +987 -0
- ansible_test/__init__.py +1 -2
- ansible_test/_data/completion/docker.txt +7 -9
- ansible_test/_data/completion/remote.txt +6 -7
- ansible_test/_data/requirements/ansible-test.txt +0 -2
- ansible_test/_data/requirements/constraints.txt +1 -6
- ansible_test/_data/requirements/sanity.ansible-doc.txt +3 -3
- ansible_test/_data/requirements/sanity.changelog.txt +3 -3
- ansible_test/_data/requirements/sanity.import.plugin.txt +2 -2
- ansible_test/_data/requirements/sanity.mypy.txt +12 -12
- ansible_test/_data/requirements/sanity.pep8.txt +1 -1
- ansible_test/_data/requirements/sanity.pylint.txt +7 -7
- ansible_test/_data/requirements/sanity.runtime-metadata.txt +1 -1
- ansible_test/_data/requirements/sanity.validate-modules.txt +3 -3
- ansible_test/_data/requirements/sanity.yamllint.txt +2 -2
- ansible_test/_internal/bootstrap.py +2 -2
- ansible_test/_internal/classification/__init__.py +0 -5
- ansible_test/_internal/commands/integration/cloud/cs.py +1 -1
- ansible_test/_internal/commands/integration/cloud/nios.py +1 -1
- ansible_test/_internal/commands/sanity/__init__.py +1 -27
- ansible_test/_internal/commands/sanity/import.py +0 -18
- ansible_test/_internal/commands/sanity/mypy.py +7 -10
- ansible_test/_internal/commands/units/__init__.py +1 -1
- ansible_test/_internal/config.py +0 -1
- ansible_test/_internal/content_config.py +0 -5
- ansible_test/_internal/coverage_util.py +0 -1
- ansible_test/_internal/docker_util.py +1 -1
- ansible_test/_internal/host_profiles.py +5 -4
- ansible_test/_internal/pypi_proxy.py +1 -8
- ansible_test/_internal/python_requirements.py +1 -119
- ansible_test/_internal/ssh.py +1 -0
- ansible_test/_internal/util.py +1 -1
- ansible_test/_internal/util_common.py +1 -1
- ansible_test/_internal/venv.py +10 -108
- ansible_test/_util/__init__.py +1 -2
- ansible_test/_util/controller/sanity/mypy/ansible-core.ini +0 -6
- ansible_test/_util/controller/sanity/mypy/modules.ini +0 -6
- ansible_test/_util/controller/sanity/pylint/config/ansible-test-target.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/config/ansible-test.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/config/code-smell.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/config/collection.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/config/default.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py +1 -2
- ansible_test/_util/controller/sanity/shellcheck/exclude.txt +0 -1
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py +31 -59
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/module_args.py +0 -7
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py +10 -2
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/utils.py +1 -1
- ansible_test/_util/controller/sanity/yamllint/yamllinter.py +16 -4
- ansible_test/_util/target/__init__.py +1 -2
- ansible_test/_util/target/cli/ansible_test_cli_stub.py +1 -2
- ansible_test/_util/target/common/constants.py +1 -4
- ansible_test/_util/target/injector/python.py +4 -19
- ansible_test/_util/target/pytest/plugins/ansible_forked.py +2 -9
- ansible_test/_util/target/pytest/plugins/ansible_pytest_collections.py +1 -5
- ansible_test/_util/target/pytest/plugins/ansible_pytest_coverage.py +1 -2
- ansible_test/_util/target/sanity/compile/compile.py +3 -12
- ansible_test/_util/target/sanity/import/importer.py +1 -12
- ansible_test/_util/target/setup/bootstrap.sh +49 -105
- ansible_test/_util/target/setup/probe_cgroups.py +1 -2
- ansible_test/_util/target/setup/quiet_pip.py +1 -16
- ansible_test/_util/target/setup/requirements.py +9 -2
- ansible_test/_util/target/tools/virtualenvcheck.py +1 -2
- ansible_test/_util/target/tools/yamlcheck.py +1 -2
- ansible/module_utils/common/_json_compat.py +0 -16
- ansible/module_utils/compat/_selectors2.py +0 -655
- ansible/modules/yum.py +0 -1821
- ansible/plugins/action/yum.py +0 -111
- ansible_core-2.16.7.dist-info/RECORD +0 -1009
- ansible_test/_util/controller/sanity/code-smell/future-import-boilerplate.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/future-import-boilerplate.py +0 -46
- ansible_test/_util/controller/sanity/code-smell/metaclass-boilerplate.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/metaclass-boilerplate.py +0 -44
- ansible_test/_util/controller/sanity/code-smell/no-basestring.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/no-basestring.py +0 -21
- ansible_test/_util/controller/sanity/code-smell/no-dict-iteritems.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/no-dict-iteritems.py +0 -21
- ansible_test/_util/controller/sanity/code-smell/no-dict-iterkeys.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/no-dict-iterkeys.py +0 -21
- ansible_test/_util/controller/sanity/code-smell/no-dict-itervalues.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/no-dict-itervalues.py +0 -21
- ansible_test/_util/controller/sanity/code-smell/no-main-display.json +0 -10
- ansible_test/_util/controller/sanity/code-smell/no-main-display.py +0 -21
- ansible_test/_util/controller/sanity/code-smell/no-unicode-literals.json +0 -7
- ansible_test/_util/controller/sanity/code-smell/no-unicode-literals.py +0 -21
- ansible_test/_util/controller/tools/sslcheck.py +0 -22
- ansible_test/_util/target/common/__init__.py +0 -2
- {ansible_core-2.16.7.dist-info → ansible_core-2.17.0.dist-info}/COPYING +0 -0
- {ansible_core-2.16.7.dist-info → ansible_core-2.17.0.dist-info}/WHEEL +0 -0
- {ansible_core-2.16.7.dist-info → ansible_core-2.17.0.dist-info}/entry_points.txt +0 -0
- {ansible_core-2.16.7.dist-info → ansible_core-2.17.0.dist-info}/top_level.txt +0 -0
ansible/modules/iptables.py
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
# Copyright: (c) 2017, Sébastien DA ROCHA <sebastien@da-rocha.net>
|
|
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'''
|
|
@@ -38,7 +37,7 @@ notes:
|
|
|
38
37
|
options:
|
|
39
38
|
table:
|
|
40
39
|
description:
|
|
41
|
-
- This option specifies the packet matching table which the command should operate
|
|
40
|
+
- This option specifies the packet matching table on which the command should operate.
|
|
42
41
|
- If the kernel is configured with automatic module loading, an attempt will be made
|
|
43
42
|
to load the appropriate module for that table if it is not already there.
|
|
44
43
|
type: str
|
|
@@ -134,9 +133,9 @@ options:
|
|
|
134
133
|
description:
|
|
135
134
|
- Specifies a match to use, that is, an extension module that tests for
|
|
136
135
|
a specific property.
|
|
137
|
-
- The set of matches
|
|
136
|
+
- The set of matches makes up the condition under which a target is invoked.
|
|
138
137
|
- Matches are evaluated first to last if specified as an array and work in short-circuit
|
|
139
|
-
fashion, i.e. if one extension yields false, evaluation will stop.
|
|
138
|
+
fashion, i.e. if one extension yields false, the evaluation will stop.
|
|
140
139
|
type: list
|
|
141
140
|
elements: str
|
|
142
141
|
default: []
|
|
@@ -144,7 +143,7 @@ options:
|
|
|
144
143
|
description:
|
|
145
144
|
- This specifies the target of the rule; i.e., what to do if the packet matches it.
|
|
146
145
|
- The target can be a user-defined chain (other than the one
|
|
147
|
-
this rule is in), one of the special builtin targets
|
|
146
|
+
this rule is in), one of the special builtin targets that decide the
|
|
148
147
|
fate of the packet immediately, or an extension (see EXTENSIONS
|
|
149
148
|
below).
|
|
150
149
|
- If this option is omitted in a rule (and the goto parameter
|
|
@@ -153,13 +152,13 @@ options:
|
|
|
153
152
|
type: str
|
|
154
153
|
gateway:
|
|
155
154
|
description:
|
|
156
|
-
- This specifies the IP address of host to send the cloned packets.
|
|
155
|
+
- This specifies the IP address of the host to send the cloned packets.
|
|
157
156
|
- This option is only valid when O(jump) is set to V(TEE).
|
|
158
157
|
type: str
|
|
159
158
|
version_added: "2.8"
|
|
160
159
|
log_prefix:
|
|
161
160
|
description:
|
|
162
|
-
- Specifies a log text for the rule. Only
|
|
161
|
+
- Specifies a log text for the rule. Only makes sense with a LOG jump.
|
|
163
162
|
type: str
|
|
164
163
|
version_added: "2.5"
|
|
165
164
|
log_level:
|
|
@@ -172,7 +171,7 @@ options:
|
|
|
172
171
|
choices: [ '0', '1', '2', '3', '4', '5', '6', '7', 'emerg', 'alert', 'crit', 'error', 'warning', 'notice', 'info', 'debug' ]
|
|
173
172
|
goto:
|
|
174
173
|
description:
|
|
175
|
-
- This specifies that the processing should continue in a user
|
|
174
|
+
- This specifies that the processing should continue in a user-specified chain.
|
|
176
175
|
- Unlike the jump argument return will not continue processing in
|
|
177
176
|
this chain but instead in the chain that called us via jump.
|
|
178
177
|
type: str
|
|
@@ -200,7 +199,7 @@ options:
|
|
|
200
199
|
of fragmented packets.
|
|
201
200
|
- Since there is no way to tell the source or destination ports of such
|
|
202
201
|
a packet (or ICMP type), such a packet will not match any rules which specify them.
|
|
203
|
-
- When the "!" argument precedes fragment argument, the rule will only match head fragments,
|
|
202
|
+
- When the "!" argument precedes the fragment argument, the rule will only match head fragments,
|
|
204
203
|
or unfragmented packets.
|
|
205
204
|
type: str
|
|
206
205
|
set_counters:
|
|
@@ -266,6 +265,7 @@ options:
|
|
|
266
265
|
description:
|
|
267
266
|
- This allows specifying a DSCP mark to be added to packets.
|
|
268
267
|
It takes either an integer or hex value.
|
|
268
|
+
- If the parameter is set, O(jump) is set to V(DSCP).
|
|
269
269
|
- Mutually exclusive with O(set_dscp_mark_class).
|
|
270
270
|
type: str
|
|
271
271
|
version_added: "2.1"
|
|
@@ -273,6 +273,7 @@ options:
|
|
|
273
273
|
description:
|
|
274
274
|
- This allows specifying a predefined DiffServ class which will be
|
|
275
275
|
translated to the corresponding DSCP mark.
|
|
276
|
+
- If the parameter is set, O(jump) is set to V(DSCP).
|
|
276
277
|
- Mutually exclusive with O(set_dscp_mark).
|
|
277
278
|
type: str
|
|
278
279
|
version_added: "2.1"
|
|
@@ -289,7 +290,7 @@ options:
|
|
|
289
290
|
default: []
|
|
290
291
|
src_range:
|
|
291
292
|
description:
|
|
292
|
-
- Specifies the source IP range to match
|
|
293
|
+
- Specifies the source IP range to match the iprange module.
|
|
293
294
|
type: str
|
|
294
295
|
version_added: "2.8"
|
|
295
296
|
dst_range:
|
|
@@ -299,8 +300,8 @@ options:
|
|
|
299
300
|
version_added: "2.8"
|
|
300
301
|
match_set:
|
|
301
302
|
description:
|
|
302
|
-
- Specifies a set name
|
|
303
|
-
- Must be used together with the match_set_flags parameter.
|
|
303
|
+
- Specifies a set name that can be defined by ipset.
|
|
304
|
+
- Must be used together with the O(match_set_flags) parameter.
|
|
304
305
|
- When the V(!) argument is prepended then it inverts the rule.
|
|
305
306
|
- Uses the iptables set extension.
|
|
306
307
|
type: str
|
|
@@ -308,10 +309,11 @@ options:
|
|
|
308
309
|
match_set_flags:
|
|
309
310
|
description:
|
|
310
311
|
- Specifies the necessary flags for the match_set parameter.
|
|
311
|
-
- Must be used together with the match_set parameter.
|
|
312
|
+
- Must be used together with the O(match_set) parameter.
|
|
312
313
|
- Uses the iptables set extension.
|
|
314
|
+
- Choices V(dst,dst) and V(src,src) added in version 2.17.
|
|
313
315
|
type: str
|
|
314
|
-
choices: [ "src", "dst", "src,dst", "dst,src" ]
|
|
316
|
+
choices: [ "src", "dst", "src,dst", "dst,src", "dst,dst", "src,src" ]
|
|
315
317
|
version_added: "2.11"
|
|
316
318
|
limit:
|
|
317
319
|
description:
|
|
@@ -327,14 +329,14 @@ options:
|
|
|
327
329
|
version_added: "2.1"
|
|
328
330
|
uid_owner:
|
|
329
331
|
description:
|
|
330
|
-
- Specifies the UID or username to use in match by owner rule.
|
|
332
|
+
- Specifies the UID or username to use in the match by owner rule.
|
|
331
333
|
- From Ansible 2.6 when the C(!) argument is prepended then the it inverts
|
|
332
334
|
the rule to apply instead to all users except that one specified.
|
|
333
335
|
type: str
|
|
334
336
|
version_added: "2.1"
|
|
335
337
|
gid_owner:
|
|
336
338
|
description:
|
|
337
|
-
- Specifies the GID or group to use in match by owner rule.
|
|
339
|
+
- Specifies the GID or group to use in the match by owner rule.
|
|
338
340
|
type: str
|
|
339
341
|
version_added: "2.9"
|
|
340
342
|
reject_with:
|
|
@@ -364,7 +366,7 @@ options:
|
|
|
364
366
|
- Only built-in chains can have policies.
|
|
365
367
|
- This parameter requires the O(chain) parameter.
|
|
366
368
|
- If you specify this parameter, all other parameters will be ignored.
|
|
367
|
-
- This parameter is used to set default policy for the given O(chain).
|
|
369
|
+
- This parameter is used to set the default policy for the given O(chain).
|
|
368
370
|
Do not confuse this with O(jump) parameter.
|
|
369
371
|
type: str
|
|
370
372
|
choices: [ ACCEPT, DROP, QUEUE, RETURN ]
|
|
@@ -386,9 +388,9 @@ options:
|
|
|
386
388
|
numeric:
|
|
387
389
|
description:
|
|
388
390
|
- This parameter controls the running of the list -action of iptables, which is used internally by the module
|
|
389
|
-
- Does not affect the actual functionality. Use this if iptables
|
|
391
|
+
- Does not affect the actual functionality. Use this if iptables hang when creating a chain or altering policy
|
|
390
392
|
- If V(true), then iptables skips the DNS-lookup of the IP addresses in a chain when it uses the list -action
|
|
391
|
-
- Listing is used internally for example when setting a policy or
|
|
393
|
+
- Listing is used internally for example when setting a policy or creating a chain
|
|
392
394
|
type: bool
|
|
393
395
|
default: false
|
|
394
396
|
version_added: "2.15"
|
|
@@ -636,11 +638,16 @@ def construct_rule(params):
|
|
|
636
638
|
append_param(rule, params['destination_port'], '--destination-port', False)
|
|
637
639
|
append_param(rule, params['to_ports'], '--to-ports', False)
|
|
638
640
|
append_param(rule, params['set_dscp_mark'], '--set-dscp', False)
|
|
641
|
+
if params.get('set_dscp_mark') and params.get('jump').lower() != 'dscp':
|
|
642
|
+
append_jump(rule, params['set_dscp_mark'], 'DSCP')
|
|
643
|
+
|
|
639
644
|
append_param(
|
|
640
645
|
rule,
|
|
641
646
|
params['set_dscp_mark_class'],
|
|
642
647
|
'--set-dscp-class',
|
|
643
648
|
False)
|
|
649
|
+
if params.get('set_dscp_mark_class') and params.get('jump').lower() != 'dscp':
|
|
650
|
+
append_jump(rule, params['set_dscp_mark_class'], 'DSCP')
|
|
644
651
|
append_match_flag(rule, params['syn'], '--syn', True)
|
|
645
652
|
if 'conntrack' in params['match']:
|
|
646
653
|
append_csv(rule, params['ctstate'], '--ctstate')
|
|
@@ -674,6 +681,9 @@ def construct_rule(params):
|
|
|
674
681
|
append_param(rule, params['gid_owner'], '--gid-owner', False)
|
|
675
682
|
if params['jump'] is None:
|
|
676
683
|
append_jump(rule, params['reject_with'], 'REJECT')
|
|
684
|
+
append_jump(rule, params['set_dscp_mark_class'], 'DSCP')
|
|
685
|
+
append_jump(rule, params['set_dscp_mark'], 'DSCP')
|
|
686
|
+
|
|
677
687
|
append_param(rule, params['reject_with'], '--reject-with', False)
|
|
678
688
|
append_param(
|
|
679
689
|
rule,
|
|
@@ -811,7 +821,10 @@ def main():
|
|
|
811
821
|
src_range=dict(type='str'),
|
|
812
822
|
dst_range=dict(type='str'),
|
|
813
823
|
match_set=dict(type='str'),
|
|
814
|
-
match_set_flags=dict(
|
|
824
|
+
match_set_flags=dict(
|
|
825
|
+
type='str',
|
|
826
|
+
choices=['src', 'dst', 'src,dst', 'dst,src', 'src,src', 'dst,dst']
|
|
827
|
+
),
|
|
815
828
|
limit=dict(type='str'),
|
|
816
829
|
limit_burst=dict(type='str'),
|
|
817
830
|
uid_owner=dict(type='str'),
|
|
@@ -828,6 +841,10 @@ def main():
|
|
|
828
841
|
['set_dscp_mark', 'set_dscp_mark_class'],
|
|
829
842
|
['flush', 'policy'],
|
|
830
843
|
),
|
|
844
|
+
required_by=dict(
|
|
845
|
+
set_dscp_mark=('jump',),
|
|
846
|
+
set_dscp_mark_class=('jump',),
|
|
847
|
+
),
|
|
831
848
|
required_if=[
|
|
832
849
|
['jump', 'TEE', ['gateway']],
|
|
833
850
|
['jump', 'tee', ['gateway']],
|
ansible/modules/known_hosts.py
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
# Copyright: (c) 2014, Matthew Vernon <mcv21@cam.ac.uk>
|
|
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'''
|
|
@@ -274,12 +273,20 @@ def search_for_host_key(module, host, key, path, sshkeygen):
|
|
|
274
273
|
module.fail_json(msg="failed to parse output of ssh-keygen for line number: '%s'" % l)
|
|
275
274
|
else:
|
|
276
275
|
found_key = normalize_known_hosts_key(l)
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
elif
|
|
282
|
-
|
|
276
|
+
|
|
277
|
+
if 'options' in found_key and found_key['options'][:15] == '@cert-authority':
|
|
278
|
+
if new_key == found_key: # found a match
|
|
279
|
+
return True, False, found_line # found exactly the same key, don't replace
|
|
280
|
+
elif 'options' in found_key and found_key['options'][:7] == '@revoke':
|
|
281
|
+
if new_key == found_key: # found a match
|
|
282
|
+
return True, False, found_line # found exactly the same key, don't replace
|
|
283
|
+
else:
|
|
284
|
+
if new_key['host'][:3] == '|1|' and found_key['host'][:3] == '|1|': # do not change host hash if already hashed
|
|
285
|
+
new_key['host'] = found_key['host']
|
|
286
|
+
if new_key == found_key: # found a match
|
|
287
|
+
return True, False, found_line # found exactly the same key, don't replace
|
|
288
|
+
elif new_key['type'] == found_key['type']: # found a different key for the same key type
|
|
289
|
+
return True, True, found_line
|
|
283
290
|
|
|
284
291
|
# No match found, return found and replace, but no line
|
|
285
292
|
return True, True, None
|
ansible/modules/lineinfile.py
CHANGED
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
# Copyright: (c) 2017, Ansible Project
|
|
6
6
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
7
7
|
|
|
8
|
-
from __future__ import
|
|
9
|
-
__metaclass__ = type
|
|
8
|
+
from __future__ import annotations
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
DOCUMENTATION = r'''
|
|
@@ -127,10 +126,6 @@ options:
|
|
|
127
126
|
type: bool
|
|
128
127
|
default: no
|
|
129
128
|
version_added: "2.5"
|
|
130
|
-
others:
|
|
131
|
-
description:
|
|
132
|
-
- All arguments accepted by the M(ansible.builtin.file) module also work here.
|
|
133
|
-
type: str
|
|
134
129
|
extends_documentation_fragment:
|
|
135
130
|
- action_common_attributes
|
|
136
131
|
- action_common_attributes.files
|
ansible/modules/meta.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: (c) 2016, Ansible, a Red Hat company
|
|
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'''
|
|
@@ -63,6 +62,8 @@ attributes:
|
|
|
63
62
|
connection:
|
|
64
63
|
details: Most options in this action do not use a connection, except V(reset_connection) which still does not connect to the remote
|
|
65
64
|
support: partial
|
|
65
|
+
until:
|
|
66
|
+
support: none
|
|
66
67
|
notes:
|
|
67
68
|
- V(clear_facts) will remove the persistent facts from M(ansible.builtin.set_fact) using O(ansible.builtin.set_fact#module:cacheable=True),
|
|
68
69
|
but not the current host variable it creates for the current run.
|
ansible/modules/package.py
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
#
|
|
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 = '''
|
|
@@ -16,7 +15,7 @@ author:
|
|
|
16
15
|
- Ansible Core Team
|
|
17
16
|
short_description: Generic OS package manager
|
|
18
17
|
description:
|
|
19
|
-
- This modules manages packages on a target without specifying a package manager module (like M(ansible.builtin.
|
|
18
|
+
- This modules manages packages on a target without specifying a package manager module (like M(ansible.builtin.dnf), M(ansible.builtin.apt), ...).
|
|
20
19
|
It is convenient to use in an heterogeneous environment of machines without having to create a specific task for
|
|
21
20
|
each package manager. M(ansible.builtin.package) calls behind the module for the package manager used by the operating system
|
|
22
21
|
discovered by the module M(ansible.builtin.setup). If M(ansible.builtin.setup) was not yet run, M(ansible.builtin.package) will run it.
|
|
@@ -29,7 +28,8 @@ options:
|
|
|
29
28
|
description:
|
|
30
29
|
- Package name, or package specifier with version.
|
|
31
30
|
- Syntax varies with package manager. For example V(name-1.0) or V(name=1.0).
|
|
32
|
-
- Package names also vary with package manager; this module will not "translate" them per
|
|
31
|
+
- Package names also vary with package manager; this module will not "translate" them per distribution. For example V(libyaml-dev), V(libyaml-devel).
|
|
32
|
+
- To operate on several packages this can accept a comma separated string of packages or a list of packages, depending on the underlying package manager.
|
|
33
33
|
required: true
|
|
34
34
|
state:
|
|
35
35
|
description:
|
|
@@ -38,8 +38,9 @@ options:
|
|
|
38
38
|
required: true
|
|
39
39
|
use:
|
|
40
40
|
description:
|
|
41
|
-
- The required package manager module to use (V(
|
|
41
|
+
- The required package manager module to use (V(dnf), V(apt), and so on). The default V(auto) will use existing facts or try to auto-detect it.
|
|
42
42
|
- You should only use this field if the automatic selection is not working for some reason.
|
|
43
|
+
- Since version 2.17 you can use the C(ansible_package_use) variable to override the automatic detection, but this option still takes precedence.
|
|
43
44
|
default: auto
|
|
44
45
|
requirements:
|
|
45
46
|
- Whatever is required for the package plugins specific for each system.
|
ansible/modules/package_facts.py
CHANGED
ansible/modules/pause.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# -*- coding: utf-8 -*-
|
|
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
|
|
|
8
7
|
DOCUMENTATION = '''
|
|
@@ -15,7 +14,7 @@ description:
|
|
|
15
14
|
- To pause/wait/sleep per host, use the M(ansible.builtin.wait_for) module.
|
|
16
15
|
- You can use C(ctrl+c) if you wish to advance a pause earlier than it is set to expire or if you need to abort a playbook run entirely.
|
|
17
16
|
To continue early press C(ctrl+c) and then C(c). To abort a playbook press C(ctrl+c) and then C(a).
|
|
18
|
-
- Prompting for a set amount of time is not supported. Pausing playbook execution is
|
|
17
|
+
- Prompting for a set amount of time is not supported. Pausing playbook execution is interruptible but does not return user input.
|
|
19
18
|
- The pause module integrates into async/parallelized playbooks without any special considerations (see Rolling Updates).
|
|
20
19
|
When using pauses with the C(serial) playbook parameter (as in rolling updates) you are only prompted once for the current group of hosts.
|
|
21
20
|
- This module is also supported for Windows targets.
|
ansible/modules/ping.py
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
# (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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 = '''
|
ansible/modules/pip.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: (c) 2012, Matt Wright <matt@nobien.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 = '''
|
|
@@ -111,6 +110,13 @@ options:
|
|
|
111
110
|
to specify desired umask mode as an octal string, (e.g., "0022").
|
|
112
111
|
type: str
|
|
113
112
|
version_added: "2.1"
|
|
113
|
+
break_system_packages:
|
|
114
|
+
description:
|
|
115
|
+
- Allow pip to modify an externally-managed Python installation as defined by PEP 668.
|
|
116
|
+
- This is typically required when installing packages outside a virtual environment on modern systems.
|
|
117
|
+
type: bool
|
|
118
|
+
default: false
|
|
119
|
+
version_added: "2.17"
|
|
114
120
|
extends_documentation_fragment:
|
|
115
121
|
- action_common_attributes
|
|
116
122
|
attributes:
|
|
@@ -122,7 +128,7 @@ attributes:
|
|
|
122
128
|
platforms: posix
|
|
123
129
|
notes:
|
|
124
130
|
- Python installations marked externally-managed (as defined by PEP668) cannot be updated by pip versions >= 23.0.1 without the use of
|
|
125
|
-
a virtual environment or setting the
|
|
131
|
+
a virtual environment or setting the O(break_system_packages) option.
|
|
126
132
|
- The virtualenv (U(http://www.virtualenv.org/)) must be
|
|
127
133
|
installed on the remote host if the virtualenv parameter is specified and
|
|
128
134
|
the virtualenv needs to be created.
|
|
@@ -236,6 +242,26 @@ EXAMPLES = '''
|
|
|
236
242
|
name: bottle
|
|
237
243
|
umask: "0022"
|
|
238
244
|
become: True
|
|
245
|
+
|
|
246
|
+
- name: Run a module inside a virtual environment
|
|
247
|
+
block:
|
|
248
|
+
- name: Ensure the virtual environment exists
|
|
249
|
+
pip:
|
|
250
|
+
name: psutil
|
|
251
|
+
virtualenv: "{{ venv_dir }}"
|
|
252
|
+
# On Debian-based systems the correct python*-venv package must be installed to use the `venv` module.
|
|
253
|
+
virtualenv_command: "{{ ansible_python_interpreter }} -m venv"
|
|
254
|
+
|
|
255
|
+
- name: Run a module inside the virtual environment
|
|
256
|
+
wait_for:
|
|
257
|
+
port: 22
|
|
258
|
+
vars:
|
|
259
|
+
# Alternatively, use a block to affect multiple tasks, or use set_fact to affect the remainder of the playbook.
|
|
260
|
+
ansible_python_interpreter: "{{ venv_python }}"
|
|
261
|
+
|
|
262
|
+
vars:
|
|
263
|
+
venv_dir: /tmp/pick-a-better-venv-path
|
|
264
|
+
venv_python: "{{ venv_dir }}/bin/python"
|
|
239
265
|
'''
|
|
240
266
|
|
|
241
267
|
RETURN = '''
|
|
@@ -298,7 +324,6 @@ except Exception:
|
|
|
298
324
|
from ansible.module_utils.common.text.converters import to_native
|
|
299
325
|
from ansible.module_utils.basic import AnsibleModule, is_executable, missing_required_lib
|
|
300
326
|
from ansible.module_utils.common.locale import get_best_parsable_locale
|
|
301
|
-
from ansible.module_utils.six import PY3
|
|
302
327
|
|
|
303
328
|
|
|
304
329
|
#: Python one-liners to be run at the command line that will determine the
|
|
@@ -425,15 +450,7 @@ def _is_present(module, req, installed_pkgs, pkg_command):
|
|
|
425
450
|
|
|
426
451
|
|
|
427
452
|
def _get_pip(module, env=None, executable=None):
|
|
428
|
-
|
|
429
|
-
# distros install it there.
|
|
430
|
-
# By default, we try to use pip required for the current python
|
|
431
|
-
# interpreter, so people can use pip to install modules dependencies
|
|
432
|
-
candidate_pip_basenames = ('pip2', 'pip')
|
|
433
|
-
if PY3:
|
|
434
|
-
# pip under python3 installs the "/usr/bin/pip3" name
|
|
435
|
-
candidate_pip_basenames = ('pip3',)
|
|
436
|
-
|
|
453
|
+
candidate_pip_basenames = ('pip3',)
|
|
437
454
|
pip = None
|
|
438
455
|
if executable is not None:
|
|
439
456
|
if os.path.isabs(executable):
|
|
@@ -574,13 +591,10 @@ def setup_virtualenv(module, env, chdir, out, err):
|
|
|
574
591
|
if not _is_venv_command(module.params['virtualenv_command']):
|
|
575
592
|
if virtualenv_python:
|
|
576
593
|
cmd.append('-p%s' % virtualenv_python)
|
|
577
|
-
|
|
578
|
-
#
|
|
579
|
-
#
|
|
580
|
-
#
|
|
581
|
-
# the upstream behaviour of using the python which invoked
|
|
582
|
-
# virtualenv to determine which python is used inside of
|
|
583
|
-
# the virtualenv (when none are specified).
|
|
594
|
+
else:
|
|
595
|
+
# This code mimics the upstream behaviour of using the python
|
|
596
|
+
# which invoked virtualenv to determine which python is used
|
|
597
|
+
# inside of the virtualenv (when none are specified).
|
|
584
598
|
cmd.append('-p%s' % sys.executable)
|
|
585
599
|
|
|
586
600
|
# if venv or pyvenv are used and virtualenv_python is defined, then
|
|
@@ -686,6 +700,7 @@ def main():
|
|
|
686
700
|
chdir=dict(type='path'),
|
|
687
701
|
executable=dict(type='path'),
|
|
688
702
|
umask=dict(type='str'),
|
|
703
|
+
break_system_packages=dict(type='bool', default=False),
|
|
689
704
|
),
|
|
690
705
|
required_one_of=[['name', 'requirements']],
|
|
691
706
|
mutually_exclusive=[['name', 'requirements'], ['executable', 'virtualenv']],
|
|
@@ -790,6 +805,11 @@ def main():
|
|
|
790
805
|
if extra_args:
|
|
791
806
|
cmd.extend(shlex.split(extra_args))
|
|
792
807
|
|
|
808
|
+
if module.params['break_system_packages']:
|
|
809
|
+
# Using an env var instead of the `--break-system-packages` option, to avoid failing under pip 23.0.0 and earlier.
|
|
810
|
+
# See: https://github.com/pypa/pip/pull/11780
|
|
811
|
+
os.environ['PIP_BREAK_SYSTEM_PACKAGES'] = '1'
|
|
812
|
+
|
|
793
813
|
if name:
|
|
794
814
|
cmd.extend(to_native(p) for p in packages)
|
|
795
815
|
elif requirements:
|
ansible/modules/raw.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: (c) 2012, 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/reboot.py
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
# Copyright: (c) 2018, 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'''
|
ansible/modules/replace.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'''
|
|
@@ -75,6 +74,7 @@ options:
|
|
|
75
74
|
- Uses Python regular expressions; see
|
|
76
75
|
U(https://docs.python.org/3/library/re.html).
|
|
77
76
|
- Uses DOTALL, which means the V(.) special character I(can match newlines).
|
|
77
|
+
- Does not use MULTILINE, so V(^) and V($) will only match the beginning and end of the file.
|
|
78
78
|
type: str
|
|
79
79
|
version_added: "2.4"
|
|
80
80
|
before:
|
|
@@ -84,6 +84,7 @@ options:
|
|
|
84
84
|
- Uses Python regular expressions; see
|
|
85
85
|
U(https://docs.python.org/3/library/re.html).
|
|
86
86
|
- Uses DOTALL, which means the V(.) special character I(can match newlines).
|
|
87
|
+
- Does not use MULTILINE, so V(^) and V($) will only match the beginning and end of the file.
|
|
87
88
|
type: str
|
|
88
89
|
version_added: "2.4"
|
|
89
90
|
backup:
|
|
@@ -125,7 +126,7 @@ EXAMPLES = r'''
|
|
|
125
126
|
regexp: '^(.+)$'
|
|
126
127
|
replace: '# \1'
|
|
127
128
|
|
|
128
|
-
- name: Replace before the expression
|
|
129
|
+
- name: Replace before the expression from the beginning of the file (requires Ansible >= 2.4)
|
|
129
130
|
ansible.builtin.replace:
|
|
130
131
|
path: /etc/apache2/sites-available/default.conf
|
|
131
132
|
before: '# live site config'
|
|
@@ -134,11 +135,12 @@ EXAMPLES = r'''
|
|
|
134
135
|
|
|
135
136
|
# Prior to Ansible 2.7.10, using before and after in combination did the opposite of what was intended.
|
|
136
137
|
# see https://github.com/ansible/ansible/issues/31354 for details.
|
|
138
|
+
# Note (?m) which turns on MULTILINE mode so ^ matches any line's beginning
|
|
137
139
|
- name: Replace between the expressions (requires Ansible >= 2.4)
|
|
138
140
|
ansible.builtin.replace:
|
|
139
141
|
path: /etc/hosts
|
|
140
|
-
after: '
|
|
141
|
-
before: '
|
|
142
|
+
after: '(?m)^<VirtualHost [*]>'
|
|
143
|
+
before: '(?m)^</VirtualHost>'
|
|
142
144
|
regexp: '^(.+)$'
|
|
143
145
|
replace: '# \1'
|
|
144
146
|
|
ansible/modules/rpm_key.py
CHANGED
ansible/modules/script.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Copyright: (c) 2012, 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
|
|
|
8
7
|
DOCUMENTATION = r'''
|
ansible/modules/service.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# Copyright: (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 = r'''
|
|
@@ -180,7 +179,7 @@ from ansible.module_utils.common.text.converters import to_bytes, to_text
|
|
|
180
179
|
from ansible.module_utils.basic import AnsibleModule
|
|
181
180
|
from ansible.module_utils.common.locale import get_best_parsable_locale
|
|
182
181
|
from ansible.module_utils.common.sys_info import get_platform_subclass
|
|
183
|
-
from ansible.module_utils.service import fail_if_missing
|
|
182
|
+
from ansible.module_utils.service import fail_if_missing, is_systemd_managed
|
|
184
183
|
from ansible.module_utils.six import PY2, b
|
|
185
184
|
|
|
186
185
|
|
|
@@ -485,24 +484,7 @@ class LinuxService(Service):
|
|
|
485
484
|
|
|
486
485
|
# tools must be installed
|
|
487
486
|
if location.get('systemctl', False):
|
|
488
|
-
|
|
489
|
-
# this should show if systemd is the boot init system
|
|
490
|
-
# these mirror systemd's own sd_boot test http://www.freedesktop.org/software/systemd/man/sd_booted.html
|
|
491
|
-
for canary in ["/run/systemd/system/", "/dev/.run/systemd/", "/dev/.systemd/"]:
|
|
492
|
-
if os.path.exists(canary):
|
|
493
|
-
return True
|
|
494
|
-
|
|
495
|
-
# If all else fails, check if init is the systemd command, using comm as cmdline could be symlink
|
|
496
|
-
try:
|
|
497
|
-
f = open('/proc/1/comm', 'r')
|
|
498
|
-
except IOError:
|
|
499
|
-
# If comm doesn't exist, old kernel, no systemd
|
|
500
|
-
return False
|
|
501
|
-
|
|
502
|
-
for line in f:
|
|
503
|
-
if 'systemd' in line:
|
|
504
|
-
return True
|
|
505
|
-
|
|
487
|
+
return is_systemd_managed(self.module)
|
|
506
488
|
return False
|
|
507
489
|
|
|
508
490
|
# Locate a tool to enable/disable a service
|
ansible/modules/service_facts.py
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
# originally copied from AWX's scan_services module to bring this functionality
|
|
4
4
|
# into Core
|
|
5
5
|
|
|
6
|
-
from __future__ import
|
|
7
|
-
__metaclass__ = type
|
|
6
|
+
from __future__ import annotations
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
DOCUMENTATION = r'''
|
|
@@ -95,6 +94,7 @@ import platform
|
|
|
95
94
|
import re
|
|
96
95
|
from ansible.module_utils.basic import AnsibleModule
|
|
97
96
|
from ansible.module_utils.common.locale import get_best_parsable_locale
|
|
97
|
+
from ansible.module_utils.service import is_systemd_managed
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
class BaseService(object):
|
|
@@ -245,16 +245,7 @@ class SystemctlScanService(BaseService):
|
|
|
245
245
|
BAD_STATES = frozenset(['not-found', 'masked', 'failed'])
|
|
246
246
|
|
|
247
247
|
def systemd_enabled(self):
|
|
248
|
-
|
|
249
|
-
try:
|
|
250
|
-
f = open('/proc/1/comm', 'r')
|
|
251
|
-
except IOError:
|
|
252
|
-
# If comm doesn't exist, old kernel, no systemd
|
|
253
|
-
return False
|
|
254
|
-
for line in f:
|
|
255
|
-
if 'systemd' in line:
|
|
256
|
-
return True
|
|
257
|
-
return False
|
|
248
|
+
return is_systemd_managed(self.module)
|
|
258
249
|
|
|
259
250
|
def _list_from_units(self, systemctl_path, services):
|
|
260
251
|
|