ansible-core 2.15.4rc1__py3-none-any.whl → 2.16.0b2__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/cli/__init__.py +3 -3
- ansible/cli/adhoc.py +1 -1
- ansible/cli/arguments/option_helpers.py +15 -5
- ansible/cli/config.py +2 -2
- ansible/cli/console.py +21 -17
- ansible/cli/doc.py +8 -9
- ansible/cli/galaxy.py +60 -27
- ansible/cli/inventory.py +1 -1
- ansible/cli/playbook.py +1 -1
- ansible/cli/pull.py +2 -2
- ansible/cli/scripts/ansible_connection_cli_stub.py +1 -1
- ansible/cli/vault.py +11 -6
- ansible/collections/__init__.py +0 -29
- ansible/collections/list.py +23 -44
- ansible/config/ansible_builtin_runtime.yml +8 -4
- ansible/config/base.yml +34 -22
- ansible/config/manager.py +1 -1
- ansible/constants.py +3 -5
- ansible/errors/__init__.py +1 -1
- ansible/executor/interpreter_discovery.py +1 -1
- ansible/executor/module_common.py +39 -32
- ansible/executor/play_iterator.py +0 -15
- ansible/executor/playbook_executor.py +3 -3
- ansible/executor/powershell/module_manifest.py +1 -1
- ansible/executor/powershell/module_wrapper.ps1 +4 -1
- ansible/executor/process/worker.py +22 -7
- ansible/executor/task_executor.py +39 -40
- ansible/executor/task_queue_manager.py +8 -11
- ansible/galaxy/__init__.py +1 -1
- ansible/galaxy/api.py +8 -11
- ansible/galaxy/collection/__init__.py +17 -4
- ansible/galaxy/collection/concrete_artifact_manager.py +7 -2
- ansible/galaxy/collection/galaxy_api_proxy.py +1 -1
- ansible/galaxy/data/container/README.md +3 -5
- ansible/galaxy/dependency_resolution/__init__.py +1 -6
- ansible/galaxy/dependency_resolution/dataclasses.py +22 -1
- ansible/galaxy/dependency_resolution/providers.py +61 -69
- ansible/galaxy/role.py +31 -13
- ansible/galaxy/token.py +2 -2
- ansible/inventory/group.py +1 -1
- ansible/inventory/manager.py +1 -1
- ansible/module_utils/ansible_release.py +2 -2
- ansible/module_utils/basic.py +11 -41
- ansible/module_utils/common/file.py +0 -100
- ansible/module_utils/common/json.py +1 -1
- ansible/module_utils/common/locale.py +1 -1
- ansible/module_utils/common/text/converters.py +2 -2
- ansible/module_utils/common/validation.py +1 -1
- ansible/module_utils/compat/_selectors2.py +4 -4
- ansible/module_utils/compat/datetime.py +40 -0
- ansible/module_utils/compat/selinux.py +1 -1
- ansible/module_utils/compat/typing.py +1 -1
- ansible/module_utils/connection.py +1 -1
- ansible/module_utils/facts/hardware/linux.py +2 -2
- ansible/module_utils/facts/hardware/openbsd.py +1 -1
- ansible/module_utils/facts/network/linux.py +3 -3
- ansible/module_utils/facts/other/facter.py +8 -15
- ansible/module_utils/facts/sysctl.py +1 -1
- ansible/module_utils/facts/system/date_time.py +2 -2
- ansible/module_utils/facts/system/distribution.py +1 -1
- ansible/module_utils/facts/system/local.py +6 -2
- ansible/module_utils/facts/system/pkg_mgr.py +6 -1
- ansible/module_utils/facts/system/service_mgr.py +4 -2
- ansible/module_utils/parsing/convert_bool.py +1 -1
- ansible/module_utils/service.py +9 -6
- ansible/module_utils/urls.py +40 -22
- ansible/modules/add_host.py +2 -2
- ansible/modules/apt.py +48 -31
- ansible/modules/apt_key.py +4 -4
- ansible/modules/apt_repository.py +5 -5
- ansible/modules/assemble.py +7 -7
- ansible/modules/assert.py +1 -1
- ansible/modules/async_status.py +11 -7
- ansible/modules/async_wrapper.py +1 -1
- ansible/modules/blockinfile.py +60 -17
- ansible/modules/command.py +37 -15
- ansible/modules/copy.py +35 -30
- ansible/modules/cron.py +14 -14
- ansible/modules/deb822_repository.py +4 -3
- ansible/modules/debconf.py +35 -14
- ansible/modules/debug.py +1 -1
- ansible/modules/dnf.py +29 -27
- ansible/modules/dnf5.py +22 -22
- ansible/modules/dpkg_selections.py +9 -2
- ansible/modules/expect.py +4 -4
- ansible/modules/fetch.py +7 -7
- ansible/modules/file.py +30 -30
- ansible/modules/find.py +82 -22
- ansible/modules/gather_facts.py +6 -2
- ansible/modules/get_url.py +29 -29
- ansible/modules/getent.py +4 -4
- ansible/modules/git.py +27 -27
- ansible/modules/group.py +5 -12
- ansible/modules/hostname.py +21 -2
- ansible/modules/include_role.py +5 -5
- ansible/modules/include_tasks.py +2 -2
- ansible/modules/include_vars.py +5 -5
- ansible/modules/iptables.py +70 -65
- ansible/modules/known_hosts.py +7 -7
- ansible/modules/lineinfile.py +33 -33
- ansible/modules/meta.py +13 -13
- ansible/modules/package.py +8 -8
- ansible/modules/package_facts.py +3 -3
- ansible/modules/pause.py +2 -2
- ansible/modules/ping.py +5 -5
- ansible/modules/pip.py +80 -46
- ansible/modules/reboot.py +8 -4
- ansible/modules/replace.py +20 -15
- ansible/modules/rpm_key.py +2 -2
- ansible/modules/script.py +16 -10
- ansible/modules/service.py +26 -98
- ansible/modules/service_facts.py +36 -12
- ansible/modules/set_fact.py +2 -2
- ansible/modules/set_stats.py +2 -2
- ansible/modules/setup.py +18 -18
- ansible/modules/shell.py +3 -3
- ansible/modules/stat.py +9 -30
- ansible/modules/subversion.py +9 -9
- ansible/modules/systemd.py +20 -19
- ansible/modules/systemd_service.py +20 -19
- ansible/modules/sysvinit.py +26 -21
- ansible/modules/tempfile.py +5 -4
- ansible/modules/template.py +60 -6
- ansible/modules/unarchive.py +21 -18
- ansible/modules/uri.py +39 -39
- ansible/modules/user.py +81 -53
- ansible/modules/wait_for.py +22 -21
- ansible/modules/wait_for_connection.py +4 -4
- ansible/modules/yum.py +38 -38
- ansible/modules/yum_repository.py +58 -80
- ansible/parsing/dataloader.py +27 -27
- ansible/parsing/mod_args.py +1 -1
- ansible/parsing/plugin_docs.py +3 -3
- ansible/parsing/splitter.py +14 -16
- ansible/parsing/utils/yaml.py +1 -1
- ansible/parsing/vault/__init__.py +8 -6
- ansible/parsing/yaml/constructor.py +1 -1
- ansible/parsing/yaml/objects.py +1 -1
- ansible/playbook/__init__.py +1 -1
- ansible/playbook/base.py +2 -2
- ansible/playbook/block.py +0 -1
- ansible/playbook/conditional.py +40 -114
- ansible/playbook/helpers.py +5 -28
- ansible/playbook/included_file.py +8 -7
- ansible/playbook/play.py +1 -1
- ansible/playbook/play_context.py +2 -2
- ansible/playbook/playbook_include.py +2 -2
- ansible/playbook/role/__init__.py +1 -1
- ansible/playbook/role/include.py +1 -1
- ansible/playbook/role/metadata.py +1 -1
- ansible/playbook/role_include.py +1 -1
- ansible/playbook/task.py +2 -2
- ansible/playbook/task_include.py +1 -24
- ansible/plugins/__init__.py +13 -5
- ansible/plugins/action/__init__.py +17 -43
- ansible/plugins/action/add_host.py +2 -3
- ansible/plugins/action/assemble.py +1 -1
- ansible/plugins/action/assert.py +2 -1
- ansible/plugins/action/copy.py +2 -2
- ansible/plugins/action/debug.py +2 -1
- ansible/plugins/action/fail.py +1 -0
- ansible/plugins/action/fetch.py +3 -1
- ansible/plugins/action/gather_facts.py +37 -13
- ansible/plugins/action/group_by.py +1 -0
- ansible/plugins/action/include_vars.py +3 -2
- ansible/plugins/action/normal.py +3 -3
- ansible/plugins/action/pause.py +1 -1
- ansible/plugins/action/reboot.py +21 -16
- ansible/plugins/action/script.py +23 -8
- ansible/plugins/action/set_fact.py +1 -0
- ansible/plugins/action/set_stats.py +1 -0
- ansible/plugins/action/shell.py +6 -0
- ansible/plugins/action/template.py +1 -1
- ansible/plugins/action/unarchive.py +1 -1
- ansible/plugins/action/uri.py +1 -1
- ansible/plugins/action/validate_argument_spec.py +1 -0
- ansible/plugins/action/wait_for_connection.py +4 -4
- ansible/plugins/become/__init__.py +1 -1
- ansible/plugins/become/su.py +1 -1
- ansible/plugins/cache/__init__.py +1 -1
- ansible/plugins/callback/junit.py +1 -1
- ansible/plugins/callback/oneline.py +1 -1
- ansible/plugins/callback/tree.py +1 -1
- ansible/plugins/cliconf/__init__.py +2 -2
- ansible/plugins/connection/__init__.py +65 -37
- ansible/plugins/connection/local.py +9 -8
- ansible/plugins/connection/paramiko_ssh.py +34 -28
- ansible/plugins/connection/psrp.py +56 -43
- ansible/plugins/connection/ssh.py +67 -43
- ansible/plugins/connection/winrm.py +77 -30
- ansible/plugins/doc_fragments/constructed.py +4 -4
- ansible/plugins/doc_fragments/files.py +12 -12
- ansible/plugins/doc_fragments/inventory_cache.py +0 -6
- ansible/plugins/doc_fragments/result_format_callback.py +5 -5
- ansible/plugins/doc_fragments/shell_common.py +2 -2
- ansible/plugins/doc_fragments/shell_windows.py +1 -1
- ansible/plugins/doc_fragments/template_common.py +6 -6
- ansible/plugins/doc_fragments/url.py +10 -10
- ansible/plugins/doc_fragments/url_windows.py +15 -15
- ansible/plugins/doc_fragments/vars_plugin_staging.py +4 -4
- ansible/plugins/filter/b64decode.yml +1 -1
- ansible/plugins/filter/b64encode.yml +2 -2
- ansible/plugins/filter/bool.yml +5 -5
- ansible/plugins/filter/combine.yml +1 -1
- ansible/plugins/filter/commonpath.yml +2 -1
- ansible/plugins/filter/core.py +6 -8
- ansible/plugins/filter/dict2items.yml +11 -1
- ansible/plugins/filter/difference.yml +1 -0
- ansible/plugins/filter/encryption.py +1 -1
- ansible/plugins/filter/extract.yml +1 -1
- ansible/plugins/filter/flatten.yml +1 -1
- ansible/plugins/filter/from_yaml.yml +1 -1
- ansible/plugins/filter/from_yaml_all.yml +2 -2
- ansible/plugins/filter/hash.yml +1 -1
- ansible/plugins/filter/human_readable.yml +1 -1
- ansible/plugins/filter/human_to_bytes.yml +2 -2
- ansible/plugins/filter/intersect.yml +1 -0
- ansible/plugins/filter/mandatory.yml +7 -0
- ansible/plugins/filter/mathstuff.py +15 -17
- ansible/plugins/filter/normpath.yml +1 -1
- ansible/plugins/filter/path_join.yml +8 -1
- ansible/plugins/filter/realpath.yml +3 -2
- ansible/plugins/filter/regex_findall.yml +8 -2
- ansible/plugins/filter/regex_replace.yml +9 -3
- ansible/plugins/filter/regex_search.yml +8 -2
- ansible/plugins/filter/relpath.yml +2 -2
- ansible/plugins/filter/root.yml +1 -1
- ansible/plugins/filter/splitext.yml +1 -1
- ansible/plugins/filter/subelements.yml +2 -2
- ansible/plugins/filter/symmetric_difference.yml +1 -0
- ansible/plugins/filter/ternary.yml +5 -5
- ansible/plugins/filter/to_json.yml +7 -7
- ansible/plugins/filter/to_nice_json.yml +5 -5
- ansible/plugins/filter/to_yaml.yml +2 -2
- ansible/plugins/filter/type_debug.yml +1 -1
- ansible/plugins/filter/union.yml +1 -0
- ansible/plugins/filter/unvault.yml +2 -2
- ansible/plugins/filter/urldecode.yml +13 -32
- ansible/plugins/filter/urlsplit.py +1 -1
- ansible/plugins/filter/vault.yml +1 -1
- ansible/plugins/filter/zip.yml +1 -1
- ansible/plugins/filter/zip_longest.yml +1 -1
- ansible/plugins/inventory/__init__.py +1 -1
- ansible/plugins/inventory/advanced_host_list.py +1 -1
- ansible/plugins/inventory/constructed.py +2 -2
- ansible/plugins/inventory/host_list.py +1 -1
- ansible/plugins/inventory/ini.py +6 -3
- ansible/plugins/inventory/script.py +8 -2
- ansible/plugins/inventory/toml.py +1 -1
- ansible/plugins/inventory/yaml.py +1 -1
- ansible/plugins/list.py +21 -17
- ansible/plugins/loader.py +66 -88
- ansible/plugins/lookup/__init__.py +1 -1
- ansible/plugins/lookup/config.py +16 -6
- ansible/plugins/lookup/csvfile.py +7 -4
- ansible/plugins/lookup/env.py +1 -1
- ansible/plugins/lookup/file.py +5 -2
- ansible/plugins/lookup/fileglob.py +5 -2
- ansible/plugins/lookup/first_found.py +20 -14
- ansible/plugins/lookup/ini.py +6 -3
- ansible/plugins/lookup/lines.py +2 -1
- ansible/plugins/lookup/password.py +7 -7
- ansible/plugins/lookup/pipe.py +1 -0
- ansible/plugins/lookup/random_choice.py +2 -2
- ansible/plugins/lookup/sequence.py +1 -1
- ansible/plugins/lookup/subelements.py +2 -2
- ansible/plugins/lookup/template.py +4 -1
- ansible/plugins/lookup/unvault.py +4 -1
- ansible/plugins/lookup/url.py +6 -6
- ansible/plugins/lookup/varnames.py +1 -1
- ansible/plugins/netconf/__init__.py +3 -3
- ansible/plugins/shell/__init__.py +1 -1
- ansible/plugins/shell/cmd.py +7 -7
- ansible/plugins/shell/powershell.py +1 -1
- ansible/plugins/strategy/__init__.py +8 -10
- ansible/plugins/strategy/free.py +1 -1
- ansible/plugins/strategy/linear.py +3 -3
- ansible/plugins/terminal/__init__.py +2 -2
- ansible/plugins/test/abs.yml +1 -1
- ansible/plugins/test/all.yml +1 -1
- ansible/plugins/test/any.yml +1 -1
- ansible/plugins/test/change.yml +2 -2
- ansible/plugins/test/changed.yml +2 -2
- ansible/plugins/test/contains.yml +1 -1
- ansible/plugins/test/core.py +1 -1
- ansible/plugins/test/directory.yml +1 -1
- ansible/plugins/test/exists.yml +3 -2
- ansible/plugins/test/failed.yml +2 -2
- ansible/plugins/test/failure.yml +2 -2
- ansible/plugins/test/falsy.yml +2 -2
- ansible/plugins/test/file.yml +1 -1
- ansible/plugins/test/finished.yml +2 -2
- ansible/plugins/test/is_abs.yml +1 -1
- ansible/plugins/test/is_dir.yml +1 -1
- ansible/plugins/test/is_file.yml +1 -1
- ansible/plugins/test/is_link.yml +1 -1
- ansible/plugins/test/is_mount.yml +1 -1
- ansible/plugins/test/is_same_file.yml +1 -1
- ansible/plugins/test/isnan.yml +1 -1
- ansible/plugins/test/issubset.yml +1 -2
- ansible/plugins/test/issuperset.yml +1 -2
- ansible/plugins/test/link.yml +1 -1
- ansible/plugins/test/link_exists.yml +1 -1
- ansible/plugins/test/match.yml +2 -2
- ansible/plugins/test/mount.yml +1 -1
- ansible/plugins/test/nan.yml +1 -1
- ansible/plugins/test/reachable.yml +2 -2
- ansible/plugins/test/regex.yml +1 -1
- ansible/plugins/test/same_file.yml +1 -1
- ansible/plugins/test/search.yml +2 -2
- ansible/plugins/test/skip.yml +3 -3
- ansible/plugins/test/skipped.yml +3 -3
- ansible/plugins/test/started.yml +2 -2
- ansible/plugins/test/subset.yml +1 -2
- ansible/plugins/test/succeeded.yml +2 -2
- ansible/plugins/test/success.yml +2 -2
- ansible/plugins/test/successful.yml +2 -2
- ansible/plugins/test/superset.yml +1 -2
- ansible/plugins/test/truthy.yml +3 -3
- ansible/plugins/test/unreachable.yml +2 -2
- ansible/plugins/test/uri.yml +1 -1
- ansible/plugins/test/url.yml +1 -1
- ansible/plugins/test/urn.yml +1 -1
- ansible/plugins/test/vault_encrypted.yml +1 -1
- ansible/plugins/test/version.yml +7 -7
- ansible/plugins/test/version_compare.yml +7 -7
- ansible/plugins/vars/host_group_vars.py +1 -1
- ansible/release.py +2 -2
- ansible/template/__init__.py +24 -26
- ansible/template/native_helpers.py +1 -1
- ansible/template/vars.py +1 -1
- ansible/utils/_junit_xml.py +1 -1
- ansible/utils/cmd_functions.py +1 -1
- ansible/utils/collection_loader/_collection_finder.py +12 -1
- ansible/utils/display.py +113 -62
- ansible/utils/encrypt.py +11 -14
- ansible/utils/hashing.py +1 -1
- ansible/utils/jsonrpc.py +1 -1
- ansible/utils/path.py +1 -1
- ansible/utils/plugin_docs.py +1 -1
- ansible/utils/py3compat.py +1 -1
- ansible/utils/shlex.py +2 -10
- ansible/utils/ssh_functions.py +5 -4
- ansible/utils/unicode.py +1 -1
- ansible/utils/unsafe_proxy.py +1 -1
- ansible/utils/vars.py +4 -29
- ansible/vars/hostvars.py +1 -2
- ansible/vars/manager.py +13 -9
- ansible/vars/plugins.py +2 -2
- {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/COPYING +4 -5
- {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/METADATA +2 -4
- {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/RECORD +424 -425
- ansible_test/_data/completion/docker.txt +9 -9
- ansible_test/_data/completion/remote.txt +4 -7
- ansible_test/_data/completion/windows.txt +0 -2
- ansible_test/_data/requirements/ansible-test.txt +2 -1
- ansible_test/_data/requirements/ansible.txt +0 -3
- ansible_test/_data/requirements/constraints.txt +0 -2
- ansible_test/_data/requirements/sanity.ansible-doc.txt +3 -5
- ansible_test/_data/requirements/sanity.changelog.in +1 -2
- ansible_test/_data/requirements/sanity.changelog.txt +4 -6
- ansible_test/_data/requirements/sanity.import.plugin.txt +2 -4
- ansible_test/_data/requirements/sanity.import.txt +1 -3
- ansible_test/_data/requirements/sanity.integration-aliases.txt +1 -3
- 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 +6 -12
- ansible_test/_data/requirements/sanity.runtime-metadata.txt +1 -3
- ansible_test/_data/requirements/sanity.validate-modules.in +1 -1
- ansible_test/_data/requirements/sanity.validate-modules.txt +3 -5
- ansible_test/_data/requirements/sanity.yamllint.txt +3 -5
- ansible_test/_data/requirements/units.txt +0 -1
- ansible_test/_internal/ci/azp.py +4 -4
- ansible_test/_internal/cli/environments.py +0 -13
- ansible_test/_internal/commands/coverage/analyze/targets/__init__.py +4 -4
- ansible_test/_internal/commands/coverage/combine.py +1 -1
- ansible_test/_internal/commands/integration/cloud/acme.py +6 -8
- ansible_test/_internal/commands/integration/cloud/cs.py +4 -9
- ansible_test/_internal/commands/integration/cloud/galaxy.py +103 -96
- ansible_test/_internal/commands/integration/cloud/httptester.py +0 -3
- ansible_test/_internal/commands/integration/cloud/nios.py +7 -9
- ansible_test/_internal/commands/integration/cloud/openshift.py +2 -7
- ansible_test/_internal/commands/integration/cloud/vcenter.py +11 -95
- ansible_test/_internal/commands/sanity/__init__.py +10 -0
- ansible_test/_internal/commands/sanity/import.py +8 -2
- ansible_test/_internal/commands/sanity/pylint.py +27 -1
- ansible_test/_internal/commands/units/__init__.py +2 -1
- ansible_test/_internal/config.py +0 -7
- ansible_test/_internal/containers.py +11 -56
- ansible_test/_internal/core_ci.py +0 -7
- ansible_test/_internal/coverage_util.py +8 -3
- ansible_test/_internal/delegation.py +0 -1
- ansible_test/_internal/diff.py +1 -1
- ansible_test/_internal/docker_util.py +9 -2
- ansible_test/_internal/host_profiles.py +6 -6
- ansible_test/_internal/http.py +1 -1
- ansible_test/_internal/junit_xml.py +1 -1
- ansible_test/_internal/pypi_proxy.py +1 -1
- ansible_test/_internal/python_requirements.py +3 -8
- ansible_test/_internal/util.py +1 -6
- ansible_test/_util/controller/sanity/code-smell/no-get-exception.json +4 -0
- ansible_test/_util/controller/sanity/code-smell/replace-urlopen.json +4 -0
- ansible_test/_util/controller/sanity/code-smell/use-compat-six.json +4 -0
- ansible_test/_util/controller/sanity/mypy/ansible-core.ini +3 -0
- ansible_test/_util/controller/sanity/pylint/config/ansible-test-target.cfg +2 -0
- ansible_test/_util/controller/sanity/pylint/config/ansible-test.cfg +0 -1
- ansible_test/_util/controller/sanity/pylint/config/collection.cfg +1 -0
- ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py +172 -10
- ansible_test/_util/controller/sanity/pylint/plugins/string_format.py +13 -2
- ansible_test/_util/controller/sanity/pylint/plugins/unwanted.py +7 -1
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py +6 -6
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/module_args.py +1 -1
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/utils.py +1 -1
- ansible_test/_util/controller/sanity/yamllint/yamllinter.py +3 -3
- ansible_test/_util/controller/tools/collection_detail.py +2 -2
- ansible_test/_util/target/common/constants.py +2 -2
- ansible_test/_util/target/pytest/plugins/ansible_forked.py +103 -0
- ansible_test/_util/target/sanity/import/importer.py +0 -8
- ansible_test/_util/target/setup/bootstrap.sh +36 -16
- ansible_test/_util/target/setup/quiet_pip.py +0 -4
- ansible/modules/_include.py +0 -80
- ansible_test/_internal/commands/integration/cloud/foreman.py +0 -102
- ansible_test/_util/target/setup/ConfigureRemotingForAnsible.ps1 +0 -435
- {ansible_core-2.15.4rc1.data → ansible_core-2.16.0b2.data}/scripts/ansible-test +0 -0
- {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/WHEEL +0 -0
- {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/entry_points.txt +0 -0
- {ansible_core-2.15.4rc1.dist-info → ansible_core-2.16.0b2.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Copyright (c) 2018 Ansible Project
|
|
2
2
|
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
3
3
|
|
|
4
|
-
from __future__ import (absolute_import, division, print_function)
|
|
4
|
+
from __future__ import (annotations, absolute_import, division, print_function)
|
|
5
5
|
__metaclass__ = type
|
|
6
6
|
|
|
7
7
|
DOCUMENTATION = """
|
|
@@ -10,7 +10,7 @@ name: psrp
|
|
|
10
10
|
short_description: Run tasks over Microsoft PowerShell Remoting Protocol
|
|
11
11
|
description:
|
|
12
12
|
- Run commands or put/fetch on a target via PSRP (WinRM plugin)
|
|
13
|
-
- This is similar to the
|
|
13
|
+
- This is similar to the P(ansible.builtin.winrm#connection) connection plugin which uses the same
|
|
14
14
|
underlying transport but instead runs in a PowerShell interpreter.
|
|
15
15
|
version_added: "2.7"
|
|
16
16
|
requirements:
|
|
@@ -38,7 +38,7 @@ options:
|
|
|
38
38
|
keyword:
|
|
39
39
|
- name: remote_user
|
|
40
40
|
remote_password:
|
|
41
|
-
description: Authentication password for the
|
|
41
|
+
description: Authentication password for the O(remote_user). Can be supplied as CLI option.
|
|
42
42
|
type: str
|
|
43
43
|
vars:
|
|
44
44
|
- name: ansible_password
|
|
@@ -49,8 +49,8 @@ options:
|
|
|
49
49
|
port:
|
|
50
50
|
description:
|
|
51
51
|
- The port for PSRP to connect on the remote target.
|
|
52
|
-
- Default is
|
|
53
|
-
otherwise the port is
|
|
52
|
+
- Default is V(5986) if O(protocol) is not defined or is V(https),
|
|
53
|
+
otherwise the port is V(5985).
|
|
54
54
|
type: int
|
|
55
55
|
vars:
|
|
56
56
|
- name: ansible_port
|
|
@@ -60,7 +60,7 @@ options:
|
|
|
60
60
|
protocol:
|
|
61
61
|
description:
|
|
62
62
|
- Set the protocol to use for the connection.
|
|
63
|
-
- Default is
|
|
63
|
+
- Default is V(https) if O(port) is not defined or O(port) is not V(5985).
|
|
64
64
|
choices:
|
|
65
65
|
- http
|
|
66
66
|
- https
|
|
@@ -77,8 +77,8 @@ options:
|
|
|
77
77
|
auth:
|
|
78
78
|
description:
|
|
79
79
|
- The authentication protocol to use when authenticating the remote user.
|
|
80
|
-
- The default,
|
|
81
|
-
available and fall back to
|
|
80
|
+
- The default, V(negotiate), will attempt to use Kerberos (V(kerberos)) if it is
|
|
81
|
+
available and fall back to NTLM (V(ntlm)) if it isn't.
|
|
82
82
|
type: str
|
|
83
83
|
vars:
|
|
84
84
|
- name: ansible_psrp_auth
|
|
@@ -93,8 +93,8 @@ options:
|
|
|
93
93
|
cert_validation:
|
|
94
94
|
description:
|
|
95
95
|
- Whether to validate the remote server's certificate or not.
|
|
96
|
-
- Set to
|
|
97
|
-
-
|
|
96
|
+
- Set to V(ignore) to not validate any certificates.
|
|
97
|
+
- O(ca_cert) can be set to the path of a PEM certificate chain to
|
|
98
98
|
use in the validation.
|
|
99
99
|
choices:
|
|
100
100
|
- validate
|
|
@@ -107,7 +107,7 @@ options:
|
|
|
107
107
|
description:
|
|
108
108
|
- The path to a PEM certificate chain to use when validating the server's
|
|
109
109
|
certificate.
|
|
110
|
-
- This value is ignored if
|
|
110
|
+
- This value is ignored if O(cert_validation) is set to V(ignore).
|
|
111
111
|
type: path
|
|
112
112
|
vars:
|
|
113
113
|
- name: ansible_psrp_cert_trust_path
|
|
@@ -124,7 +124,7 @@ options:
|
|
|
124
124
|
read_timeout:
|
|
125
125
|
description:
|
|
126
126
|
- The read timeout for receiving data from the remote host.
|
|
127
|
-
- This value must always be greater than
|
|
127
|
+
- This value must always be greater than O(operation_timeout).
|
|
128
128
|
- This option requires pypsrp >= 0.3.
|
|
129
129
|
- This is measured in seconds.
|
|
130
130
|
type: int
|
|
@@ -156,15 +156,15 @@ options:
|
|
|
156
156
|
message_encryption:
|
|
157
157
|
description:
|
|
158
158
|
- Controls the message encryption settings, this is different from TLS
|
|
159
|
-
encryption when
|
|
160
|
-
- Only the auth protocols
|
|
161
|
-
|
|
162
|
-
only support encryption when
|
|
163
|
-
-
|
|
159
|
+
encryption when O(protocol) is V(https).
|
|
160
|
+
- Only the auth protocols V(negotiate), V(kerberos), V(ntlm), and
|
|
161
|
+
V(credssp) can do message encryption. The other authentication protocols
|
|
162
|
+
only support encryption when V(protocol) is set to V(https).
|
|
163
|
+
- V(auto) means means message encryption is only used when not using
|
|
164
164
|
TLS/HTTPS.
|
|
165
|
-
-
|
|
165
|
+
- V(always) is the same as V(auto) but message encryption is always used
|
|
166
166
|
even when running over TLS/HTTPS.
|
|
167
|
-
-
|
|
167
|
+
- V(never) disables any encryption checks that are in place when running
|
|
168
168
|
over HTTP and disables any authentication encryption processes.
|
|
169
169
|
type: str
|
|
170
170
|
vars:
|
|
@@ -184,7 +184,7 @@ options:
|
|
|
184
184
|
description:
|
|
185
185
|
- Will disable any environment proxy settings and connect directly to the
|
|
186
186
|
remote host.
|
|
187
|
-
- This option is ignored if
|
|
187
|
+
- This option is ignored if O(proxy) is set.
|
|
188
188
|
vars:
|
|
189
189
|
- name: ansible_psrp_ignore_proxy
|
|
190
190
|
type: bool
|
|
@@ -206,7 +206,7 @@ options:
|
|
|
206
206
|
credssp_auth_mechanism:
|
|
207
207
|
description:
|
|
208
208
|
- The sub authentication mechanism to use with CredSSP auth.
|
|
209
|
-
- When
|
|
209
|
+
- When V(auto), both Kerberos and NTLM is attempted with kerberos being
|
|
210
210
|
preferred.
|
|
211
211
|
type: str
|
|
212
212
|
choices:
|
|
@@ -219,7 +219,7 @@ options:
|
|
|
219
219
|
credssp_disable_tlsv1_2:
|
|
220
220
|
description:
|
|
221
221
|
- Disables the use of TLSv1.2 on the CredSSP authentication channel.
|
|
222
|
-
- This should not be set to
|
|
222
|
+
- This should not be set to V(yes) unless dealing with a host that does not
|
|
223
223
|
have TLSv1.2.
|
|
224
224
|
default: false
|
|
225
225
|
type: bool
|
|
@@ -228,7 +228,7 @@ options:
|
|
|
228
228
|
credssp_minimum_version:
|
|
229
229
|
description:
|
|
230
230
|
- The minimum CredSSP server authentication version that will be accepted.
|
|
231
|
-
- Set to
|
|
231
|
+
- Set to V(5) to ensure the server has been patched and is not vulnerable
|
|
232
232
|
to CVE 2018-0886.
|
|
233
233
|
default: 2
|
|
234
234
|
type: int
|
|
@@ -282,7 +282,7 @@ options:
|
|
|
282
282
|
description:
|
|
283
283
|
- Sets the WSMan timeout for each operation.
|
|
284
284
|
- This is measured in seconds.
|
|
285
|
-
- This should not exceed the value for
|
|
285
|
+
- This should not exceed the value for O(connection_timeout).
|
|
286
286
|
type: int
|
|
287
287
|
vars:
|
|
288
288
|
- name: ansible_psrp_operation_timeout
|
|
@@ -309,13 +309,15 @@ import base64
|
|
|
309
309
|
import json
|
|
310
310
|
import logging
|
|
311
311
|
import os
|
|
312
|
+
import typing as t
|
|
312
313
|
|
|
313
314
|
from ansible import constants as C
|
|
314
315
|
from ansible.errors import AnsibleConnectionFailure, AnsibleError
|
|
315
316
|
from ansible.errors import AnsibleFileNotFound
|
|
316
317
|
from ansible.module_utils.parsing.convert_bool import boolean
|
|
317
|
-
from ansible.module_utils.
|
|
318
|
+
from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text
|
|
318
319
|
from ansible.plugins.connection import ConnectionBase
|
|
320
|
+
from ansible.plugins.shell.powershell import ShellModule as PowerShellPlugin
|
|
319
321
|
from ansible.plugins.shell.powershell import _common_args
|
|
320
322
|
from ansible.utils.display import Display
|
|
321
323
|
from ansible.utils.hashing import sha1
|
|
@@ -345,13 +347,16 @@ class Connection(ConnectionBase):
|
|
|
345
347
|
has_pipelining = True
|
|
346
348
|
allow_extras = True
|
|
347
349
|
|
|
348
|
-
|
|
350
|
+
# Satifies mypy as this connection only ever runs with this plugin
|
|
351
|
+
_shell: PowerShellPlugin
|
|
352
|
+
|
|
353
|
+
def __init__(self, *args: t.Any, **kwargs: t.Any) -> None:
|
|
349
354
|
self.always_pipeline_modules = True
|
|
350
355
|
self.has_native_async = True
|
|
351
356
|
|
|
352
|
-
self.runspace = None
|
|
353
|
-
self.host = None
|
|
354
|
-
self._last_pipeline =
|
|
357
|
+
self.runspace: RunspacePool | None = None
|
|
358
|
+
self.host: PSHost | None = None
|
|
359
|
+
self._last_pipeline: PowerShell | None = None
|
|
355
360
|
|
|
356
361
|
self._shell_type = 'powershell'
|
|
357
362
|
super(Connection, self).__init__(*args, **kwargs)
|
|
@@ -361,7 +366,7 @@ class Connection(ConnectionBase):
|
|
|
361
366
|
logging.getLogger('requests_credssp').setLevel(logging.INFO)
|
|
362
367
|
logging.getLogger('urllib3').setLevel(logging.INFO)
|
|
363
368
|
|
|
364
|
-
def _connect(self):
|
|
369
|
+
def _connect(self) -> Connection:
|
|
365
370
|
if not HAS_PYPSRP:
|
|
366
371
|
raise AnsibleError("pypsrp or dependencies are not installed: %s"
|
|
367
372
|
% to_native(PYPSRP_IMP_ERR))
|
|
@@ -408,7 +413,7 @@ class Connection(ConnectionBase):
|
|
|
408
413
|
self._last_pipeline = None
|
|
409
414
|
return self
|
|
410
415
|
|
|
411
|
-
def reset(self):
|
|
416
|
+
def reset(self) -> None:
|
|
412
417
|
if not self._connected:
|
|
413
418
|
self.runspace = None
|
|
414
419
|
return
|
|
@@ -424,26 +429,27 @@ class Connection(ConnectionBase):
|
|
|
424
429
|
self.runspace = None
|
|
425
430
|
self._connect()
|
|
426
431
|
|
|
427
|
-
def exec_command(self, cmd, in_data=None, sudoable=True):
|
|
432
|
+
def exec_command(self, cmd: str, in_data: bytes | None = None, sudoable: bool = True) -> tuple[int, bytes, bytes]:
|
|
428
433
|
super(Connection, self).exec_command(cmd, in_data=in_data,
|
|
429
434
|
sudoable=sudoable)
|
|
430
435
|
|
|
436
|
+
pwsh_in_data: bytes | str | None = None
|
|
437
|
+
|
|
431
438
|
if cmd.startswith(" ".join(_common_args) + " -EncodedCommand"):
|
|
432
439
|
# This is a PowerShell script encoded by the shell plugin, we will
|
|
433
440
|
# decode the script and execute it in the runspace instead of
|
|
434
441
|
# starting a new interpreter to save on time
|
|
435
442
|
b_command = base64.b64decode(cmd.split(" ")[-1])
|
|
436
443
|
script = to_text(b_command, 'utf-16-le')
|
|
437
|
-
|
|
444
|
+
pwsh_in_data = to_text(in_data, errors="surrogate_or_strict", nonstring="passthru")
|
|
438
445
|
|
|
439
|
-
if
|
|
446
|
+
if pwsh_in_data and isinstance(pwsh_in_data, str) and pwsh_in_data.startswith("#!"):
|
|
440
447
|
# ANSIBALLZ wrapper, we need to get the interpreter and execute
|
|
441
448
|
# that as the script - note this won't work as basic.py relies
|
|
442
449
|
# on packages not available on Windows, once fixed we can enable
|
|
443
450
|
# this path
|
|
444
|
-
interpreter = to_native(
|
|
451
|
+
interpreter = to_native(pwsh_in_data.splitlines()[0][2:])
|
|
445
452
|
# script = "$input | &'%s' -" % interpreter
|
|
446
|
-
# in_data = to_text(in_data)
|
|
447
453
|
raise AnsibleError("cannot run the interpreter '%s' on the psrp "
|
|
448
454
|
"connection plugin" % interpreter)
|
|
449
455
|
|
|
@@ -458,12 +464,13 @@ class Connection(ConnectionBase):
|
|
|
458
464
|
# In other cases we want to execute the cmd as the script. We add on the 'exit $LASTEXITCODE' to ensure the
|
|
459
465
|
# rc is propagated back to the connection plugin.
|
|
460
466
|
script = to_text(u"%s\nexit $LASTEXITCODE" % cmd)
|
|
467
|
+
pwsh_in_data = in_data
|
|
461
468
|
display.vvv(u"PSRP: EXEC %s" % script, host=self._psrp_host)
|
|
462
469
|
|
|
463
|
-
rc, stdout, stderr = self._exec_psrp_script(script,
|
|
470
|
+
rc, stdout, stderr = self._exec_psrp_script(script, pwsh_in_data)
|
|
464
471
|
return rc, stdout, stderr
|
|
465
472
|
|
|
466
|
-
def put_file(self, in_path, out_path):
|
|
473
|
+
def put_file(self, in_path: str, out_path: str) -> None:
|
|
467
474
|
super(Connection, self).put_file(in_path, out_path)
|
|
468
475
|
|
|
469
476
|
out_path = self._shell._unquote(out_path)
|
|
@@ -611,7 +618,7 @@ end {
|
|
|
611
618
|
raise AnsibleError("Remote sha1 hash %s does not match local hash %s"
|
|
612
619
|
% (to_native(remote_sha1), to_native(local_sha1)))
|
|
613
620
|
|
|
614
|
-
def fetch_file(self, in_path, out_path):
|
|
621
|
+
def fetch_file(self, in_path: str, out_path: str) -> None:
|
|
615
622
|
super(Connection, self).fetch_file(in_path, out_path)
|
|
616
623
|
display.vvv("FETCH %s TO %s" % (in_path, out_path),
|
|
617
624
|
host=self._psrp_host)
|
|
@@ -689,7 +696,7 @@ if ($bytes_read -gt 0) {
|
|
|
689
696
|
display.warning("failed to close remote file stream of file "
|
|
690
697
|
"'%s': %s" % (in_path, to_native(stderr)))
|
|
691
698
|
|
|
692
|
-
def close(self):
|
|
699
|
+
def close(self) -> None:
|
|
693
700
|
if self.runspace and self.runspace.state == RunspacePoolState.OPENED:
|
|
694
701
|
display.vvvvv("PSRP CLOSE RUNSPACE: %s" % (self.runspace.id),
|
|
695
702
|
host=self._psrp_host)
|
|
@@ -698,7 +705,7 @@ if ($bytes_read -gt 0) {
|
|
|
698
705
|
self._connected = False
|
|
699
706
|
self._last_pipeline = None
|
|
700
707
|
|
|
701
|
-
def _build_kwargs(self):
|
|
708
|
+
def _build_kwargs(self) -> None:
|
|
702
709
|
self._psrp_host = self.get_option('remote_addr')
|
|
703
710
|
self._psrp_user = self.get_option('remote_user')
|
|
704
711
|
self._psrp_pass = self.get_option('remote_password')
|
|
@@ -802,7 +809,13 @@ if ($bytes_read -gt 0) {
|
|
|
802
809
|
option = self.get_option('_extras')['ansible_psrp_%s' % arg]
|
|
803
810
|
self._psrp_conn_kwargs[arg] = option
|
|
804
811
|
|
|
805
|
-
def _exec_psrp_script(
|
|
812
|
+
def _exec_psrp_script(
|
|
813
|
+
self,
|
|
814
|
+
script: str,
|
|
815
|
+
input_data: bytes | str | t.Iterable | None = None,
|
|
816
|
+
use_local_scope: bool = True,
|
|
817
|
+
arguments: t.Iterable[str] | None = None,
|
|
818
|
+
) -> tuple[int, bytes, bytes]:
|
|
806
819
|
# Check if there's a command on the current pipeline that still needs to be closed.
|
|
807
820
|
if self._last_pipeline:
|
|
808
821
|
# Current pypsrp versions raise an exception if the current state was not RUNNING. We manually set it so we
|
|
@@ -828,7 +841,7 @@ if ($bytes_read -gt 0) {
|
|
|
828
841
|
|
|
829
842
|
return rc, stdout, stderr
|
|
830
843
|
|
|
831
|
-
def _parse_pipeline_result(self, pipeline):
|
|
844
|
+
def _parse_pipeline_result(self, pipeline: PowerShell) -> tuple[int, bytes, bytes]:
|
|
832
845
|
"""
|
|
833
846
|
PSRP doesn't have the same concept as other protocols with its output.
|
|
834
847
|
We need some extra logic to convert the pipeline streams and host
|