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
|
@@ -18,5 +18,5 @@ EXAMPLES: |
|
|
|
18
18
|
|
|
19
19
|
RETURN:
|
|
20
20
|
_value:
|
|
21
|
-
description: Returns
|
|
21
|
+
description: Returns V(True) if the path corresponds to a mount point on the controller, V(False) if otherwise.
|
|
22
22
|
type: boolean
|
|
@@ -20,5 +20,5 @@ EXAMPLES: |
|
|
|
20
20
|
|
|
21
21
|
RETURN:
|
|
22
22
|
_value:
|
|
23
|
-
description: Returns
|
|
23
|
+
description: Returns V(True) if the paths correspond to the same location on the filesystem on the controller, V(False) if otherwise.
|
|
24
24
|
type: boolean
|
ansible/plugins/test/isnan.yml
CHANGED
|
@@ -6,7 +6,6 @@ DOCUMENTATION:
|
|
|
6
6
|
short_description: is the list a subset of this other list
|
|
7
7
|
description:
|
|
8
8
|
- Validate if the first list is a sub set (is included) of the second list.
|
|
9
|
-
- Same as the C(all) Python function.
|
|
10
9
|
options:
|
|
11
10
|
_input:
|
|
12
11
|
description: List.
|
|
@@ -24,5 +23,5 @@ EXAMPLES: |
|
|
|
24
23
|
issmallinbig: '{{ small is subset(big) }}'
|
|
25
24
|
RETURN:
|
|
26
25
|
_value:
|
|
27
|
-
description: Returns
|
|
26
|
+
description: Returns V(True) if the specified list is a subset of the provided list, V(False) otherwise.
|
|
28
27
|
type: boolean
|
|
@@ -6,7 +6,6 @@ DOCUMENTATION:
|
|
|
6
6
|
aliases: [issuperset]
|
|
7
7
|
description:
|
|
8
8
|
- Validate if the first list is a super set (includes) the second list.
|
|
9
|
-
- Same as the C(all) Python function.
|
|
10
9
|
options:
|
|
11
10
|
_input:
|
|
12
11
|
description: List.
|
|
@@ -24,5 +23,5 @@ EXAMPLES: |
|
|
|
24
23
|
issmallinbig: '{{ big is superset(small) }}'
|
|
25
24
|
RETURN:
|
|
26
25
|
_value:
|
|
27
|
-
description: Returns
|
|
26
|
+
description: Returns V(True) if the specified list is a superset of the provided list, V(False) otherwise.
|
|
28
27
|
type: boolean
|
ansible/plugins/test/link.yml
CHANGED
|
@@ -17,5 +17,5 @@ EXAMPLES: |
|
|
|
17
17
|
|
|
18
18
|
RETURN:
|
|
19
19
|
_value:
|
|
20
|
-
description: Returns
|
|
20
|
+
description: Returns V(True) if the path corresponds to an existing symlink on the filesystem on the controller, V(False) if otherwise.
|
|
21
21
|
type: boolean
|
|
@@ -17,5 +17,5 @@ EXAMPLES: |
|
|
|
17
17
|
|
|
18
18
|
RETURN:
|
|
19
19
|
_value:
|
|
20
|
-
description: Returns
|
|
20
|
+
description: Returns V(True) if the path corresponds to an existing filesystem object on the controller, V(False) if otherwise.
|
|
21
21
|
type: boolean
|
ansible/plugins/test/match.yml
CHANGED
|
@@ -19,7 +19,7 @@ DOCUMENTATION:
|
|
|
19
19
|
type: boolean
|
|
20
20
|
default: False
|
|
21
21
|
multiline:
|
|
22
|
-
description: Match against
|
|
22
|
+
description: Match against multiple lines in string.
|
|
23
23
|
type: boolean
|
|
24
24
|
default: False
|
|
25
25
|
EXAMPLES: |
|
|
@@ -28,5 +28,5 @@ EXAMPLES: |
|
|
|
28
28
|
nomatch: url is match("/users/.*/resources")
|
|
29
29
|
RETURN:
|
|
30
30
|
_value:
|
|
31
|
-
description: Returns
|
|
31
|
+
description: Returns V(True) if there is a match, V(False) otherwise.
|
|
32
32
|
type: boolean
|
ansible/plugins/test/mount.yml
CHANGED
|
@@ -18,5 +18,5 @@ EXAMPLES: |
|
|
|
18
18
|
|
|
19
19
|
RETURN:
|
|
20
20
|
_value:
|
|
21
|
-
description: Returns
|
|
21
|
+
description: Returns V(True) if the path corresponds to a mount point on the controller, V(False) if otherwise.
|
|
22
22
|
type: boolean
|
ansible/plugins/test/nan.yml
CHANGED
|
@@ -5,7 +5,7 @@ DOCUMENTATION:
|
|
|
5
5
|
short_description: Task did not end due to unreachable host
|
|
6
6
|
description:
|
|
7
7
|
- Tests if task was able to reach the host for execution
|
|
8
|
-
- This test checks for the existance of a C(unreachable) key in the input dictionary and that it is
|
|
8
|
+
- This test checks for the existance of a C(unreachable) key in the input dictionary and that it is V(False) if present
|
|
9
9
|
options:
|
|
10
10
|
_input:
|
|
11
11
|
description: registered result from an Ansible task
|
|
@@ -17,5 +17,5 @@ EXAMPLES: |
|
|
|
17
17
|
|
|
18
18
|
RETURN:
|
|
19
19
|
_value:
|
|
20
|
-
description: Returns
|
|
20
|
+
description: Returns V(True) if the task did not flag the host as unreachable, V(False) otherwise.
|
|
21
21
|
type: boolean
|
ansible/plugins/test/regex.yml
CHANGED
|
@@ -20,5 +20,5 @@ EXAMPLES: |
|
|
|
20
20
|
|
|
21
21
|
RETURN:
|
|
22
22
|
_value:
|
|
23
|
-
description: Returns
|
|
23
|
+
description: Returns V(True) if the paths correspond to the same location on the filesystem on the controller, V(False) if otherwise.
|
|
24
24
|
type: boolean
|
ansible/plugins/test/search.yml
CHANGED
|
@@ -18,7 +18,7 @@ DOCUMENTATION:
|
|
|
18
18
|
type: boolean
|
|
19
19
|
default: False
|
|
20
20
|
multiline:
|
|
21
|
-
description: Match against
|
|
21
|
+
description: Match against multiple lines in string.
|
|
22
22
|
type: boolean
|
|
23
23
|
default: False
|
|
24
24
|
|
|
@@ -29,5 +29,5 @@ EXAMPLES: |
|
|
|
29
29
|
|
|
30
30
|
RETURN:
|
|
31
31
|
_value:
|
|
32
|
-
description: Returns
|
|
32
|
+
description: Returns V(True) if there is a match, V(False) otherwise.
|
|
33
33
|
type: boolean
|
ansible/plugins/test/skip.yml
CHANGED
|
@@ -6,7 +6,7 @@ DOCUMENTATION:
|
|
|
6
6
|
aliases: [skip]
|
|
7
7
|
description:
|
|
8
8
|
- Tests if task was skipped
|
|
9
|
-
- This test checks for the existance of a C(skipped) key in the input dictionary and that it is
|
|
9
|
+
- This test checks for the existance of a C(skipped) key in the input dictionary and that it is V(True) if present
|
|
10
10
|
options:
|
|
11
11
|
_input:
|
|
12
12
|
description: registered result from an Ansible task
|
|
@@ -14,9 +14,9 @@ DOCUMENTATION:
|
|
|
14
14
|
required: True
|
|
15
15
|
EXAMPLES: |
|
|
16
16
|
# test 'status' to know how to respond
|
|
17
|
-
{{
|
|
17
|
+
{{ taskresults is skipped }}
|
|
18
18
|
|
|
19
19
|
RETURN:
|
|
20
20
|
_value:
|
|
21
|
-
description: Returns
|
|
21
|
+
description: Returns V(True) if the task was skipped, V(False) otherwise.
|
|
22
22
|
type: boolean
|
ansible/plugins/test/skipped.yml
CHANGED
|
@@ -6,7 +6,7 @@ DOCUMENTATION:
|
|
|
6
6
|
aliases: [skip]
|
|
7
7
|
description:
|
|
8
8
|
- Tests if task was skipped
|
|
9
|
-
- This test checks for the existance of a C(skipped) key in the input dictionary and that it is
|
|
9
|
+
- This test checks for the existance of a C(skipped) key in the input dictionary and that it is V(True) if present
|
|
10
10
|
options:
|
|
11
11
|
_input:
|
|
12
12
|
description: registered result from an Ansible task
|
|
@@ -14,9 +14,9 @@ DOCUMENTATION:
|
|
|
14
14
|
required: True
|
|
15
15
|
EXAMPLES: |
|
|
16
16
|
# test 'status' to know how to respond
|
|
17
|
-
{{
|
|
17
|
+
{{ taskresults is skipped }}
|
|
18
18
|
|
|
19
19
|
RETURN:
|
|
20
20
|
_value:
|
|
21
|
-
description: Returns
|
|
21
|
+
description: Returns V(True) if the task was skipped, V(False) otherwise.
|
|
22
22
|
type: boolean
|
ansible/plugins/test/started.yml
CHANGED
|
@@ -5,7 +5,7 @@ DOCUMENTATION:
|
|
|
5
5
|
short_description: Was async task started
|
|
6
6
|
description:
|
|
7
7
|
- Used to check if an async task has started, will also work with non async tasks but will issue a warning.
|
|
8
|
-
- This test checks for the existance of a C(started) key in the input dictionary and that it is
|
|
8
|
+
- This test checks for the existance of a C(started) key in the input dictionary and that it is V(1) if present
|
|
9
9
|
options:
|
|
10
10
|
_input:
|
|
11
11
|
description: registered result from an Ansible task
|
|
@@ -17,5 +17,5 @@ EXAMPLES: |
|
|
|
17
17
|
|
|
18
18
|
RETURN:
|
|
19
19
|
_value:
|
|
20
|
-
description: Returns
|
|
20
|
+
description: Returns V(True) if the task has started, V(False) otherwise.
|
|
21
21
|
type: boolean
|
ansible/plugins/test/subset.yml
CHANGED
|
@@ -6,7 +6,6 @@ DOCUMENTATION:
|
|
|
6
6
|
short_description: is the list a subset of this other list
|
|
7
7
|
description:
|
|
8
8
|
- Validate if the first list is a sub set (is included) of the second list.
|
|
9
|
-
- Same as the C(all) Python function.
|
|
10
9
|
options:
|
|
11
10
|
_input:
|
|
12
11
|
description: List.
|
|
@@ -24,5 +23,5 @@ EXAMPLES: |
|
|
|
24
23
|
issmallinbig: '{{ small is subset(big) }}'
|
|
25
24
|
RETURN:
|
|
26
25
|
_value:
|
|
27
|
-
description: Returns
|
|
26
|
+
description: Returns V(True) if the specified list is a subset of the provided list, V(False) otherwise.
|
|
28
27
|
type: boolean
|
|
@@ -6,7 +6,7 @@ DOCUMENTATION:
|
|
|
6
6
|
aliases: [succeeded, successful]
|
|
7
7
|
description:
|
|
8
8
|
- Tests if task finished successfully, opposite of C(failed).
|
|
9
|
-
- This test checks for the existance of a C(failed) key in the input dictionary and that it is
|
|
9
|
+
- This test checks for the existance of a C(failed) key in the input dictionary and that it is V(False) if present
|
|
10
10
|
options:
|
|
11
11
|
_input:
|
|
12
12
|
description: registered result from an Ansible task
|
|
@@ -18,5 +18,5 @@ EXAMPLES: |
|
|
|
18
18
|
|
|
19
19
|
RETURN:
|
|
20
20
|
_value:
|
|
21
|
-
description: Returns
|
|
21
|
+
description: Returns V(True) if the task was successfully completed, V(False) otherwise.
|
|
22
22
|
type: boolean
|
ansible/plugins/test/success.yml
CHANGED
|
@@ -6,7 +6,7 @@ DOCUMENTATION:
|
|
|
6
6
|
aliases: [succeeded, successful]
|
|
7
7
|
description:
|
|
8
8
|
- Tests if task finished successfully, opposite of C(failed).
|
|
9
|
-
- This test checks for the existance of a C(failed) key in the input dictionary and that it is
|
|
9
|
+
- This test checks for the existance of a C(failed) key in the input dictionary and that it is V(False) if present
|
|
10
10
|
options:
|
|
11
11
|
_input:
|
|
12
12
|
description: registered result from an Ansible task
|
|
@@ -18,5 +18,5 @@ EXAMPLES: |
|
|
|
18
18
|
|
|
19
19
|
RETURN:
|
|
20
20
|
_value:
|
|
21
|
-
description: Returns
|
|
21
|
+
description: Returns V(True) if the task was successfully completed, V(False) otherwise.
|
|
22
22
|
type: boolean
|
|
@@ -6,7 +6,7 @@ DOCUMENTATION:
|
|
|
6
6
|
aliases: [succeeded, successful]
|
|
7
7
|
description:
|
|
8
8
|
- Tests if task finished successfully, opposite of C(failed).
|
|
9
|
-
- This test checks for the existance of a C(failed) key in the input dictionary and that it is
|
|
9
|
+
- This test checks for the existance of a C(failed) key in the input dictionary and that it is V(False) if present
|
|
10
10
|
options:
|
|
11
11
|
_input:
|
|
12
12
|
description: registered result from an Ansible task
|
|
@@ -18,5 +18,5 @@ EXAMPLES: |
|
|
|
18
18
|
|
|
19
19
|
RETURN:
|
|
20
20
|
_value:
|
|
21
|
-
description: Returns
|
|
21
|
+
description: Returns V(True) if the task was successfully completed, V(False) otherwise.
|
|
22
22
|
type: boolean
|
|
@@ -6,7 +6,6 @@ DOCUMENTATION:
|
|
|
6
6
|
aliases: [issuperset]
|
|
7
7
|
description:
|
|
8
8
|
- Validate if the first list is a super set (includes) the second list.
|
|
9
|
-
- Same as the C(all) Python function.
|
|
10
9
|
options:
|
|
11
10
|
_input:
|
|
12
11
|
description: List.
|
|
@@ -24,5 +23,5 @@ EXAMPLES: |
|
|
|
24
23
|
issmallinbig: '{{ big is superset(small) }}'
|
|
25
24
|
RETURN:
|
|
26
25
|
_value:
|
|
27
|
-
description: Returns
|
|
26
|
+
description: Returns V(True) if the specified list is a superset of the provided list, V(False) otherwise.
|
|
28
27
|
type: boolean
|
ansible/plugins/test/truthy.yml
CHANGED
|
@@ -5,14 +5,14 @@ DOCUMENTATION:
|
|
|
5
5
|
short_description: Pythonic true
|
|
6
6
|
description:
|
|
7
7
|
- This check is a more Python version of what is 'true'.
|
|
8
|
-
- It is the opposite of
|
|
8
|
+
- It is the opposite of P(ansible.builtin.falsy#test).
|
|
9
9
|
options:
|
|
10
10
|
_input:
|
|
11
11
|
description: An expression that can be expressed in a boolean context.
|
|
12
12
|
type: string
|
|
13
13
|
required: True
|
|
14
14
|
convert_bool:
|
|
15
|
-
description: Attempts to convert to strict python boolean vs normally acceptable values (
|
|
15
|
+
description: Attempts to convert to strict python boolean vs normally acceptable values (V(yes)/V(no), V(on)/V(off), V(0)/V(1), etc).
|
|
16
16
|
type: bool
|
|
17
17
|
default: false
|
|
18
18
|
EXAMPLES: |
|
|
@@ -20,5 +20,5 @@ EXAMPLES: |
|
|
|
20
20
|
thisisfalse: '{{ "" is truthy }}'
|
|
21
21
|
RETURN:
|
|
22
22
|
_value:
|
|
23
|
-
description: Returns
|
|
23
|
+
description: Returns V(True) if the condition is not "Python truthy", V(False) otherwise.
|
|
24
24
|
type: boolean
|
|
@@ -5,7 +5,7 @@ DOCUMENTATION:
|
|
|
5
5
|
short_description: Did task end due to the host was unreachable
|
|
6
6
|
description:
|
|
7
7
|
- Tests if task was not able to reach the host for execution
|
|
8
|
-
- This test checks for the existance of a C(unreachable) key in the input dictionary and that it's value is
|
|
8
|
+
- This test checks for the existance of a C(unreachable) key in the input dictionary and that it's value is V(True)
|
|
9
9
|
options:
|
|
10
10
|
_input:
|
|
11
11
|
description: registered result from an Ansible task
|
|
@@ -17,5 +17,5 @@ EXAMPLES: |
|
|
|
17
17
|
|
|
18
18
|
RETURN:
|
|
19
19
|
_value:
|
|
20
|
-
description: Returns
|
|
20
|
+
description: Returns V(True) if the task flagged the host as unreachable, V(False) otherwise.
|
|
21
21
|
type: boolean
|
ansible/plugins/test/uri.yml
CHANGED
|
@@ -26,5 +26,5 @@ EXAMPLES: |
|
|
|
26
26
|
{{ 'http://nobody:secret@example.com' is uri(['ftp', 'ftps', 'http', 'https', 'ws', 'wss']) }}
|
|
27
27
|
RETURN:
|
|
28
28
|
_value:
|
|
29
|
-
description: Returns
|
|
29
|
+
description: Returns V(false) if the string is not a URI or the schema extracted does not match the supplied list.
|
|
30
30
|
type: boolean
|
ansible/plugins/test/url.yml
CHANGED
|
@@ -25,5 +25,5 @@ EXAMPLES: |
|
|
|
25
25
|
{{ 'ftp://admin:secret@example.com/path/to/myfile.yml' is url }}
|
|
26
26
|
RETURN:
|
|
27
27
|
_value:
|
|
28
|
-
description: Returns
|
|
28
|
+
description: Returns V(false) if the string is not a URL, V(true) otherwise.
|
|
29
29
|
type: boolean
|
ansible/plugins/test/urn.yml
CHANGED
|
@@ -15,5 +15,5 @@ EXAMPLES: |
|
|
|
15
15
|
thisistrue: '{{ "$ANSIBLE_VAULT;1.2;AES256;dev...." is ansible_vault }}'
|
|
16
16
|
RETURN:
|
|
17
17
|
_value:
|
|
18
|
-
description: Returns
|
|
18
|
+
description: Returns V(True) if the input is a valid ansible vault, V(False) otherwise.
|
|
19
19
|
type: boolean
|
ansible/plugins/test/version.yml
CHANGED
|
@@ -36,12 +36,12 @@ DOCUMENTATION:
|
|
|
36
36
|
- ne
|
|
37
37
|
default: eq
|
|
38
38
|
strict:
|
|
39
|
-
description: Whether to use strict version scheme. Mutually exclusive with
|
|
39
|
+
description: Whether to use strict version scheme. Mutually exclusive with O(version_type)
|
|
40
40
|
type: boolean
|
|
41
41
|
required: False
|
|
42
42
|
default: False
|
|
43
43
|
version_type:
|
|
44
|
-
description: Version scheme to use for comparison. Mutually exclusive with
|
|
44
|
+
description: Version scheme to use for comparison. Mutually exclusive with O(strict). See C(notes) for descriptions on the version types.
|
|
45
45
|
type: string
|
|
46
46
|
required: False
|
|
47
47
|
choices:
|
|
@@ -52,10 +52,10 @@ DOCUMENTATION:
|
|
|
52
52
|
- pep440
|
|
53
53
|
default: loose
|
|
54
54
|
notes:
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
55
|
+
- V(loose) - This type corresponds to the Python C(distutils.version.LooseVersion) class. All version formats are valid for this type. The rules for comparison are simple and predictable, but may not always give expected results.
|
|
56
|
+
- V(strict) - This type corresponds to the Python C(distutils.version.StrictVersion) class. A version number consists of two or three dot-separated numeric components, with an optional "pre-release" tag on the end. The pre-release tag consists of a single letter C(a) or C(b) followed by a number. If the numeric components of two version numbers are equal, then one with a pre-release tag will always be deemed earlier (lesser) than one without.
|
|
57
|
+
- V(semver)/V(semantic) - This type implements the L(Semantic Version,https://semver.org) scheme for version comparison.
|
|
58
|
+
- V(pep440) - This type implements the Python L(PEP-440,https://peps.python.org/pep-0440/) versioning rules for version comparison. Added in version 2.14.
|
|
59
59
|
EXAMPLES: |
|
|
60
60
|
- name: version test examples
|
|
61
61
|
assert:
|
|
@@ -78,5 +78,5 @@ EXAMPLES: |
|
|
|
78
78
|
- "'2.14.0rc1' is version('2.14.0', 'lt', version_type='pep440')"
|
|
79
79
|
RETURN:
|
|
80
80
|
_value:
|
|
81
|
-
description: Returns
|
|
81
|
+
description: Returns V(True) or V(False) depending on the outcome of the comparison.
|
|
82
82
|
type: boolean
|
|
@@ -36,12 +36,12 @@ DOCUMENTATION:
|
|
|
36
36
|
- ne
|
|
37
37
|
default: eq
|
|
38
38
|
strict:
|
|
39
|
-
description: Whether to use strict version scheme. Mutually exclusive with
|
|
39
|
+
description: Whether to use strict version scheme. Mutually exclusive with O(version_type)
|
|
40
40
|
type: boolean
|
|
41
41
|
required: False
|
|
42
42
|
default: False
|
|
43
43
|
version_type:
|
|
44
|
-
description: Version scheme to use for comparison. Mutually exclusive with
|
|
44
|
+
description: Version scheme to use for comparison. Mutually exclusive with O(strict). See C(notes) for descriptions on the version types.
|
|
45
45
|
type: string
|
|
46
46
|
required: False
|
|
47
47
|
choices:
|
|
@@ -52,10 +52,10 @@ DOCUMENTATION:
|
|
|
52
52
|
- pep440
|
|
53
53
|
default: loose
|
|
54
54
|
notes:
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
55
|
+
- V(loose) - This type corresponds to the Python C(distutils.version.LooseVersion) class. All version formats are valid for this type. The rules for comparison are simple and predictable, but may not always give expected results.
|
|
56
|
+
- V(strict) - This type corresponds to the Python C(distutils.version.StrictVersion) class. A version number consists of two or three dot-separated numeric components, with an optional "pre-release" tag on the end. The pre-release tag consists of a single letter C(a) or C(b) followed by a number. If the numeric components of two version numbers are equal, then one with a pre-release tag will always be deemed earlier (lesser) than one without.
|
|
57
|
+
- V(semver)/V(semantic) - This type implements the L(Semantic Version,https://semver.org) scheme for version comparison.
|
|
58
|
+
- V(pep440) - This type implements the Python L(PEP-440,https://peps.python.org/pep-0440/) versioning rules for version comparison. Added in version 2.14.
|
|
59
59
|
EXAMPLES: |
|
|
60
60
|
- name: version test examples
|
|
61
61
|
assert:
|
|
@@ -78,5 +78,5 @@ EXAMPLES: |
|
|
|
78
78
|
- "'2.14.0rc1' is version('2.14.0', 'lt', version_type='pep440')"
|
|
79
79
|
RETURN:
|
|
80
80
|
_value:
|
|
81
|
-
description: Returns
|
|
81
|
+
description: Returns V(True) or V(False) depending on the outcome of the comparison.
|
|
82
82
|
type: boolean
|
|
@@ -55,7 +55,7 @@ DOCUMENTATION = '''
|
|
|
55
55
|
|
|
56
56
|
import os
|
|
57
57
|
from ansible.errors import AnsibleParserError
|
|
58
|
-
from ansible.module_utils.
|
|
58
|
+
from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text
|
|
59
59
|
from ansible.plugins.vars import BaseVarsPlugin
|
|
60
60
|
from ansible.inventory.host import Host
|
|
61
61
|
from ansible.inventory.group import Group
|
ansible/release.py
CHANGED
ansible/template/__init__.py
CHANGED
|
@@ -45,8 +45,8 @@ from ansible.errors import (
|
|
|
45
45
|
AnsibleOptionsError,
|
|
46
46
|
AnsibleUndefinedVariable,
|
|
47
47
|
)
|
|
48
|
-
from ansible.module_utils.six import string_types
|
|
49
|
-
from ansible.module_utils.
|
|
48
|
+
from ansible.module_utils.six import string_types
|
|
49
|
+
from ansible.module_utils.common.text.converters import to_native, to_text, to_bytes
|
|
50
50
|
from ansible.module_utils.common.collections import is_sequence
|
|
51
51
|
from ansible.plugins.loader import filter_loader, lookup_loader, test_loader
|
|
52
52
|
from ansible.template.native_helpers import ansible_native_concat, ansible_eval_concat, ansible_concat
|
|
@@ -55,7 +55,7 @@ from ansible.template.vars import AnsibleJ2Vars
|
|
|
55
55
|
from ansible.utils.display import Display
|
|
56
56
|
from ansible.utils.listify import listify_lookup_plugin_terms
|
|
57
57
|
from ansible.utils.native_jinja import NativeJinjaText
|
|
58
|
-
from ansible.utils.unsafe_proxy import wrap_var
|
|
58
|
+
from ansible.utils.unsafe_proxy import to_unsafe_text, wrap_var
|
|
59
59
|
|
|
60
60
|
display = Display()
|
|
61
61
|
|
|
@@ -103,9 +103,9 @@ def generate_ansible_template_vars(path, fullpath=None, dest_path=None):
|
|
|
103
103
|
managed_str = managed_default.format(
|
|
104
104
|
host=temp_vars['template_host'],
|
|
105
105
|
uid=temp_vars['template_uid'],
|
|
106
|
-
file=temp_vars['template_path'],
|
|
106
|
+
file=temp_vars['template_path'].replace('%', '%%'),
|
|
107
107
|
)
|
|
108
|
-
temp_vars['ansible_managed'] =
|
|
108
|
+
temp_vars['ansible_managed'] = to_unsafe_text(time.strftime(to_native(managed_str), time.localtime(os.path.getmtime(b_path))))
|
|
109
109
|
|
|
110
110
|
return temp_vars
|
|
111
111
|
|
|
@@ -130,7 +130,7 @@ def _escape_backslashes(data, jinja_env):
|
|
|
130
130
|
backslashes inside of a jinja2 expression.
|
|
131
131
|
|
|
132
132
|
"""
|
|
133
|
-
if '\\' in data and
|
|
133
|
+
if '\\' in data and jinja_env.variable_start_string in data:
|
|
134
134
|
new_data = []
|
|
135
135
|
d2 = jinja_env.preprocess(data)
|
|
136
136
|
in_var = False
|
|
@@ -445,11 +445,11 @@ class JinjaPluginIntercept(MutableMapping):
|
|
|
445
445
|
|
|
446
446
|
self._pluginloader = pluginloader
|
|
447
447
|
|
|
448
|
-
#
|
|
448
|
+
# Jinja environment's mapping of known names (initially just J2 builtins)
|
|
449
449
|
self._delegatee = delegatee
|
|
450
450
|
|
|
451
|
-
#
|
|
452
|
-
self.
|
|
451
|
+
# our names take precedence over Jinja's, but let things we've tried to resolve skip the pluginloader
|
|
452
|
+
self._seen_it = set()
|
|
453
453
|
|
|
454
454
|
def __getitem__(self, key):
|
|
455
455
|
|
|
@@ -457,7 +457,10 @@ class JinjaPluginIntercept(MutableMapping):
|
|
|
457
457
|
raise ValueError('key must be a string, got %s instead' % type(key))
|
|
458
458
|
|
|
459
459
|
original_exc = None
|
|
460
|
-
if key not in self.
|
|
460
|
+
if key not in self._seen_it:
|
|
461
|
+
# this looks too early to set this- it isn't. Setting it here keeps requests for Jinja builtins from
|
|
462
|
+
# going through the pluginloader more than once, which is extremely slow for something that won't ever succeed.
|
|
463
|
+
self._seen_it.add(key)
|
|
461
464
|
plugin = None
|
|
462
465
|
try:
|
|
463
466
|
plugin = self._pluginloader.get(key)
|
|
@@ -471,12 +474,12 @@ class JinjaPluginIntercept(MutableMapping):
|
|
|
471
474
|
if plugin:
|
|
472
475
|
# set in filter cache and avoid expensive plugin load
|
|
473
476
|
self._delegatee[key] = plugin.j2_function
|
|
474
|
-
self._loaded_builtins.add(key)
|
|
475
477
|
|
|
476
478
|
# raise template syntax error if we could not find ours or jinja2 one
|
|
477
479
|
try:
|
|
478
480
|
func = self._delegatee[key]
|
|
479
481
|
except KeyError as e:
|
|
482
|
+
self._seen_it.remove(key)
|
|
480
483
|
raise TemplateSyntaxError('Could not load "%s": %s' % (key, to_native(original_exc or e)), 0)
|
|
481
484
|
|
|
482
485
|
# if i do have func and it is a filter, it nees wrapping
|
|
@@ -578,14 +581,7 @@ class Templar:
|
|
|
578
581
|
The main class for templating, with the main entry-point of template().
|
|
579
582
|
'''
|
|
580
583
|
|
|
581
|
-
def __init__(self, loader,
|
|
582
|
-
if shared_loader_obj is not None:
|
|
583
|
-
display.deprecated(
|
|
584
|
-
"The `shared_loader_obj` option to `Templar` is no longer functional, "
|
|
585
|
-
"ansible.plugins.loader is used directly instead.",
|
|
586
|
-
version='2.16',
|
|
587
|
-
)
|
|
588
|
-
|
|
584
|
+
def __init__(self, loader, variables=None):
|
|
589
585
|
self._loader = loader
|
|
590
586
|
self._available_variables = {} if variables is None else variables
|
|
591
587
|
|
|
@@ -599,9 +595,6 @@ class Templar:
|
|
|
599
595
|
)
|
|
600
596
|
self.environment.template_class.environment_class = environment_class
|
|
601
597
|
|
|
602
|
-
# jinja2 global is inconsistent across versions, this normalizes them
|
|
603
|
-
self.environment.globals['dict'] = dict
|
|
604
|
-
|
|
605
598
|
# Custom globals
|
|
606
599
|
self.environment.globals['lookup'] = self._lookup
|
|
607
600
|
self.environment.globals['query'] = self.environment.globals['q'] = self._query_lookup
|
|
@@ -611,11 +604,14 @@ class Templar:
|
|
|
611
604
|
# the current rendering context under which the templar class is working
|
|
612
605
|
self.cur_context = None
|
|
613
606
|
|
|
614
|
-
#
|
|
615
|
-
self.
|
|
607
|
+
# this regex is re-compiled each time variable_start_string and variable_end_string are possibly changed
|
|
608
|
+
self._compile_single_var(self.environment)
|
|
616
609
|
|
|
617
610
|
self.jinja2_native = C.DEFAULT_JINJA2_NATIVE
|
|
618
611
|
|
|
612
|
+
def _compile_single_var(self, env):
|
|
613
|
+
self.SINGLE_VAR = re.compile(r"^%s\s*(\w*)\s*%s$" % (env.variable_start_string, env.variable_end_string))
|
|
614
|
+
|
|
619
615
|
def copy_with_new_env(self, environment_class=AnsibleEnvironment, **kwargs):
|
|
620
616
|
r"""Creates a new copy of Templar with a new environment.
|
|
621
617
|
|
|
@@ -763,6 +759,7 @@ class Templar:
|
|
|
763
759
|
disable_lookups=disable_lookups,
|
|
764
760
|
convert_data=convert_data,
|
|
765
761
|
)
|
|
762
|
+
self._compile_single_var(self.environment)
|
|
766
763
|
|
|
767
764
|
return result
|
|
768
765
|
|
|
@@ -835,7 +832,7 @@ class Templar:
|
|
|
835
832
|
def _now_datetime(self, utc=False, fmt=None):
|
|
836
833
|
'''jinja2 global function to return current datetime, potentially formatted via strftime'''
|
|
837
834
|
if utc:
|
|
838
|
-
now = datetime.datetime.
|
|
835
|
+
now = datetime.datetime.now(datetime.timezone.utc).replace(tzinfo=None)
|
|
839
836
|
else:
|
|
840
837
|
now = datetime.datetime.now()
|
|
841
838
|
|
|
@@ -955,8 +952,9 @@ class Templar:
|
|
|
955
952
|
try:
|
|
956
953
|
# NOTE Creating an overlay that lives only inside do_template means that overrides are not applied
|
|
957
954
|
# when templating nested variables in AnsibleJ2Vars where Templar.environment is used, not the overlay.
|
|
958
|
-
# This is historic behavior that is kept for backwards compatibility.
|
|
959
955
|
data, myenv = _create_overlay(data, overrides, self.environment)
|
|
956
|
+
# in case delimiters change
|
|
957
|
+
self._compile_single_var(myenv)
|
|
960
958
|
|
|
961
959
|
if escape_backslashes:
|
|
962
960
|
# Allow users to specify backslashes in playbooks as "\\" instead of as "\\\\".
|
|
@@ -10,7 +10,7 @@ import ast
|
|
|
10
10
|
from itertools import islice, chain
|
|
11
11
|
from types import GeneratorType
|
|
12
12
|
|
|
13
|
-
from ansible.module_utils.
|
|
13
|
+
from ansible.module_utils.common.text.converters import to_text
|
|
14
14
|
from ansible.module_utils.six import string_types
|
|
15
15
|
from ansible.parsing.yaml.objects import AnsibleVaultEncryptedUnicode
|
|
16
16
|
from ansible.utils.native_jinja import NativeJinjaText
|
ansible/template/vars.py
CHANGED
|
@@ -6,7 +6,7 @@ from collections import ChainMap
|
|
|
6
6
|
from jinja2.utils import missing
|
|
7
7
|
|
|
8
8
|
from ansible.errors import AnsibleError, AnsibleUndefinedVariable
|
|
9
|
-
from ansible.module_utils.
|
|
9
|
+
from ansible.module_utils.common.text.converters import to_native
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
__all__ = ['AnsibleJ2Vars']
|