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/modules/command.py
CHANGED
|
@@ -14,7 +14,7 @@ module: command
|
|
|
14
14
|
short_description: Execute commands on targets
|
|
15
15
|
version_added: historical
|
|
16
16
|
description:
|
|
17
|
-
- The
|
|
17
|
+
- The M(ansible.builtin.command) module takes the command name followed by a list of space-delimited arguments.
|
|
18
18
|
- The given command will be executed on all selected nodes.
|
|
19
19
|
- The command(s) will not be
|
|
20
20
|
processed through the shell, so variables like C($HOSTNAME) and operations
|
|
@@ -22,15 +22,15 @@ description:
|
|
|
22
22
|
Use the M(ansible.builtin.shell) module if you need these features.
|
|
23
23
|
- To create C(command) tasks that are easier to read than the ones using space-delimited
|
|
24
24
|
arguments, pass parameters using the C(args) L(task keyword,https://docs.ansible.com/ansible/latest/reference_appendices/playbooks_keywords.html#task)
|
|
25
|
-
or use
|
|
26
|
-
- Either a free form command or
|
|
25
|
+
or use O(cmd) parameter.
|
|
26
|
+
- Either a free form command or O(cmd) parameter is required, see the examples.
|
|
27
27
|
- For Windows targets, use the M(ansible.windows.win_command) module instead.
|
|
28
28
|
extends_documentation_fragment:
|
|
29
29
|
- action_common_attributes
|
|
30
30
|
- action_common_attributes.raw
|
|
31
31
|
attributes:
|
|
32
32
|
check_mode:
|
|
33
|
-
details: while the command itself is arbitrary and cannot be subject to the check mode semantics it adds
|
|
33
|
+
details: while the command itself is arbitrary and cannot be subject to the check mode semantics it adds O(creates)/O(removes) options as a workaround
|
|
34
34
|
support: partial
|
|
35
35
|
diff_mode:
|
|
36
36
|
support: none
|
|
@@ -40,6 +40,14 @@ attributes:
|
|
|
40
40
|
raw:
|
|
41
41
|
support: full
|
|
42
42
|
options:
|
|
43
|
+
expand_argument_vars:
|
|
44
|
+
description:
|
|
45
|
+
- Expands the arguments that are variables, for example C($HOME) will be expanded before being passed to the
|
|
46
|
+
command to run.
|
|
47
|
+
- Set to V(false) to disable expansion and treat the value as a literal argument.
|
|
48
|
+
type: bool
|
|
49
|
+
default: true
|
|
50
|
+
version_added: "2.16"
|
|
43
51
|
free_form:
|
|
44
52
|
description:
|
|
45
53
|
- The command module takes a free form string as a command to run.
|
|
@@ -53,19 +61,19 @@ options:
|
|
|
53
61
|
elements: str
|
|
54
62
|
description:
|
|
55
63
|
- Passes the command as a list rather than a string.
|
|
56
|
-
- Use
|
|
64
|
+
- Use O(argv) to avoid quoting values that would otherwise be interpreted incorrectly (for example "user name").
|
|
57
65
|
- Only the string (free form) or the list (argv) form can be provided, not both. One or the other must be provided.
|
|
58
66
|
version_added: "2.6"
|
|
59
67
|
creates:
|
|
60
68
|
type: path
|
|
61
69
|
description:
|
|
62
70
|
- A filename or (since 2.0) glob pattern. If a matching file already exists, this step B(will not) be run.
|
|
63
|
-
- This is checked before
|
|
71
|
+
- This is checked before O(removes) is checked.
|
|
64
72
|
removes:
|
|
65
73
|
type: path
|
|
66
74
|
description:
|
|
67
75
|
- A filename or (since 2.0) glob pattern. If a matching file exists, this step B(will) be run.
|
|
68
|
-
- This is checked after
|
|
76
|
+
- This is checked after O(creates) is checked.
|
|
69
77
|
version_added: "0.8"
|
|
70
78
|
chdir:
|
|
71
79
|
type: path
|
|
@@ -81,7 +89,7 @@ options:
|
|
|
81
89
|
type: bool
|
|
82
90
|
default: yes
|
|
83
91
|
description:
|
|
84
|
-
- If set to
|
|
92
|
+
- If set to V(true), append a newline to stdin data.
|
|
85
93
|
version_added: "2.8"
|
|
86
94
|
strip_empty_ends:
|
|
87
95
|
description:
|
|
@@ -93,12 +101,12 @@ notes:
|
|
|
93
101
|
- If you want to run a command through the shell (say you are using C(<), C(>), C(|), and so on),
|
|
94
102
|
you actually want the M(ansible.builtin.shell) module instead.
|
|
95
103
|
Parsing shell metacharacters can lead to unexpected commands being executed if quoting is not done correctly so it is more secure to
|
|
96
|
-
use the
|
|
97
|
-
-
|
|
104
|
+
use the M(ansible.builtin.command) module when possible.
|
|
105
|
+
- O(creates), O(removes), and O(chdir) can be specified after the command.
|
|
98
106
|
For instance, if you only want to run a command if a certain file does not exist, use this.
|
|
99
|
-
- Check mode is supported when passing
|
|
107
|
+
- Check mode is supported when passing O(creates) or O(removes). If running in check mode and either of these are specified, the module will
|
|
100
108
|
check for the existence of the file and report the correct changed status. If these are not supplied, the task will be skipped.
|
|
101
|
-
- The
|
|
109
|
+
- The O(ignore:executable) parameter is removed since version 2.4. If you have a need for this parameter, use the M(ansible.builtin.shell) module instead.
|
|
102
110
|
- For Windows targets, use the M(ansible.windows.win_command) module instead.
|
|
103
111
|
- For rebooting systems, use the M(ansible.builtin.reboot) or M(ansible.windows.win_reboot) module.
|
|
104
112
|
- If the command returns non UTF-8 data, it must be encoded to avoid issues. This may necessitate using M(ansible.builtin.shell) so the output
|
|
@@ -153,6 +161,17 @@ EXAMPLES = r'''
|
|
|
153
161
|
- dbname with whitespace
|
|
154
162
|
creates: /path/to/database
|
|
155
163
|
|
|
164
|
+
- name: Run command using argv with mixed argument formats
|
|
165
|
+
ansible.builtin.command:
|
|
166
|
+
argv:
|
|
167
|
+
- /path/to/binary
|
|
168
|
+
- -v
|
|
169
|
+
- --debug
|
|
170
|
+
- --longopt
|
|
171
|
+
- value for longopt
|
|
172
|
+
- --other-longopt=value for other longopt
|
|
173
|
+
- positional
|
|
174
|
+
|
|
156
175
|
- name: Safely use templated variable to run command. Always use the quote filter to avoid injection issues
|
|
157
176
|
ansible.builtin.command: cat {{ myfile|quote }}
|
|
158
177
|
register: myoutput
|
|
@@ -219,7 +238,7 @@ import os
|
|
|
219
238
|
import shlex
|
|
220
239
|
|
|
221
240
|
from ansible.module_utils.basic import AnsibleModule
|
|
222
|
-
from ansible.module_utils.
|
|
241
|
+
from ansible.module_utils.common.text.converters import to_native, to_bytes, to_text
|
|
223
242
|
from ansible.module_utils.common.collections import is_iterable
|
|
224
243
|
|
|
225
244
|
|
|
@@ -235,6 +254,7 @@ def main():
|
|
|
235
254
|
argv=dict(type='list', elements='str'),
|
|
236
255
|
chdir=dict(type='path'),
|
|
237
256
|
executable=dict(),
|
|
257
|
+
expand_argument_vars=dict(type='bool', default=True),
|
|
238
258
|
creates=dict(type='path'),
|
|
239
259
|
removes=dict(type='path'),
|
|
240
260
|
# The default for this really comes from the action plugin
|
|
@@ -254,8 +274,9 @@ def main():
|
|
|
254
274
|
stdin = module.params['stdin']
|
|
255
275
|
stdin_add_newline = module.params['stdin_add_newline']
|
|
256
276
|
strip = module.params['strip_empty_ends']
|
|
277
|
+
expand_argument_vars = module.params['expand_argument_vars']
|
|
257
278
|
|
|
258
|
-
# we
|
|
279
|
+
# we promised these in 'always' ( _lines get auto-added on action plugin)
|
|
259
280
|
r = {'changed': False, 'stdout': '', 'stderr': '', 'rc': None, 'cmd': None, 'start': None, 'end': None, 'delta': None, 'msg': ''}
|
|
260
281
|
|
|
261
282
|
if not shell and executable:
|
|
@@ -321,7 +342,8 @@ def main():
|
|
|
321
342
|
if not module.check_mode:
|
|
322
343
|
r['start'] = datetime.datetime.now()
|
|
323
344
|
r['rc'], r['stdout'], r['stderr'] = module.run_command(args, executable=executable, use_unsafe_shell=shell, encoding=None,
|
|
324
|
-
data=stdin, binary_data=(not stdin_add_newline)
|
|
345
|
+
data=stdin, binary_data=(not stdin_add_newline),
|
|
346
|
+
expand_user_and_vars=expand_argument_vars)
|
|
325
347
|
r['end'] = datetime.datetime.now()
|
|
326
348
|
else:
|
|
327
349
|
# this is partial check_mode support, since we end up skipping if we get here
|
ansible/modules/copy.py
CHANGED
|
@@ -14,10 +14,14 @@ module: copy
|
|
|
14
14
|
version_added: historical
|
|
15
15
|
short_description: Copy files to remote locations
|
|
16
16
|
description:
|
|
17
|
-
- The
|
|
17
|
+
- The M(ansible.builtin.copy) module copies a file or a directory structure from the local or remote machine to a location on the remote machine.
|
|
18
|
+
File system meta-information (permissions, ownership, etc.) may be set, even when the file or directory already exists on the target system.
|
|
19
|
+
Some meta-information may be copied on request.
|
|
20
|
+
- Get meta-information with the M(ansible.builtin.stat) module.
|
|
21
|
+
- Set meta-information with the M(ansible.builtin.file) module.
|
|
18
22
|
- Use the M(ansible.builtin.fetch) module to copy files from remote locations to the local box.
|
|
19
23
|
- If you need variable interpolation in copied files, use the M(ansible.builtin.template) module.
|
|
20
|
-
Using a variable
|
|
24
|
+
Using a variable with the O(content) parameter produces unpredictable results.
|
|
21
25
|
- For Windows targets, use the M(ansible.windows.win_copy) module instead.
|
|
22
26
|
options:
|
|
23
27
|
src:
|
|
@@ -31,19 +35,19 @@ options:
|
|
|
31
35
|
type: path
|
|
32
36
|
content:
|
|
33
37
|
description:
|
|
34
|
-
- When used instead of
|
|
35
|
-
- Works only when
|
|
36
|
-
- For advanced formatting or if
|
|
38
|
+
- When used instead of O(src), sets the contents of a file directly to the specified value.
|
|
39
|
+
- Works only when O(dest) is a file. Creates the file if it does not exist.
|
|
40
|
+
- For advanced formatting or if O(content) contains a variable, use the
|
|
37
41
|
M(ansible.builtin.template) module.
|
|
38
42
|
type: str
|
|
39
43
|
version_added: '1.1'
|
|
40
44
|
dest:
|
|
41
45
|
description:
|
|
42
46
|
- Remote absolute path where the file should be copied to.
|
|
43
|
-
- If
|
|
44
|
-
- If
|
|
45
|
-
- If
|
|
46
|
-
- If
|
|
47
|
+
- If O(src) is a directory, this must be a directory too.
|
|
48
|
+
- If O(dest) is a non-existent path and if either O(dest) ends with "/" or O(src) is a directory, O(dest) is created.
|
|
49
|
+
- If O(dest) is a relative path, the starting directory is determined by the remote host.
|
|
50
|
+
- If O(src) and O(dest) are files, the parent directory of O(dest) is not created and the task fails if it does not already exist.
|
|
47
51
|
type: path
|
|
48
52
|
required: yes
|
|
49
53
|
backup:
|
|
@@ -55,8 +59,8 @@ options:
|
|
|
55
59
|
force:
|
|
56
60
|
description:
|
|
57
61
|
- Influence whether the remote file must always be replaced.
|
|
58
|
-
- If
|
|
59
|
-
- If
|
|
62
|
+
- If V(true), the remote file will be replaced when contents are different than the source.
|
|
63
|
+
- If V(false), the file will only be transferred if the destination does not exist.
|
|
60
64
|
type: bool
|
|
61
65
|
default: yes
|
|
62
66
|
version_added: '1.1'
|
|
@@ -65,33 +69,34 @@ options:
|
|
|
65
69
|
- The permissions of the destination file or directory.
|
|
66
70
|
- For those used to C(/usr/bin/chmod) remember that modes are actually octal numbers.
|
|
67
71
|
You must either add a leading zero so that Ansible's YAML parser knows it is an octal number
|
|
68
|
-
(like
|
|
72
|
+
(like V(0644) or V(01777)) or quote it (like V('644') or V('1777')) so Ansible receives a string
|
|
69
73
|
and can do its own conversion from string into number. Giving Ansible a number without following
|
|
70
74
|
one of these rules will end up with a decimal number which will have unexpected results.
|
|
71
|
-
- As of Ansible 1.8, the mode may be specified as a symbolic mode (for example,
|
|
72
|
-
- As of Ansible 2.3, the mode may also be the special string
|
|
73
|
-
-
|
|
74
|
-
- When doing a recursive copy, see also
|
|
75
|
-
- If
|
|
75
|
+
- As of Ansible 1.8, the mode may be specified as a symbolic mode (for example, V(u+rwx) or V(u=rw,g=r,o=r)).
|
|
76
|
+
- As of Ansible 2.3, the mode may also be the special string V(preserve).
|
|
77
|
+
- V(preserve) means that the file will be given the same permissions as the source file.
|
|
78
|
+
- When doing a recursive copy, see also O(directory_mode).
|
|
79
|
+
- If O(mode) is not specified and the destination file B(does not) exist, the default C(umask) on the system will be used
|
|
76
80
|
when setting the mode for the newly created file.
|
|
77
|
-
- If
|
|
78
|
-
- Specifying
|
|
81
|
+
- If O(mode) is not specified and the destination file B(does) exist, the mode of the existing file will be used.
|
|
82
|
+
- Specifying O(mode) is the best way to ensure files are created with the correct permissions.
|
|
79
83
|
See CVE-2020-1736 for further details.
|
|
80
84
|
directory_mode:
|
|
81
85
|
description:
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
-
|
|
86
|
+
- Set the access permissions of newly created directories to the given mode.
|
|
87
|
+
Permissions on existing directories do not change.
|
|
88
|
+
- See O(mode) for the syntax of accepted values.
|
|
89
|
+
- The target system's defaults determine permissions when this parameter is not set.
|
|
85
90
|
type: raw
|
|
86
91
|
version_added: '1.5'
|
|
87
92
|
remote_src:
|
|
88
93
|
description:
|
|
89
|
-
- Influence whether
|
|
90
|
-
- If
|
|
91
|
-
- If
|
|
92
|
-
-
|
|
93
|
-
-
|
|
94
|
-
- Autodecryption of files does not work when
|
|
94
|
+
- Influence whether O(src) needs to be transferred or already is present remotely.
|
|
95
|
+
- If V(false), it will search for O(src) on the controller node.
|
|
96
|
+
- If V(true) it will search for O(src) on the managed (remote) node.
|
|
97
|
+
- O(remote_src) supports recursive copying as of version 2.8.
|
|
98
|
+
- O(remote_src) only works with O(mode=preserve) as of version 2.6.
|
|
99
|
+
- Autodecryption of files does not work when O(remote_src=yes).
|
|
95
100
|
type: bool
|
|
96
101
|
default: no
|
|
97
102
|
version_added: '2.0'
|
|
@@ -293,7 +298,7 @@ import stat
|
|
|
293
298
|
import tempfile
|
|
294
299
|
import traceback
|
|
295
300
|
|
|
296
|
-
from ansible.module_utils.
|
|
301
|
+
from ansible.module_utils.common.text.converters import to_bytes, to_native
|
|
297
302
|
from ansible.module_utils.basic import AnsibleModule
|
|
298
303
|
from ansible.module_utils.common.process import get_bin_path
|
|
299
304
|
from ansible.module_utils.common.locale import get_best_parsable_locale
|
|
@@ -689,7 +694,7 @@ def main():
|
|
|
689
694
|
b_mysrc = b_src
|
|
690
695
|
if remote_src and os.path.isfile(b_src):
|
|
691
696
|
|
|
692
|
-
|
|
697
|
+
dummy, b_mysrc = tempfile.mkstemp(dir=os.path.dirname(b_dest))
|
|
693
698
|
|
|
694
699
|
shutil.copyfile(b_src, b_mysrc)
|
|
695
700
|
try:
|
ansible/modules/cron.py
CHANGED
|
@@ -44,7 +44,7 @@ options:
|
|
|
44
44
|
description:
|
|
45
45
|
- The command to execute or, if env is set, the value of environment variable.
|
|
46
46
|
- The command should not contain line breaks.
|
|
47
|
-
- Required if
|
|
47
|
+
- Required if O(state=present).
|
|
48
48
|
type: str
|
|
49
49
|
aliases: [ value ]
|
|
50
50
|
state:
|
|
@@ -58,42 +58,42 @@ options:
|
|
|
58
58
|
- If specified, uses this file instead of an individual user's crontab.
|
|
59
59
|
The assumption is that this file is exclusively managed by the module,
|
|
60
60
|
do not use if the file contains multiple entries, NEVER use for /etc/crontab.
|
|
61
|
-
- If this is a relative path, it is interpreted with respect to
|
|
61
|
+
- If this is a relative path, it is interpreted with respect to C(/etc/cron.d).
|
|
62
62
|
- Many linux distros expect (and some require) the filename portion to consist solely
|
|
63
63
|
of upper- and lower-case letters, digits, underscores, and hyphens.
|
|
64
|
-
- Using this parameter requires you to specify the
|
|
65
|
-
- Either this parameter or
|
|
64
|
+
- Using this parameter requires you to specify the O(user) as well, unless O(state) is not V(present).
|
|
65
|
+
- Either this parameter or O(name) is required
|
|
66
66
|
type: path
|
|
67
67
|
backup:
|
|
68
68
|
description:
|
|
69
69
|
- If set, create a backup of the crontab before it is modified.
|
|
70
|
-
The location of the backup is returned in the
|
|
70
|
+
The location of the backup is returned in the RV(ignore:backup_file) variable by this module.
|
|
71
71
|
type: bool
|
|
72
72
|
default: no
|
|
73
73
|
minute:
|
|
74
74
|
description:
|
|
75
|
-
- Minute when the job should run (
|
|
75
|
+
- Minute when the job should run (V(0-59), V(*), V(*/2), and so on).
|
|
76
76
|
type: str
|
|
77
77
|
default: "*"
|
|
78
78
|
hour:
|
|
79
79
|
description:
|
|
80
|
-
- Hour when the job should run (
|
|
80
|
+
- Hour when the job should run (V(0-23), V(*), V(*/2), and so on).
|
|
81
81
|
type: str
|
|
82
82
|
default: "*"
|
|
83
83
|
day:
|
|
84
84
|
description:
|
|
85
|
-
- Day of the month the job should run (
|
|
85
|
+
- Day of the month the job should run (V(1-31), V(*), V(*/2), and so on).
|
|
86
86
|
type: str
|
|
87
87
|
default: "*"
|
|
88
88
|
aliases: [ dom ]
|
|
89
89
|
month:
|
|
90
90
|
description:
|
|
91
|
-
- Month of the year the job should run (
|
|
91
|
+
- Month of the year the job should run (V(1-12), V(*), V(*/2), and so on).
|
|
92
92
|
type: str
|
|
93
93
|
default: "*"
|
|
94
94
|
weekday:
|
|
95
95
|
description:
|
|
96
|
-
- Day of the week that the job should run (
|
|
96
|
+
- Day of the week that the job should run (V(0-6) for Sunday-Saturday, V(*), and so on).
|
|
97
97
|
type: str
|
|
98
98
|
default: "*"
|
|
99
99
|
aliases: [ dow ]
|
|
@@ -106,7 +106,7 @@ options:
|
|
|
106
106
|
disabled:
|
|
107
107
|
description:
|
|
108
108
|
- If the job should be disabled (commented out) in the crontab.
|
|
109
|
-
- Only has effect if
|
|
109
|
+
- Only has effect if O(state=present).
|
|
110
110
|
type: bool
|
|
111
111
|
default: no
|
|
112
112
|
version_added: "2.0"
|
|
@@ -114,19 +114,19 @@ options:
|
|
|
114
114
|
description:
|
|
115
115
|
- If set, manages a crontab's environment variable.
|
|
116
116
|
- New variables are added on top of crontab.
|
|
117
|
-
-
|
|
117
|
+
- O(name) and O(value) parameters are the name and the value of environment variable.
|
|
118
118
|
type: bool
|
|
119
119
|
default: false
|
|
120
120
|
version_added: "2.1"
|
|
121
121
|
insertafter:
|
|
122
122
|
description:
|
|
123
|
-
- Used with
|
|
123
|
+
- Used with O(state=present) and O(env).
|
|
124
124
|
- If specified, the environment variable will be inserted after the declaration of specified environment variable.
|
|
125
125
|
type: str
|
|
126
126
|
version_added: "2.1"
|
|
127
127
|
insertbefore:
|
|
128
128
|
description:
|
|
129
|
-
- Used with
|
|
129
|
+
- Used with O(state=present) and O(env).
|
|
130
130
|
- If specified, the environment variable will be inserted before the declaration of specified environment variable.
|
|
131
131
|
type: str
|
|
132
132
|
version_added: "2.1"
|
|
@@ -97,7 +97,7 @@ options:
|
|
|
97
97
|
- >-
|
|
98
98
|
Suite can specify an exact path in relation to the URI(s) provided,
|
|
99
99
|
in which case the Components: must be omitted and suite must end
|
|
100
|
-
with a slash C(
|
|
100
|
+
with a slash (C(/)). Alternatively, it may take the form of a
|
|
101
101
|
distribution version (e.g. a version codename like disco or artful).
|
|
102
102
|
If the suite does not specify a path, at least one component must
|
|
103
103
|
be present.
|
|
@@ -124,7 +124,7 @@ options:
|
|
|
124
124
|
elements: str
|
|
125
125
|
description:
|
|
126
126
|
- Which types of packages to look for from a given source; either
|
|
127
|
-
binary
|
|
127
|
+
binary V(deb) or source code V(deb-src)
|
|
128
128
|
uris:
|
|
129
129
|
description:
|
|
130
130
|
- The URIs must specify the base of the Debian distribution archive,
|
|
@@ -242,6 +242,7 @@ from ansible.module_utils.common.text.converters import to_native
|
|
|
242
242
|
from ansible.module_utils.six import raise_from # type: ignore[attr-defined]
|
|
243
243
|
from ansible.module_utils.urls import generic_urlparse
|
|
244
244
|
from ansible.module_utils.urls import open_url
|
|
245
|
+
from ansible.module_utils.urls import get_user_agent
|
|
245
246
|
from ansible.module_utils.urls import urlparse
|
|
246
247
|
|
|
247
248
|
HAS_DEBIAN = True
|
|
@@ -325,7 +326,7 @@ def write_signed_by_key(module, v, slug):
|
|
|
325
326
|
parts = generic_urlparse(urlparse(v))
|
|
326
327
|
if parts.scheme:
|
|
327
328
|
try:
|
|
328
|
-
r = open_url(v, http_agent=
|
|
329
|
+
r = open_url(v, http_agent=get_user_agent())
|
|
329
330
|
except Exception as exc:
|
|
330
331
|
raise_from(RuntimeError(to_native(exc)), exc)
|
|
331
332
|
else:
|
ansible/modules/debconf.py
CHANGED
|
@@ -27,13 +27,13 @@ attributes:
|
|
|
27
27
|
platforms: debian
|
|
28
28
|
notes:
|
|
29
29
|
- This module requires the command line debconf tools.
|
|
30
|
-
-
|
|
30
|
+
- Several questions have to be answered (depending on the package).
|
|
31
31
|
Use 'debconf-show <package>' on any Debian or derivative with the package
|
|
32
32
|
installed to see questions/settings available.
|
|
33
33
|
- Some distros will always record tasks involving the setting of passwords as changed. This is due to debconf-get-selections masking passwords.
|
|
34
|
-
- It is highly recommended to add
|
|
34
|
+
- It is highly recommended to add C(no_log=True) to the task while handling sensitive information using this module.
|
|
35
35
|
- The debconf module does not reconfigure packages, it just updates the debconf database.
|
|
36
|
-
An additional step is needed (typically with
|
|
36
|
+
An additional step is needed (typically with C(notify) if debconf makes a change)
|
|
37
37
|
to reconfigure the package and apply the changes.
|
|
38
38
|
debconf is extensively used for pre-seeding configuration prior to installation
|
|
39
39
|
rather than modifying configurations.
|
|
@@ -46,7 +46,7 @@ notes:
|
|
|
46
46
|
- The main issue is that the C(<package>.config reconfigure) step for many packages
|
|
47
47
|
will first reset the debconf database (overriding changes made by this module) by
|
|
48
48
|
checking the on-disk configuration. If this is the case for your package then
|
|
49
|
-
dpkg-reconfigure will effectively ignore changes
|
|
49
|
+
dpkg-reconfigure will effectively ignore changes made by debconf.
|
|
50
50
|
- However as dpkg-reconfigure only executes the C(<package>.config) step if the file
|
|
51
51
|
exists, it is possible to rename it to C(/var/lib/dpkg/info/<package>.config.ignore)
|
|
52
52
|
before executing C(dpkg-reconfigure -f noninteractive <package>) and then restore it.
|
|
@@ -69,8 +69,8 @@ options:
|
|
|
69
69
|
vtype:
|
|
70
70
|
description:
|
|
71
71
|
- The type of the value supplied.
|
|
72
|
-
- It is highly recommended to add
|
|
73
|
-
-
|
|
72
|
+
- It is highly recommended to add C(no_log=True) to task while specifying O(vtype=password).
|
|
73
|
+
- V(seen) was added in Ansible 2.2.
|
|
74
74
|
type: str
|
|
75
75
|
choices: [ boolean, error, multiselect, note, password, seen, select, string, text, title ]
|
|
76
76
|
value:
|
|
@@ -124,10 +124,32 @@ EXAMPLES = r'''
|
|
|
124
124
|
|
|
125
125
|
RETURN = r'''#'''
|
|
126
126
|
|
|
127
|
-
from ansible.module_utils.
|
|
127
|
+
from ansible.module_utils.common.text.converters import to_text
|
|
128
128
|
from ansible.module_utils.basic import AnsibleModule
|
|
129
129
|
|
|
130
130
|
|
|
131
|
+
def get_password_value(module, pkg, question, vtype):
|
|
132
|
+
getsel = module.get_bin_path('debconf-get-selections', True)
|
|
133
|
+
cmd = [getsel]
|
|
134
|
+
rc, out, err = module.run_command(cmd)
|
|
135
|
+
if rc != 0:
|
|
136
|
+
module.fail_json(msg="Failed to get the value '%s' from '%s'" % (question, pkg))
|
|
137
|
+
|
|
138
|
+
desired_line = None
|
|
139
|
+
for line in out.split("\n"):
|
|
140
|
+
if line.startswith(pkg):
|
|
141
|
+
desired_line = line
|
|
142
|
+
break
|
|
143
|
+
|
|
144
|
+
if not desired_line:
|
|
145
|
+
module.fail_json(msg="Failed to find the value '%s' from '%s'" % (question, pkg))
|
|
146
|
+
|
|
147
|
+
(dpkg, dquestion, dvtype, dvalue) = desired_line.split()
|
|
148
|
+
if dquestion == question and dvtype == vtype:
|
|
149
|
+
return dvalue
|
|
150
|
+
return ''
|
|
151
|
+
|
|
152
|
+
|
|
131
153
|
def get_selections(module, pkg):
|
|
132
154
|
cmd = [module.get_bin_path('debconf-show', True), pkg]
|
|
133
155
|
rc, out, err = module.run_command(' '.join(cmd))
|
|
@@ -151,10 +173,7 @@ def set_selection(module, pkg, question, vtype, value, unseen):
|
|
|
151
173
|
cmd.append('-u')
|
|
152
174
|
|
|
153
175
|
if vtype == 'boolean':
|
|
154
|
-
|
|
155
|
-
value = 'true'
|
|
156
|
-
elif value == 'False':
|
|
157
|
-
value = 'false'
|
|
176
|
+
value = value.lower()
|
|
158
177
|
data = ' '.join([pkg, question, vtype, value])
|
|
159
178
|
|
|
160
179
|
return module.run_command(cmd, data=data)
|
|
@@ -193,7 +212,6 @@ def main():
|
|
|
193
212
|
if question not in prev:
|
|
194
213
|
changed = True
|
|
195
214
|
else:
|
|
196
|
-
|
|
197
215
|
existing = prev[question]
|
|
198
216
|
|
|
199
217
|
# ensure we compare booleans supplied to the way debconf sees them (true/false strings)
|
|
@@ -201,6 +219,9 @@ def main():
|
|
|
201
219
|
value = to_text(value).lower()
|
|
202
220
|
existing = to_text(prev[question]).lower()
|
|
203
221
|
|
|
222
|
+
if vtype == 'password':
|
|
223
|
+
existing = get_password_value(module, pkg, question, vtype)
|
|
224
|
+
|
|
204
225
|
if value != existing:
|
|
205
226
|
changed = True
|
|
206
227
|
|
|
@@ -215,12 +236,12 @@ def main():
|
|
|
215
236
|
prev = {question: prev[question]}
|
|
216
237
|
else:
|
|
217
238
|
prev[question] = ''
|
|
239
|
+
|
|
240
|
+
diff_dict = {}
|
|
218
241
|
if module._diff:
|
|
219
242
|
after = prev.copy()
|
|
220
243
|
after.update(curr)
|
|
221
244
|
diff_dict = {'before': prev, 'after': after}
|
|
222
|
-
else:
|
|
223
|
-
diff_dict = {}
|
|
224
245
|
|
|
225
246
|
module.exit_json(changed=changed, msg=msg, current=curr, previous=prev, diff=diff_dict)
|
|
226
247
|
|
ansible/modules/debug.py
CHANGED
|
@@ -27,7 +27,7 @@ options:
|
|
|
27
27
|
var:
|
|
28
28
|
description:
|
|
29
29
|
- A variable name to debug.
|
|
30
|
-
- Mutually exclusive with the
|
|
30
|
+
- Mutually exclusive with the O(msg) option.
|
|
31
31
|
- Be aware that this option already runs in Jinja2 context and has an implicit C({{ }}) wrapping,
|
|
32
32
|
so you should not be using Jinja2 delimiters unless you are looking for double interpolation.
|
|
33
33
|
type: str
|