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
ansible/cli/__init__.py
CHANGED
|
@@ -13,9 +13,9 @@ import sys
|
|
|
13
13
|
|
|
14
14
|
# Used for determining if the system is running a new enough python version
|
|
15
15
|
# and should only restrict on our documented minimum versions
|
|
16
|
-
if sys.version_info < (3,
|
|
16
|
+
if sys.version_info < (3, 10):
|
|
17
17
|
raise SystemExit(
|
|
18
|
-
'ERROR: Ansible requires Python 3.
|
|
18
|
+
'ERROR: Ansible requires Python 3.10 or newer on the controller. '
|
|
19
19
|
'Current version: %s' % ''.join(sys.version.splitlines())
|
|
20
20
|
)
|
|
21
21
|
|
|
@@ -97,7 +97,7 @@ from ansible.cli.arguments import option_helpers as opt_help
|
|
|
97
97
|
from ansible.errors import AnsibleError, AnsibleOptionsError, AnsibleParserError
|
|
98
98
|
from ansible.inventory.manager import InventoryManager
|
|
99
99
|
from ansible.module_utils.six import string_types
|
|
100
|
-
from ansible.module_utils.
|
|
100
|
+
from ansible.module_utils.common.text.converters import to_bytes, to_text
|
|
101
101
|
from ansible.module_utils.common.collections import is_sequence
|
|
102
102
|
from ansible.module_utils.common.file import is_executable
|
|
103
103
|
from ansible.parsing.dataloader import DataLoader
|
ansible/cli/adhoc.py
CHANGED
|
@@ -14,7 +14,7 @@ from ansible import context
|
|
|
14
14
|
from ansible.cli.arguments import option_helpers as opt_help
|
|
15
15
|
from ansible.errors import AnsibleError, AnsibleOptionsError, AnsibleParserError
|
|
16
16
|
from ansible.executor.task_queue_manager import TaskQueueManager
|
|
17
|
-
from ansible.module_utils.
|
|
17
|
+
from ansible.module_utils.common.text.converters import to_text
|
|
18
18
|
from ansible.parsing.splitter import parse_kv
|
|
19
19
|
from ansible.parsing.utils.yaml import from_yaml
|
|
20
20
|
from ansible.playbook import Playbook
|
|
@@ -16,7 +16,7 @@ from jinja2 import __version__ as j2_version
|
|
|
16
16
|
|
|
17
17
|
import ansible
|
|
18
18
|
from ansible import constants as C
|
|
19
|
-
from ansible.module_utils.
|
|
19
|
+
from ansible.module_utils.common.text.converters import to_native
|
|
20
20
|
from ansible.module_utils.common.yaml import HAS_LIBYAML, yaml_load
|
|
21
21
|
from ansible.release import __version__
|
|
22
22
|
from ansible.utils.path import unfrackpath
|
|
@@ -31,6 +31,16 @@ class SortingHelpFormatter(argparse.HelpFormatter):
|
|
|
31
31
|
super(SortingHelpFormatter, self).add_arguments(actions)
|
|
32
32
|
|
|
33
33
|
|
|
34
|
+
class ArgumentParser(argparse.ArgumentParser):
|
|
35
|
+
def add_argument(self, *args, **kwargs):
|
|
36
|
+
action = kwargs.get('action')
|
|
37
|
+
help = kwargs.get('help')
|
|
38
|
+
if help and action in {'append', 'append_const', 'count', 'extend', PrependListAction}:
|
|
39
|
+
help = f'{help.rstrip(".")}. This argument may be specified multiple times.'
|
|
40
|
+
kwargs['help'] = help
|
|
41
|
+
return super().add_argument(*args, **kwargs)
|
|
42
|
+
|
|
43
|
+
|
|
34
44
|
class AnsibleVersion(argparse.Action):
|
|
35
45
|
def __call__(self, parser, namespace, values, option_string=None):
|
|
36
46
|
ansible_version = to_native(version(getattr(parser, 'prog')))
|
|
@@ -192,7 +202,7 @@ def create_base_parser(prog, usage="", desc=None, epilog=None):
|
|
|
192
202
|
Create an options parser for all ansible scripts
|
|
193
203
|
"""
|
|
194
204
|
# base opts
|
|
195
|
-
parser =
|
|
205
|
+
parser = ArgumentParser(
|
|
196
206
|
prog=prog,
|
|
197
207
|
formatter_class=SortingHelpFormatter,
|
|
198
208
|
epilog=epilog,
|
|
@@ -250,8 +260,8 @@ def add_connect_options(parser):
|
|
|
250
260
|
help='connect as this user (default=%s)' % C.DEFAULT_REMOTE_USER)
|
|
251
261
|
connect_group.add_argument('-c', '--connection', dest='connection', default=C.DEFAULT_TRANSPORT,
|
|
252
262
|
help="connection type to use (default=%s)" % C.DEFAULT_TRANSPORT)
|
|
253
|
-
connect_group.add_argument('-T', '--timeout', default=
|
|
254
|
-
help="override the connection timeout in seconds (default
|
|
263
|
+
connect_group.add_argument('-T', '--timeout', default=None, type=int, dest='timeout',
|
|
264
|
+
help="override the connection timeout in seconds (default depends on connection)")
|
|
255
265
|
|
|
256
266
|
# ssh only
|
|
257
267
|
connect_group.add_argument('--ssh-common-args', default=None, dest='ssh_common_args',
|
|
@@ -383,7 +393,7 @@ def add_vault_options(parser):
|
|
|
383
393
|
parser.add_argument('--vault-id', default=[], dest='vault_ids', action='append', type=str,
|
|
384
394
|
help='the vault identity to use')
|
|
385
395
|
base_group = parser.add_mutually_exclusive_group()
|
|
386
|
-
base_group.add_argument('--ask-vault-password', '--ask-vault-pass', default=C.DEFAULT_ASK_VAULT_PASS, dest='ask_vault_pass', action='store_true',
|
|
396
|
+
base_group.add_argument('-J', '--ask-vault-password', '--ask-vault-pass', default=C.DEFAULT_ASK_VAULT_PASS, dest='ask_vault_pass', action='store_true',
|
|
387
397
|
help='ask for vault password')
|
|
388
398
|
base_group.add_argument('--vault-password-file', '--vault-pass-file', default=[], dest='vault_password_files',
|
|
389
399
|
help="vault password file", type=unfrack_path(follow=False), action='append')
|
ansible/cli/config.py
CHANGED
|
@@ -23,7 +23,7 @@ from ansible import constants as C
|
|
|
23
23
|
from ansible.cli.arguments import option_helpers as opt_help
|
|
24
24
|
from ansible.config.manager import ConfigManager, Setting
|
|
25
25
|
from ansible.errors import AnsibleError, AnsibleOptionsError
|
|
26
|
-
from ansible.module_utils.
|
|
26
|
+
from ansible.module_utils.common.text.converters import to_native, to_text, to_bytes
|
|
27
27
|
from ansible.module_utils.common.json import json_dump
|
|
28
28
|
from ansible.module_utils.six import string_types
|
|
29
29
|
from ansible.parsing.quoting import is_quoted
|
|
@@ -67,7 +67,7 @@ class ConfigCLI(CLI):
|
|
|
67
67
|
desc="View ansible configuration.",
|
|
68
68
|
)
|
|
69
69
|
|
|
70
|
-
common = opt_help.
|
|
70
|
+
common = opt_help.ArgumentParser(add_help=False)
|
|
71
71
|
opt_help.add_verbosity_options(common)
|
|
72
72
|
common.add_argument('-c', '--config', dest='config_file',
|
|
73
73
|
help="path to configuration file, defaults to first file found in precedence.")
|
ansible/cli/console.py
CHANGED
|
@@ -22,7 +22,7 @@ from ansible import constants as C
|
|
|
22
22
|
from ansible import context
|
|
23
23
|
from ansible.cli.arguments import option_helpers as opt_help
|
|
24
24
|
from ansible.executor.task_queue_manager import TaskQueueManager
|
|
25
|
-
from ansible.module_utils.
|
|
25
|
+
from ansible.module_utils.common.text.converters import to_native, to_text
|
|
26
26
|
from ansible.module_utils.parsing.convert_bool import boolean
|
|
27
27
|
from ansible.parsing.splitter import parse_kv
|
|
28
28
|
from ansible.playbook.play import Play
|
|
@@ -39,26 +39,30 @@ class ConsoleCLI(CLI, cmd.Cmd):
|
|
|
39
39
|
'''
|
|
40
40
|
A REPL that allows for running ad-hoc tasks against a chosen inventory
|
|
41
41
|
from a nice shell with built-in tab completion (based on dominis'
|
|
42
|
-
ansible-shell).
|
|
42
|
+
``ansible-shell``).
|
|
43
43
|
|
|
44
44
|
It supports several commands, and you can modify its configuration at
|
|
45
45
|
runtime:
|
|
46
46
|
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
-
|
|
47
|
+
- ``cd [pattern]``: change host/group
|
|
48
|
+
(you can use host patterns eg.: ``app*.dc*:!app01*``)
|
|
49
|
+
- ``list``: list available hosts in the current path
|
|
50
|
+
- ``list groups``: list groups included in the current path
|
|
51
|
+
- ``become``: toggle the become flag
|
|
52
|
+
- ``!``: forces shell module instead of the ansible module
|
|
53
|
+
(``!yum update -y``)
|
|
54
|
+
- ``verbosity [num]``: set the verbosity level
|
|
55
|
+
- ``forks [num]``: set the number of forks
|
|
56
|
+
- ``become_user [user]``: set the become_user
|
|
57
|
+
- ``remote_user [user]``: set the remote_user
|
|
58
|
+
- ``become_method [method]``: set the privilege escalation method
|
|
59
|
+
- ``check [bool]``: toggle check mode
|
|
60
|
+
- ``diff [bool]``: toggle diff mode
|
|
61
|
+
- ``timeout [integer]``: set the timeout of tasks in seconds
|
|
62
|
+
(0 to disable)
|
|
63
|
+
- ``help [command/module]``: display documentation for
|
|
64
|
+
the command or module
|
|
65
|
+
- ``exit``: exit ``ansible-console``
|
|
62
66
|
'''
|
|
63
67
|
|
|
64
68
|
name = 'ansible-console'
|
ansible/cli/doc.py
CHANGED
|
@@ -26,7 +26,7 @@ from ansible import context
|
|
|
26
26
|
from ansible.cli.arguments import option_helpers as opt_help
|
|
27
27
|
from ansible.collections.list import list_collection_dirs
|
|
28
28
|
from ansible.errors import AnsibleError, AnsibleOptionsError, AnsibleParserError, AnsiblePluginNotFound
|
|
29
|
-
from ansible.module_utils.
|
|
29
|
+
from ansible.module_utils.common.text.converters import to_native, to_text
|
|
30
30
|
from ansible.module_utils.common.collections import is_sequence
|
|
31
31
|
from ansible.module_utils.common.json import json_dump
|
|
32
32
|
from ansible.module_utils.common.yaml import yaml_dump
|
|
@@ -163,8 +163,8 @@ class RoleMixin(object):
|
|
|
163
163
|
might be fully qualified with the collection name (e.g., community.general.roleA)
|
|
164
164
|
or not (e.g., roleA).
|
|
165
165
|
|
|
166
|
-
:param collection_filter: A
|
|
167
|
-
used to limit results. This filter will take precedence over the name_filters.
|
|
166
|
+
:param collection_filter: A list of strings containing the FQCN of a collection which will
|
|
167
|
+
be used to limit results. This filter will take precedence over the name_filters.
|
|
168
168
|
|
|
169
169
|
:returns: A set of tuples consisting of: role name, collection name, collection path
|
|
170
170
|
"""
|
|
@@ -678,12 +678,11 @@ class DocCLI(CLI, RoleMixin):
|
|
|
678
678
|
def _get_collection_filter(self):
|
|
679
679
|
|
|
680
680
|
coll_filter = None
|
|
681
|
-
if len(context.CLIARGS['args'])
|
|
682
|
-
coll_filter = context.CLIARGS['args']
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
raise AnsibleOptionsError("Only a single collection filter is supported.")
|
|
681
|
+
if len(context.CLIARGS['args']) >= 1:
|
|
682
|
+
coll_filter = context.CLIARGS['args']
|
|
683
|
+
for coll_name in coll_filter:
|
|
684
|
+
if not AnsibleCollectionRef.is_valid_collection_name(coll_name):
|
|
685
|
+
raise AnsibleError('Invalid collection name (must be of the form namespace.collection): {0}'.format(coll_name))
|
|
687
686
|
|
|
688
687
|
return coll_filter
|
|
689
688
|
|
ansible/cli/galaxy.py
CHANGED
|
@@ -10,6 +10,7 @@ __metaclass__ = type
|
|
|
10
10
|
# ansible.cli needs to be imported first, to ensure the source bin/* scripts run that code first
|
|
11
11
|
from ansible.cli import CLI
|
|
12
12
|
|
|
13
|
+
import argparse
|
|
13
14
|
import functools
|
|
14
15
|
import json
|
|
15
16
|
import os.path
|
|
@@ -52,7 +53,7 @@ from ansible.galaxy.token import BasicAuthToken, GalaxyToken, KeycloakToken, NoT
|
|
|
52
53
|
from ansible.module_utils.ansible_release import __version__ as ansible_version
|
|
53
54
|
from ansible.module_utils.common.collections import is_iterable
|
|
54
55
|
from ansible.module_utils.common.yaml import yaml_dump, yaml_load
|
|
55
|
-
from ansible.module_utils.
|
|
56
|
+
from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text
|
|
56
57
|
from ansible.module_utils import six
|
|
57
58
|
from ansible.parsing.dataloader import DataLoader
|
|
58
59
|
from ansible.parsing.yaml.loader import AnsibleLoader
|
|
@@ -72,7 +73,7 @@ SERVER_DEF = [
|
|
|
72
73
|
('password', False, 'str'),
|
|
73
74
|
('token', False, 'str'),
|
|
74
75
|
('auth_url', False, 'str'),
|
|
75
|
-
('
|
|
76
|
+
('api_version', False, 'int'),
|
|
76
77
|
('validate_certs', False, 'bool'),
|
|
77
78
|
('client_id', False, 'str'),
|
|
78
79
|
('timeout', False, 'int'),
|
|
@@ -80,9 +81,9 @@ SERVER_DEF = [
|
|
|
80
81
|
|
|
81
82
|
# config definition fields
|
|
82
83
|
SERVER_ADDITIONAL = {
|
|
83
|
-
'
|
|
84
|
+
'api_version': {'default': None, 'choices': [2, 3]},
|
|
84
85
|
'validate_certs': {'cli': [{'name': 'validate_certs'}]},
|
|
85
|
-
'timeout': {'default':
|
|
86
|
+
'timeout': {'default': C.GALAXY_SERVER_TIMEOUT, 'cli': [{'name': 'timeout'}]},
|
|
86
87
|
'token': {'default': None},
|
|
87
88
|
}
|
|
88
89
|
|
|
@@ -240,44 +241,49 @@ class GalaxyCLI(CLI):
|
|
|
240
241
|
)
|
|
241
242
|
|
|
242
243
|
# Common arguments that apply to more than 1 action
|
|
243
|
-
common = opt_help.
|
|
244
|
+
common = opt_help.ArgumentParser(add_help=False)
|
|
244
245
|
common.add_argument('-s', '--server', dest='api_server', help='The Galaxy API server URL')
|
|
246
|
+
common.add_argument('--api-version', type=int, choices=[2, 3], help=argparse.SUPPRESS) # Hidden argument that should only be used in our tests
|
|
245
247
|
common.add_argument('--token', '--api-key', dest='api_key',
|
|
246
248
|
help='The Ansible Galaxy API key which can be found at '
|
|
247
249
|
'https://galaxy.ansible.com/me/preferences.')
|
|
248
250
|
common.add_argument('-c', '--ignore-certs', action='store_true', dest='ignore_certs', help='Ignore SSL certificate validation errors.', default=None)
|
|
249
|
-
|
|
251
|
+
|
|
252
|
+
# --timeout uses the default None to handle two different scenarios.
|
|
253
|
+
# * --timeout > C.GALAXY_SERVER_TIMEOUT for non-configured servers
|
|
254
|
+
# * --timeout > server-specific timeout > C.GALAXY_SERVER_TIMEOUT for configured servers.
|
|
255
|
+
common.add_argument('--timeout', dest='timeout', type=int,
|
|
250
256
|
help="The time to wait for operations against the galaxy server, defaults to 60s.")
|
|
251
257
|
|
|
252
258
|
opt_help.add_verbosity_options(common)
|
|
253
259
|
|
|
254
|
-
force = opt_help.
|
|
260
|
+
force = opt_help.ArgumentParser(add_help=False)
|
|
255
261
|
force.add_argument('-f', '--force', dest='force', action='store_true', default=False,
|
|
256
262
|
help='Force overwriting an existing role or collection')
|
|
257
263
|
|
|
258
|
-
github = opt_help.
|
|
264
|
+
github = opt_help.ArgumentParser(add_help=False)
|
|
259
265
|
github.add_argument('github_user', help='GitHub username')
|
|
260
266
|
github.add_argument('github_repo', help='GitHub repository')
|
|
261
267
|
|
|
262
|
-
offline = opt_help.
|
|
268
|
+
offline = opt_help.ArgumentParser(add_help=False)
|
|
263
269
|
offline.add_argument('--offline', dest='offline', default=False, action='store_true',
|
|
264
270
|
help="Don't query the galaxy API when creating roles")
|
|
265
271
|
|
|
266
272
|
default_roles_path = C.config.get_configuration_definition('DEFAULT_ROLES_PATH').get('default', '')
|
|
267
|
-
roles_path = opt_help.
|
|
273
|
+
roles_path = opt_help.ArgumentParser(add_help=False)
|
|
268
274
|
roles_path.add_argument('-p', '--roles-path', dest='roles_path', type=opt_help.unfrack_path(pathsep=True),
|
|
269
275
|
default=C.DEFAULT_ROLES_PATH, action=opt_help.PrependListAction,
|
|
270
276
|
help='The path to the directory containing your roles. The default is the first '
|
|
271
277
|
'writable one configured via DEFAULT_ROLES_PATH: %s ' % default_roles_path)
|
|
272
278
|
|
|
273
|
-
collections_path = opt_help.
|
|
279
|
+
collections_path = opt_help.ArgumentParser(add_help=False)
|
|
274
280
|
collections_path.add_argument('-p', '--collections-path', dest='collections_path', type=opt_help.unfrack_path(pathsep=True),
|
|
275
281
|
action=opt_help.PrependListAction,
|
|
276
282
|
help="One or more directories to search for collections in addition "
|
|
277
283
|
"to the default COLLECTIONS_PATHS. Separate multiple paths "
|
|
278
284
|
"with '{0}'.".format(os.path.pathsep))
|
|
279
285
|
|
|
280
|
-
cache_options = opt_help.
|
|
286
|
+
cache_options = opt_help.ArgumentParser(add_help=False)
|
|
281
287
|
cache_options.add_argument('--clear-response-cache', dest='clear_response_cache', action='store_true',
|
|
282
288
|
default=False, help='Clear the existing server response cache.')
|
|
283
289
|
cache_options.add_argument('--no-cache', dest='no_cache', action='store_true', default=False,
|
|
@@ -461,12 +467,15 @@ class GalaxyCLI(CLI):
|
|
|
461
467
|
valid_signature_count_help = 'The number of signatures that must successfully verify the collection. This should be a positive integer ' \
|
|
462
468
|
'or all to signify that all signatures must be used to verify the collection. ' \
|
|
463
469
|
'Prepend the value with + to fail if no valid signatures are found for the collection (e.g. +all).'
|
|
464
|
-
ignore_gpg_status_help = 'A status
|
|
465
|
-
'
|
|
466
|
-
'
|
|
470
|
+
ignore_gpg_status_help = 'A space separated list of status codes to ignore during signature verification (for example, NO_PUBKEY FAILURE). ' \
|
|
471
|
+
'Descriptions for the choices can be seen at L(https://github.com/gpg/gnupg/blob/master/doc/DETAILS#general-status-codes).' \
|
|
472
|
+
'Note: specify these after positional arguments or use -- to separate them.'
|
|
467
473
|
verify_parser.add_argument('--required-valid-signature-count', dest='required_valid_signature_count', type=validate_signature_count,
|
|
468
474
|
help=valid_signature_count_help, default=C.GALAXY_REQUIRED_VALID_SIGNATURE_COUNT)
|
|
469
475
|
verify_parser.add_argument('--ignore-signature-status-code', dest='ignore_gpg_errors', type=str, action='append',
|
|
476
|
+
help=opt_help.argparse.SUPPRESS, default=C.GALAXY_IGNORE_INVALID_SIGNATURE_STATUS_CODES,
|
|
477
|
+
choices=list(GPG_ERROR_MAP.keys()))
|
|
478
|
+
verify_parser.add_argument('--ignore-signature-status-codes', dest='ignore_gpg_errors', type=str, action='extend', nargs='+',
|
|
470
479
|
help=ignore_gpg_status_help, default=C.GALAXY_IGNORE_INVALID_SIGNATURE_STATUS_CODES,
|
|
471
480
|
choices=list(GPG_ERROR_MAP.keys()))
|
|
472
481
|
|
|
@@ -502,9 +511,9 @@ class GalaxyCLI(CLI):
|
|
|
502
511
|
valid_signature_count_help = 'The number of signatures that must successfully verify the collection. This should be a positive integer ' \
|
|
503
512
|
'or -1 to signify that all signatures must be used to verify the collection. ' \
|
|
504
513
|
'Prepend the value with + to fail if no valid signatures are found for the collection (e.g. +all).'
|
|
505
|
-
ignore_gpg_status_help = 'A status
|
|
506
|
-
'
|
|
507
|
-
'
|
|
514
|
+
ignore_gpg_status_help = 'A space separated list of status codes to ignore during signature verification (for example, NO_PUBKEY FAILURE). ' \
|
|
515
|
+
'Descriptions for the choices can be seen at L(https://github.com/gpg/gnupg/blob/master/doc/DETAILS#general-status-codes).' \
|
|
516
|
+
'Note: specify these after positional arguments or use -- to separate them.'
|
|
508
517
|
|
|
509
518
|
if galaxy_type == 'collection':
|
|
510
519
|
install_parser.add_argument('-p', '--collections-path', dest='collections_path',
|
|
@@ -528,6 +537,9 @@ class GalaxyCLI(CLI):
|
|
|
528
537
|
install_parser.add_argument('--required-valid-signature-count', dest='required_valid_signature_count', type=validate_signature_count,
|
|
529
538
|
help=valid_signature_count_help, default=C.GALAXY_REQUIRED_VALID_SIGNATURE_COUNT)
|
|
530
539
|
install_parser.add_argument('--ignore-signature-status-code', dest='ignore_gpg_errors', type=str, action='append',
|
|
540
|
+
help=opt_help.argparse.SUPPRESS, default=C.GALAXY_IGNORE_INVALID_SIGNATURE_STATUS_CODES,
|
|
541
|
+
choices=list(GPG_ERROR_MAP.keys()))
|
|
542
|
+
install_parser.add_argument('--ignore-signature-status-codes', dest='ignore_gpg_errors', type=str, action='extend', nargs='+',
|
|
531
543
|
help=ignore_gpg_status_help, default=C.GALAXY_IGNORE_INVALID_SIGNATURE_STATUS_CODES,
|
|
532
544
|
choices=list(GPG_ERROR_MAP.keys()))
|
|
533
545
|
install_parser.add_argument('--offline', dest='offline', action='store_true', default=False,
|
|
@@ -552,6 +564,9 @@ class GalaxyCLI(CLI):
|
|
|
552
564
|
install_parser.add_argument('--required-valid-signature-count', dest='required_valid_signature_count', type=validate_signature_count,
|
|
553
565
|
help=valid_signature_count_help, default=C.GALAXY_REQUIRED_VALID_SIGNATURE_COUNT)
|
|
554
566
|
install_parser.add_argument('--ignore-signature-status-code', dest='ignore_gpg_errors', type=str, action='append',
|
|
567
|
+
help=opt_help.argparse.SUPPRESS, default=C.GALAXY_IGNORE_INVALID_SIGNATURE_STATUS_CODES,
|
|
568
|
+
choices=list(GPG_ERROR_MAP.keys()))
|
|
569
|
+
install_parser.add_argument('--ignore-signature-status-codes', dest='ignore_gpg_errors', type=str, action='extend', nargs='+',
|
|
555
570
|
help=ignore_gpg_status_help, default=C.GALAXY_IGNORE_INVALID_SIGNATURE_STATUS_CODES,
|
|
556
571
|
choices=list(GPG_ERROR_MAP.keys()))
|
|
557
572
|
|
|
@@ -623,7 +638,7 @@ class GalaxyCLI(CLI):
|
|
|
623
638
|
return config_def
|
|
624
639
|
|
|
625
640
|
galaxy_options = {}
|
|
626
|
-
for optional_key in ['clear_response_cache', 'no_cache'
|
|
641
|
+
for optional_key in ['clear_response_cache', 'no_cache']:
|
|
627
642
|
if optional_key in context.CLIARGS:
|
|
628
643
|
galaxy_options[optional_key] = context.CLIARGS[optional_key]
|
|
629
644
|
|
|
@@ -648,17 +663,22 @@ class GalaxyCLI(CLI):
|
|
|
648
663
|
client_id = server_options.pop('client_id')
|
|
649
664
|
token_val = server_options['token'] or NoTokenSentinel
|
|
650
665
|
username = server_options['username']
|
|
651
|
-
|
|
666
|
+
api_version = server_options.pop('api_version')
|
|
652
667
|
if server_options['validate_certs'] is None:
|
|
653
668
|
server_options['validate_certs'] = context.CLIARGS['resolved_validate_certs']
|
|
654
669
|
validate_certs = server_options['validate_certs']
|
|
655
670
|
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
671
|
+
# This allows a user to explicitly force use of an API version when
|
|
672
|
+
# multiple versions are supported. This was added for testing
|
|
673
|
+
# against pulp_ansible and I'm not sure it has a practical purpose
|
|
674
|
+
# outside of this use case. As such, this option is not documented
|
|
675
|
+
# as of now
|
|
676
|
+
if api_version:
|
|
677
|
+
display.warning(
|
|
678
|
+
f'The specified "api_version" configuration for the galaxy server "{server_key}" is '
|
|
679
|
+
'not a public configuration, and may be removed at any time without warning.'
|
|
680
|
+
)
|
|
681
|
+
server_options['available_api_versions'] = {'v%s' % api_version: '/v%s' % api_version}
|
|
662
682
|
|
|
663
683
|
# default case if no auth info is provided.
|
|
664
684
|
server_options['token'] = None
|
|
@@ -684,9 +704,17 @@ class GalaxyCLI(CLI):
|
|
|
684
704
|
))
|
|
685
705
|
|
|
686
706
|
cmd_server = context.CLIARGS['api_server']
|
|
707
|
+
if context.CLIARGS['api_version']:
|
|
708
|
+
api_version = context.CLIARGS['api_version']
|
|
709
|
+
display.warning(
|
|
710
|
+
'The --api-version is not a public argument, and may be removed at any time without warning.'
|
|
711
|
+
)
|
|
712
|
+
galaxy_options['available_api_versions'] = {'v%s' % api_version: '/v%s' % api_version}
|
|
713
|
+
|
|
687
714
|
cmd_token = GalaxyToken(token=context.CLIARGS['api_key'])
|
|
688
715
|
|
|
689
716
|
validate_certs = context.CLIARGS['resolved_validate_certs']
|
|
717
|
+
default_server_timeout = context.CLIARGS['timeout'] if context.CLIARGS['timeout'] is not None else C.GALAXY_SERVER_TIMEOUT
|
|
690
718
|
if cmd_server:
|
|
691
719
|
# Cmd args take precedence over the config entry but fist check if the arg was a name and use that config
|
|
692
720
|
# entry, otherwise create a new API entry for the server specified.
|
|
@@ -698,6 +726,7 @@ class GalaxyCLI(CLI):
|
|
|
698
726
|
self.galaxy, 'cmd_arg', cmd_server, token=cmd_token,
|
|
699
727
|
priority=len(config_servers) + 1,
|
|
700
728
|
validate_certs=validate_certs,
|
|
729
|
+
timeout=default_server_timeout,
|
|
701
730
|
**galaxy_options
|
|
702
731
|
))
|
|
703
732
|
else:
|
|
@@ -709,6 +738,7 @@ class GalaxyCLI(CLI):
|
|
|
709
738
|
self.galaxy, 'default', C.GALAXY_SERVER, token=cmd_token,
|
|
710
739
|
priority=0,
|
|
711
740
|
validate_certs=validate_certs,
|
|
741
|
+
timeout=default_server_timeout,
|
|
712
742
|
**galaxy_options
|
|
713
743
|
))
|
|
714
744
|
|
|
@@ -1235,6 +1265,9 @@ class GalaxyCLI(CLI):
|
|
|
1235
1265
|
|
|
1236
1266
|
if remote_data:
|
|
1237
1267
|
role_info.update(remote_data)
|
|
1268
|
+
else:
|
|
1269
|
+
data = u"- the role %s was not found" % role
|
|
1270
|
+
break
|
|
1238
1271
|
|
|
1239
1272
|
elif context.CLIARGS['offline'] and not gr._exists:
|
|
1240
1273
|
data = u"- the role %s was not found" % role
|
|
@@ -1401,7 +1434,7 @@ class GalaxyCLI(CLI):
|
|
|
1401
1434
|
managed_paths = set(validate_collection_path(p) for p in C.COLLECTIONS_PATHS)
|
|
1402
1435
|
read_req_paths = set(validate_collection_path(p) for p in AnsibleCollectionConfig.collection_paths)
|
|
1403
1436
|
|
|
1404
|
-
unexpected_path = not any(p.startswith(path) for p in managed_paths)
|
|
1437
|
+
unexpected_path = C.GALAXY_COLLECTIONS_PATH_WARNING and not any(p.startswith(path) for p in managed_paths)
|
|
1405
1438
|
if unexpected_path and any(p.startswith(path) for p in read_req_paths):
|
|
1406
1439
|
display.warning(
|
|
1407
1440
|
f"The specified collections path '{path}' appears to be part of the pip Ansible package. "
|
ansible/cli/inventory.py
CHANGED
|
@@ -18,7 +18,7 @@ from ansible import constants as C
|
|
|
18
18
|
from ansible import context
|
|
19
19
|
from ansible.cli.arguments import option_helpers as opt_help
|
|
20
20
|
from ansible.errors import AnsibleError, AnsibleOptionsError
|
|
21
|
-
from ansible.module_utils.
|
|
21
|
+
from ansible.module_utils.common.text.converters import to_bytes, to_native, to_text
|
|
22
22
|
from ansible.utils.vars import combine_vars
|
|
23
23
|
from ansible.utils.display import Display
|
|
24
24
|
from ansible.vars.plugins import get_vars_from_inventory_sources, get_vars_from_path
|
ansible/cli/playbook.py
CHANGED
|
@@ -18,7 +18,7 @@ from ansible import context
|
|
|
18
18
|
from ansible.cli.arguments import option_helpers as opt_help
|
|
19
19
|
from ansible.errors import AnsibleError
|
|
20
20
|
from ansible.executor.playbook_executor import PlaybookExecutor
|
|
21
|
-
from ansible.module_utils.
|
|
21
|
+
from ansible.module_utils.common.text.converters import to_bytes
|
|
22
22
|
from ansible.playbook.block import Block
|
|
23
23
|
from ansible.plugins.loader import add_all_plugin_dirs
|
|
24
24
|
from ansible.utils.collection_loader import AnsibleCollectionConfig
|
ansible/cli/pull.py
CHANGED
|
@@ -24,7 +24,7 @@ from ansible import constants as C
|
|
|
24
24
|
from ansible import context
|
|
25
25
|
from ansible.cli.arguments import option_helpers as opt_help
|
|
26
26
|
from ansible.errors import AnsibleOptionsError
|
|
27
|
-
from ansible.module_utils.
|
|
27
|
+
from ansible.module_utils.common.text.converters import to_native, to_text
|
|
28
28
|
from ansible.plugins.loader import module_loader
|
|
29
29
|
from ansible.utils.cmd_functions import run_cmd
|
|
30
30
|
from ansible.utils.display import Display
|
|
@@ -80,7 +80,7 @@ class PullCLI(CLI):
|
|
|
80
80
|
|
|
81
81
|
super(PullCLI, self).init_parser(
|
|
82
82
|
usage='%prog -U <repository> [options] [<playbook.yml>]',
|
|
83
|
-
desc="pulls playbooks from a VCS repo and executes them
|
|
83
|
+
desc="pulls playbooks from a VCS repo and executes them on target host")
|
|
84
84
|
|
|
85
85
|
# Do not add check_options as there's a conflict with --checkout/-C
|
|
86
86
|
opt_help.add_connect_options(self.parser)
|
|
@@ -23,7 +23,7 @@ from contextlib import contextmanager
|
|
|
23
23
|
|
|
24
24
|
from ansible import constants as C
|
|
25
25
|
from ansible.cli.arguments import option_helpers as opt_help
|
|
26
|
-
from ansible.module_utils.
|
|
26
|
+
from ansible.module_utils.common.text.converters import to_bytes, to_text
|
|
27
27
|
from ansible.module_utils.connection import Connection, ConnectionError, send_data, recv_data
|
|
28
28
|
from ansible.module_utils.service import fork_process
|
|
29
29
|
from ansible.parsing.ajson import AnsibleJSONEncoder, AnsibleJSONDecoder
|
ansible/cli/vault.py
CHANGED
|
@@ -17,7 +17,7 @@ from ansible import constants as C
|
|
|
17
17
|
from ansible import context
|
|
18
18
|
from ansible.cli.arguments import option_helpers as opt_help
|
|
19
19
|
from ansible.errors import AnsibleOptionsError
|
|
20
|
-
from ansible.module_utils.
|
|
20
|
+
from ansible.module_utils.common.text.converters import to_text, to_bytes
|
|
21
21
|
from ansible.parsing.dataloader import DataLoader
|
|
22
22
|
from ansible.parsing.vault import VaultEditor, VaultLib, match_encrypt_secret
|
|
23
23
|
from ansible.utils.display import Display
|
|
@@ -61,20 +61,20 @@ class VaultCLI(CLI):
|
|
|
61
61
|
epilog="\nSee '%s <command> --help' for more information on a specific command.\n\n" % os.path.basename(sys.argv[0])
|
|
62
62
|
)
|
|
63
63
|
|
|
64
|
-
common = opt_help.
|
|
64
|
+
common = opt_help.ArgumentParser(add_help=False)
|
|
65
65
|
opt_help.add_vault_options(common)
|
|
66
66
|
opt_help.add_verbosity_options(common)
|
|
67
67
|
|
|
68
68
|
subparsers = self.parser.add_subparsers(dest='action')
|
|
69
69
|
subparsers.required = True
|
|
70
70
|
|
|
71
|
-
output = opt_help.
|
|
71
|
+
output = opt_help.ArgumentParser(add_help=False)
|
|
72
72
|
output.add_argument('--output', default=None, dest='output_file',
|
|
73
73
|
help='output file name for encrypt or decrypt; use - for stdout',
|
|
74
74
|
type=opt_help.unfrack_path())
|
|
75
75
|
|
|
76
76
|
# For encrypting actions, we can also specify which of multiple vault ids should be used for encrypting
|
|
77
|
-
vault_id = opt_help.
|
|
77
|
+
vault_id = opt_help.ArgumentParser(add_help=False)
|
|
78
78
|
vault_id.add_argument('--encrypt-vault-id', default=[], dest='encrypt_vault_id',
|
|
79
79
|
action='store', type=str,
|
|
80
80
|
help='the vault id used to encrypt (required if more than one vault-id is provided)')
|
|
@@ -82,6 +82,8 @@ class VaultCLI(CLI):
|
|
|
82
82
|
create_parser = subparsers.add_parser('create', help='Create new vault encrypted file', parents=[vault_id, common])
|
|
83
83
|
create_parser.set_defaults(func=self.execute_create)
|
|
84
84
|
create_parser.add_argument('args', help='Filename', metavar='file_name', nargs='*')
|
|
85
|
+
create_parser.add_argument('--skip-tty-check', default=False, help='allows editor to be opened when no tty attached',
|
|
86
|
+
dest='skip_tty_check', action='store_true')
|
|
85
87
|
|
|
86
88
|
decrypt_parser = subparsers.add_parser('decrypt', help='Decrypt vault encrypted file', parents=[output, common])
|
|
87
89
|
decrypt_parser.set_defaults(func=self.execute_decrypt)
|
|
@@ -447,8 +449,11 @@ class VaultCLI(CLI):
|
|
|
447
449
|
if len(context.CLIARGS['args']) != 1:
|
|
448
450
|
raise AnsibleOptionsError("ansible-vault create can take only one filename argument")
|
|
449
451
|
|
|
450
|
-
|
|
451
|
-
|
|
452
|
+
if sys.stdout.isatty() or context.CLIARGS['skip_tty_check']:
|
|
453
|
+
self.editor.create_file(context.CLIARGS['args'][0], self.encrypt_secret,
|
|
454
|
+
vault_id=self.encrypt_vault_id)
|
|
455
|
+
else:
|
|
456
|
+
raise AnsibleOptionsError("not a tty, editor cannot be opened")
|
|
452
457
|
|
|
453
458
|
def execute_edit(self):
|
|
454
459
|
''' open and decrypt an existing vaulted file in an editor, that will be encrypted again when closed'''
|
ansible/collections/__init__.py
CHANGED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# (c) 2019 Ansible Project
|
|
2
|
-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
|
|
3
|
-
|
|
4
|
-
from __future__ import (absolute_import, division, print_function)
|
|
5
|
-
__metaclass__ = type
|
|
6
|
-
|
|
7
|
-
import os
|
|
8
|
-
|
|
9
|
-
from ansible.module_utils._text import to_bytes
|
|
10
|
-
|
|
11
|
-
B_FLAG_FILES = frozenset([b'MANIFEST.json', b'galaxy.yml'])
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def is_collection_path(path):
|
|
15
|
-
"""
|
|
16
|
-
Verify that a path meets min requirements to be a collection
|
|
17
|
-
:param path: byte-string path to evaluate for collection containment
|
|
18
|
-
:return: boolean signifying 'collectionness'
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
is_coll = False
|
|
22
|
-
b_path = to_bytes(path)
|
|
23
|
-
if os.path.isdir(b_path):
|
|
24
|
-
for b_flag in B_FLAG_FILES:
|
|
25
|
-
if os.path.exists(os.path.join(b_path, b_flag)):
|
|
26
|
-
is_coll = True
|
|
27
|
-
break
|
|
28
|
-
|
|
29
|
-
return is_coll
|