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/replace.py
CHANGED
|
@@ -39,7 +39,7 @@ options:
|
|
|
39
39
|
path:
|
|
40
40
|
description:
|
|
41
41
|
- The file to modify.
|
|
42
|
-
- Before Ansible 2.3 this option was only usable as
|
|
42
|
+
- Before Ansible 2.3 this option was only usable as O(dest), O(destfile) and O(name).
|
|
43
43
|
type: path
|
|
44
44
|
required: true
|
|
45
45
|
aliases: [ dest, destfile, name ]
|
|
@@ -48,13 +48,13 @@ options:
|
|
|
48
48
|
- The regular expression to look for in the contents of the file.
|
|
49
49
|
- Uses Python regular expressions; see
|
|
50
50
|
U(https://docs.python.org/3/library/re.html).
|
|
51
|
-
- Uses MULTILINE mode, which means
|
|
51
|
+
- Uses MULTILINE mode, which means V(^) and V($) match the beginning
|
|
52
52
|
and end of the file, as well as the beginning and end respectively
|
|
53
53
|
of I(each line) of the file.
|
|
54
|
-
- Does not use DOTALL, which means the
|
|
54
|
+
- Does not use DOTALL, which means the V(.) special character matches
|
|
55
55
|
any character I(except newlines). A common mistake is to assume that
|
|
56
|
-
a negated character set like
|
|
57
|
-
- In order to exclude newlines, they must be added to the set like
|
|
56
|
+
a negated character set like V([^#]) will also not match newlines.
|
|
57
|
+
- In order to exclude newlines, they must be added to the set like V([^#\\n]).
|
|
58
58
|
- Note that, as of Ansible 2.0, short form tasks should have any escape
|
|
59
59
|
sequences backslash-escaped in order to prevent them being parsed
|
|
60
60
|
as string literal escapes. See the examples.
|
|
@@ -65,25 +65,25 @@ options:
|
|
|
65
65
|
- The string to replace regexp matches.
|
|
66
66
|
- May contain backreferences that will get expanded with the regexp capture groups if the regexp matches.
|
|
67
67
|
- If not set, matches are removed entirely.
|
|
68
|
-
- Backreferences can be used ambiguously like
|
|
68
|
+
- Backreferences can be used ambiguously like V(\\1), or explicitly like V(\\g<1>).
|
|
69
69
|
type: str
|
|
70
70
|
default: ''
|
|
71
71
|
after:
|
|
72
72
|
description:
|
|
73
73
|
- If specified, only content after this match will be replaced/removed.
|
|
74
|
-
- Can be used in combination with
|
|
74
|
+
- Can be used in combination with O(before).
|
|
75
75
|
- Uses Python regular expressions; see
|
|
76
76
|
U(https://docs.python.org/3/library/re.html).
|
|
77
|
-
- Uses DOTALL, which means the
|
|
77
|
+
- Uses DOTALL, which means the V(.) special character I(can match newlines).
|
|
78
78
|
type: str
|
|
79
79
|
version_added: "2.4"
|
|
80
80
|
before:
|
|
81
81
|
description:
|
|
82
82
|
- If specified, only content before this match will be replaced/removed.
|
|
83
|
-
- Can be used in combination with
|
|
83
|
+
- Can be used in combination with O(after).
|
|
84
84
|
- Uses Python regular expressions; see
|
|
85
85
|
U(https://docs.python.org/3/library/re.html).
|
|
86
|
-
- Uses DOTALL, which means the
|
|
86
|
+
- Uses DOTALL, which means the V(.) special character I(can match newlines).
|
|
87
87
|
type: str
|
|
88
88
|
version_added: "2.4"
|
|
89
89
|
backup:
|
|
@@ -103,11 +103,12 @@ options:
|
|
|
103
103
|
default: utf-8
|
|
104
104
|
version_added: "2.4"
|
|
105
105
|
notes:
|
|
106
|
-
- As of Ansible 2.3, the
|
|
107
|
-
- As of Ansible 2.7.10, the combined use of
|
|
106
|
+
- As of Ansible 2.3, the O(dest) option has been changed to O(path) as default, but O(dest) still works as well.
|
|
107
|
+
- As of Ansible 2.7.10, the combined use of O(before) and O(after) works properly. If you were relying on the
|
|
108
108
|
previous incorrect behavior, you may be need to adjust your tasks.
|
|
109
109
|
See U(https://github.com/ansible/ansible/issues/31354) for details.
|
|
110
|
-
- Option
|
|
110
|
+
- Option O(ignore:follow) has been removed in Ansible 2.5, because this module modifies the contents of the file
|
|
111
|
+
so O(ignore:follow=no) does not make sense.
|
|
111
112
|
'''
|
|
112
113
|
|
|
113
114
|
EXAMPLES = r'''
|
|
@@ -185,7 +186,7 @@ import re
|
|
|
185
186
|
import tempfile
|
|
186
187
|
from traceback import format_exc
|
|
187
188
|
|
|
188
|
-
from ansible.module_utils.
|
|
189
|
+
from ansible.module_utils.common.text.converters import to_text, to_bytes
|
|
189
190
|
from ansible.module_utils.basic import AnsibleModule
|
|
190
191
|
|
|
191
192
|
|
|
@@ -284,7 +285,11 @@ def main():
|
|
|
284
285
|
section = contents
|
|
285
286
|
|
|
286
287
|
mre = re.compile(params['regexp'], re.MULTILINE)
|
|
287
|
-
|
|
288
|
+
try:
|
|
289
|
+
result = re.subn(mre, params['replace'], section, 0)
|
|
290
|
+
except re.error as e:
|
|
291
|
+
module.fail_json(msg="Unable to process replace due to error: %s" % to_text(e),
|
|
292
|
+
exception=format_exc())
|
|
288
293
|
|
|
289
294
|
if result[1] > 0 and section != result[0]:
|
|
290
295
|
if pattern:
|
ansible/modules/rpm_key.py
CHANGED
|
@@ -33,7 +33,7 @@ options:
|
|
|
33
33
|
choices: [ absent, present ]
|
|
34
34
|
validate_certs:
|
|
35
35
|
description:
|
|
36
|
-
- If
|
|
36
|
+
- If V(false) and the O(key) is a url starting with V(https), SSL certificates will not be validated.
|
|
37
37
|
- This should only be used on personally controlled sites using self-signed certificates.
|
|
38
38
|
type: bool
|
|
39
39
|
default: 'yes'
|
|
@@ -85,7 +85,7 @@ import tempfile
|
|
|
85
85
|
# import module snippets
|
|
86
86
|
from ansible.module_utils.basic import AnsibleModule
|
|
87
87
|
from ansible.module_utils.urls import fetch_url
|
|
88
|
-
from ansible.module_utils.
|
|
88
|
+
from ansible.module_utils.common.text.converters import to_native
|
|
89
89
|
|
|
90
90
|
|
|
91
91
|
def is_pubkey(string):
|
ansible/modules/script.py
CHANGED
|
@@ -11,16 +11,17 @@ module: script
|
|
|
11
11
|
version_added: "0.9"
|
|
12
12
|
short_description: Runs a local script on a remote node after transferring it
|
|
13
13
|
description:
|
|
14
|
-
- The
|
|
15
|
-
- Either a free
|
|
16
|
-
- The local script at path will be transferred to the remote node and then executed.
|
|
14
|
+
- The M(ansible.builtin.script) module takes the script name followed by a list of space-delimited arguments.
|
|
15
|
+
- Either a free-form command or O(cmd) parameter is required, see the examples.
|
|
16
|
+
- The local script at the path will be transferred to the remote node and then executed.
|
|
17
17
|
- The given script will be processed through the shell environment on the remote node.
|
|
18
|
-
- This module does not require
|
|
18
|
+
- This module does not require Python on the remote system, much like the M(ansible.builtin.raw) module.
|
|
19
19
|
- This module is also supported for Windows targets.
|
|
20
20
|
options:
|
|
21
21
|
free_form:
|
|
22
22
|
description:
|
|
23
23
|
- Path to the local script file followed by optional arguments.
|
|
24
|
+
type: str
|
|
24
25
|
cmd:
|
|
25
26
|
type: str
|
|
26
27
|
description:
|
|
@@ -29,25 +30,30 @@ options:
|
|
|
29
30
|
description:
|
|
30
31
|
- A filename on the remote node, when it already exists, this step will B(not) be run.
|
|
31
32
|
version_added: "1.5"
|
|
33
|
+
type: str
|
|
32
34
|
removes:
|
|
33
35
|
description:
|
|
34
36
|
- A filename on the remote node, when it does not exist, this step will B(not) be run.
|
|
35
37
|
version_added: "1.5"
|
|
38
|
+
type: str
|
|
36
39
|
chdir:
|
|
37
40
|
description:
|
|
38
41
|
- Change into this directory on the remote node before running the script.
|
|
39
42
|
version_added: "2.4"
|
|
43
|
+
type: str
|
|
40
44
|
executable:
|
|
41
45
|
description:
|
|
42
|
-
- Name or path of
|
|
46
|
+
- Name or path of an executable to invoke the script with.
|
|
43
47
|
version_added: "2.6"
|
|
48
|
+
type: str
|
|
44
49
|
notes:
|
|
45
50
|
- It is usually preferable to write Ansible modules rather than pushing scripts. Convert your script to an Ansible module for bonus points!
|
|
46
|
-
- The
|
|
47
|
-
stderr is sent to stdout. If you depend on separated stdout and stderr result keys,
|
|
51
|
+
- The P(ansible.builtin.ssh#connection) connection plugin will force pseudo-tty allocation via C(-tt) when scripts are executed.
|
|
52
|
+
Pseudo-ttys do not have a stderr channel and all stderr is sent to stdout. If you depend on separated stdout and stderr result keys,
|
|
53
|
+
please switch to a set of tasks that comprises M(ansible.builtin.copy) with M(ansible.builtin.command) instead of using M(ansible.builtin.script).
|
|
48
54
|
- If the path to the local script contains spaces, it needs to be quoted.
|
|
49
55
|
- This module is also supported for Windows targets.
|
|
50
|
-
- If the script returns non
|
|
56
|
+
- If the script returns non-UTF-8 data, it must be encoded to avoid issues. One option is to pipe
|
|
51
57
|
the output through C(base64).
|
|
52
58
|
seealso:
|
|
53
59
|
- module: ansible.builtin.shell
|
|
@@ -63,7 +69,7 @@ extends_documentation_fragment:
|
|
|
63
69
|
attributes:
|
|
64
70
|
check_mode:
|
|
65
71
|
support: partial
|
|
66
|
-
details: while the script itself is arbitrary and cannot be subject to the check mode semantics it adds
|
|
72
|
+
details: while the script itself is arbitrary and cannot be subject to the check mode semantics it adds O(creates)/O(removes) options as a workaround
|
|
67
73
|
diff_mode:
|
|
68
74
|
support: none
|
|
69
75
|
platform:
|
|
@@ -105,6 +111,6 @@ EXAMPLES = r'''
|
|
|
105
111
|
args:
|
|
106
112
|
executable: python3
|
|
107
113
|
|
|
108
|
-
- name: Run a Powershell script on a
|
|
114
|
+
- name: Run a Powershell script on a Windows host
|
|
109
115
|
script: subdirectories/under/path/with/your/playbook/script.ps1
|
|
110
116
|
'''
|
ansible/modules/service.py
CHANGED
|
@@ -21,8 +21,8 @@ description:
|
|
|
21
21
|
- This module is a proxy for multiple more specific service manager modules
|
|
22
22
|
(such as M(ansible.builtin.systemd) and M(ansible.builtin.sysvinit)).
|
|
23
23
|
This allows management of a heterogeneous environment of machines without creating a specific task for
|
|
24
|
-
each service manager. The module to be executed is determined by the
|
|
25
|
-
service manager discovered by M(ansible.builtin.setup). If
|
|
24
|
+
each service manager. The module to be executed is determined by the O(use) option, which defaults to the
|
|
25
|
+
service manager discovered by M(ansible.builtin.setup). If M(ansible.builtin.setup) was not yet run, this module may run it.
|
|
26
26
|
- For Windows targets, use the M(ansible.windows.win_service) module instead.
|
|
27
27
|
options:
|
|
28
28
|
name:
|
|
@@ -32,10 +32,10 @@ options:
|
|
|
32
32
|
required: true
|
|
33
33
|
state:
|
|
34
34
|
description:
|
|
35
|
-
-
|
|
35
|
+
- V(started)/V(stopped) are idempotent actions that will not run
|
|
36
36
|
commands unless necessary.
|
|
37
|
-
-
|
|
38
|
-
-
|
|
37
|
+
- V(restarted) will always bounce the service.
|
|
38
|
+
- V(reloaded) will always reload.
|
|
39
39
|
- B(At least one of state and enabled are required.)
|
|
40
40
|
- Note that reloaded will start the service if it is not already started,
|
|
41
41
|
even if your chosen init system wouldn't normally.
|
|
@@ -43,7 +43,7 @@ options:
|
|
|
43
43
|
choices: [ reloaded, restarted, started, stopped ]
|
|
44
44
|
sleep:
|
|
45
45
|
description:
|
|
46
|
-
- If the service is being
|
|
46
|
+
- If the service is being V(restarted) then sleep this many seconds
|
|
47
47
|
between the stop and start command.
|
|
48
48
|
- This helps to work around badly-behaving init scripts that exit immediately
|
|
49
49
|
after signaling a process to stop.
|
|
@@ -82,6 +82,7 @@ options:
|
|
|
82
82
|
description:
|
|
83
83
|
- The service module actually uses system specific modules, normally through auto detection, this setting can force a specific module.
|
|
84
84
|
- Normally it uses the value of the 'ansible_service_mgr' fact and falls back to the old 'service' module when none matching is found.
|
|
85
|
+
- The 'old service module' still uses autodetection and in no way does it correspond to the C(service) command.
|
|
85
86
|
type: str
|
|
86
87
|
default: auto
|
|
87
88
|
version_added: 2.2
|
|
@@ -106,6 +107,9 @@ attributes:
|
|
|
106
107
|
platforms: all
|
|
107
108
|
notes:
|
|
108
109
|
- For AIX, group subsystem names can be used.
|
|
110
|
+
- The C(service) command line utility is not part of any service manager system but a convenience.
|
|
111
|
+
It does not have a standard implementation across systems, and this action cannot use it directly.
|
|
112
|
+
Though it might be used if found in certain circumstances, the detected system service manager is normally preferred.
|
|
109
113
|
seealso:
|
|
110
114
|
- module: ansible.windows.win_service
|
|
111
115
|
author:
|
|
@@ -172,7 +176,7 @@ import time
|
|
|
172
176
|
if platform.system() != 'SunOS':
|
|
173
177
|
from ansible.module_utils.compat.version import LooseVersion
|
|
174
178
|
|
|
175
|
-
from ansible.module_utils.
|
|
179
|
+
from ansible.module_utils.common.text.converters import to_bytes, to_text
|
|
176
180
|
from ansible.module_utils.basic import AnsibleModule
|
|
177
181
|
from ansible.module_utils.common.locale import get_best_parsable_locale
|
|
178
182
|
from ansible.module_utils.common.sys_info import get_platform_subclass
|
|
@@ -1191,107 +1195,31 @@ class OpenBsdService(Service):
|
|
|
1191
1195
|
return self.execute_command("%s -f %s" % (self.svc_cmd, self.action))
|
|
1192
1196
|
|
|
1193
1197
|
def service_enable(self):
|
|
1198
|
+
|
|
1194
1199
|
if not self.enable_cmd:
|
|
1195
1200
|
return super(OpenBsdService, self).service_enable()
|
|
1196
1201
|
|
|
1197
|
-
rc, stdout, stderr = self.execute_command("%s %s %s %s" % (self.enable_cmd, 'getdef', self.name, 'flags'))
|
|
1198
|
-
|
|
1199
|
-
if stderr:
|
|
1200
|
-
self.module.fail_json(msg=stderr)
|
|
1201
|
-
|
|
1202
|
-
getdef_string = stdout.rstrip()
|
|
1203
|
-
|
|
1204
|
-
# Depending on the service the string returned from 'getdef' may be
|
|
1205
|
-
# either a set of flags or the boolean YES/NO
|
|
1206
|
-
if getdef_string == "YES" or getdef_string == "NO":
|
|
1207
|
-
default_flags = ''
|
|
1208
|
-
else:
|
|
1209
|
-
default_flags = getdef_string
|
|
1210
|
-
|
|
1211
|
-
rc, stdout, stderr = self.execute_command("%s %s %s %s" % (self.enable_cmd, 'get', self.name, 'flags'))
|
|
1212
|
-
|
|
1213
|
-
if stderr:
|
|
1214
|
-
self.module.fail_json(msg=stderr)
|
|
1215
|
-
|
|
1216
|
-
get_string = stdout.rstrip()
|
|
1217
|
-
|
|
1218
|
-
# Depending on the service the string returned from 'get' may be
|
|
1219
|
-
# either a set of flags or the boolean YES/NO
|
|
1220
|
-
if get_string == "YES" or get_string == "NO":
|
|
1221
|
-
current_flags = ''
|
|
1222
|
-
else:
|
|
1223
|
-
current_flags = get_string
|
|
1224
|
-
|
|
1225
|
-
# If there are arguments from the user we use these as flags unless
|
|
1226
|
-
# they are already set.
|
|
1227
|
-
if self.arguments and self.arguments != current_flags:
|
|
1228
|
-
changed_flags = self.arguments
|
|
1229
|
-
# If the user has not supplied any arguments and the current flags
|
|
1230
|
-
# differ from the default we reset them.
|
|
1231
|
-
elif not self.arguments and current_flags != default_flags:
|
|
1232
|
-
changed_flags = ' '
|
|
1233
|
-
# Otherwise there is no need to modify flags.
|
|
1234
|
-
else:
|
|
1235
|
-
changed_flags = ''
|
|
1236
|
-
|
|
1237
1202
|
rc, stdout, stderr = self.execute_command("%s %s %s %s" % (self.enable_cmd, 'get', self.name, 'status'))
|
|
1238
1203
|
|
|
1204
|
+
status_action = None
|
|
1239
1205
|
if self.enable:
|
|
1240
|
-
if rc == 0 and not changed_flags:
|
|
1241
|
-
return
|
|
1242
|
-
|
|
1243
1206
|
if rc != 0:
|
|
1244
|
-
status_action = "
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
if
|
|
1248
|
-
|
|
1249
|
-
else:
|
|
1250
|
-
flags_action = ''
|
|
1251
|
-
else:
|
|
1252
|
-
if rc == 1:
|
|
1253
|
-
return
|
|
1254
|
-
|
|
1255
|
-
status_action = "set %s status off" % self.name
|
|
1256
|
-
flags_action = ''
|
|
1257
|
-
|
|
1258
|
-
# Verify state assumption
|
|
1259
|
-
if not status_action and not flags_action:
|
|
1260
|
-
self.module.fail_json(msg="neither status_action or status_flags is set, this should never happen")
|
|
1261
|
-
|
|
1262
|
-
if self.module.check_mode:
|
|
1263
|
-
self.module.exit_json(changed=True, msg="changing service enablement")
|
|
1264
|
-
|
|
1265
|
-
status_modified = 0
|
|
1266
|
-
if status_action:
|
|
1267
|
-
rc, stdout, stderr = self.execute_command("%s %s" % (self.enable_cmd, status_action))
|
|
1268
|
-
|
|
1269
|
-
if rc != 0:
|
|
1270
|
-
if stderr:
|
|
1271
|
-
self.module.fail_json(msg=stderr)
|
|
1272
|
-
else:
|
|
1273
|
-
self.module.fail_json(msg="rcctl failed to modify service status")
|
|
1207
|
+
status_action = "on"
|
|
1208
|
+
elif self.enable is not None:
|
|
1209
|
+
# should be explicit False at this point
|
|
1210
|
+
if rc != 1:
|
|
1211
|
+
status_action = "off"
|
|
1274
1212
|
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1213
|
+
if status_action is not None:
|
|
1214
|
+
self.changed = True
|
|
1215
|
+
if not self.module.check_mode:
|
|
1216
|
+
rc, stdout, stderr = self.execute_command("%s set %s status %s" % (self.enable_cmd, self.name, status_action))
|
|
1279
1217
|
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
error_message = "rcctl modified service status but failed to set flags: " + stderr
|
|
1284
|
-
else:
|
|
1285
|
-
error_message = stderr
|
|
1286
|
-
else:
|
|
1287
|
-
if status_modified:
|
|
1288
|
-
error_message = "rcctl modified service status but failed to set flags"
|
|
1218
|
+
if rc != 0:
|
|
1219
|
+
if stderr:
|
|
1220
|
+
self.module.fail_json(msg=stderr)
|
|
1289
1221
|
else:
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
self.module.fail_json(msg=error_message)
|
|
1293
|
-
|
|
1294
|
-
self.changed = True
|
|
1222
|
+
self.module.fail_json(msg="rcctl failed to modify service status")
|
|
1295
1223
|
|
|
1296
1224
|
|
|
1297
1225
|
class NetBsdService(Service):
|
ansible/modules/service_facts.py
CHANGED
|
@@ -28,7 +28,7 @@ attributes:
|
|
|
28
28
|
platform:
|
|
29
29
|
platforms: posix
|
|
30
30
|
notes:
|
|
31
|
-
- When accessing the
|
|
31
|
+
- When accessing the RV(ansible_facts.services) facts collected by this module,
|
|
32
32
|
it is recommended to not use "dot notation" because services can have a C(-)
|
|
33
33
|
character in their name which would result in invalid "dot notation", such as
|
|
34
34
|
C(ansible_facts.services.zuul-gateway). It is instead recommended to
|
|
@@ -57,19 +57,20 @@ ansible_facts:
|
|
|
57
57
|
services:
|
|
58
58
|
description: States of the services with service name as key.
|
|
59
59
|
returned: always
|
|
60
|
-
type:
|
|
60
|
+
type: list
|
|
61
|
+
elements: dict
|
|
61
62
|
contains:
|
|
62
63
|
source:
|
|
63
64
|
description:
|
|
64
65
|
- Init system of the service.
|
|
65
|
-
- One of
|
|
66
|
+
- One of V(rcctl), V(systemd), V(sysv), V(upstart), V(src).
|
|
66
67
|
returned: always
|
|
67
68
|
type: str
|
|
68
69
|
sample: sysv
|
|
69
70
|
state:
|
|
70
71
|
description:
|
|
71
72
|
- State of the service.
|
|
72
|
-
- 'This commonly includes (but is not limited to) the following:
|
|
73
|
+
- 'This commonly includes (but is not limited to) the following: V(failed), V(running), V(stopped) or V(unknown).'
|
|
73
74
|
- Depending on the used init system additional states might be returned.
|
|
74
75
|
returned: always
|
|
75
76
|
type: str
|
|
@@ -77,7 +78,7 @@ ansible_facts:
|
|
|
77
78
|
status:
|
|
78
79
|
description:
|
|
79
80
|
- State of the service.
|
|
80
|
-
- Either
|
|
81
|
+
- Either V(enabled), V(disabled), V(static), V(indirect) or V(unknown).
|
|
81
82
|
returned: systemd systems or RedHat/SUSE flavored sysvinit/upstart or OpenBSD
|
|
82
83
|
type: str
|
|
83
84
|
sample: enabled
|
|
@@ -361,14 +362,31 @@ class OpenBSDScanService(BaseService):
|
|
|
361
362
|
svcs.append(svc)
|
|
362
363
|
return svcs
|
|
363
364
|
|
|
365
|
+
def get_info(self, name):
|
|
366
|
+
info = {}
|
|
367
|
+
rc, stdout, stderr = self.module.run_command("%s get %s" % (self.rcctl_path, name))
|
|
368
|
+
if 'needs root privileges' in stderr.lower():
|
|
369
|
+
self.module.warn('rcctl requires root privileges')
|
|
370
|
+
else:
|
|
371
|
+
undy = '%s_' % name
|
|
372
|
+
for variable in stdout.split('\n'):
|
|
373
|
+
if variable == '' or '=' not in variable:
|
|
374
|
+
continue
|
|
375
|
+
else:
|
|
376
|
+
k, v = variable.replace(undy, '', 1).split('=')
|
|
377
|
+
info[k] = v
|
|
378
|
+
return info
|
|
379
|
+
|
|
364
380
|
def gather_services(self):
|
|
365
381
|
|
|
366
382
|
services = {}
|
|
367
383
|
self.rcctl_path = self.module.get_bin_path("rcctl")
|
|
368
384
|
if self.rcctl_path:
|
|
369
385
|
|
|
386
|
+
# populate services will all possible
|
|
370
387
|
for svc in self.query_rcctl('all'):
|
|
371
|
-
services[svc] = {'name': svc, 'source': 'rcctl'}
|
|
388
|
+
services[svc] = {'name': svc, 'source': 'rcctl', 'rogue': False}
|
|
389
|
+
services[svc].update(self.get_info(svc))
|
|
372
390
|
|
|
373
391
|
for svc in self.query_rcctl('on'):
|
|
374
392
|
services[svc].update({'status': 'enabled'})
|
|
@@ -376,16 +394,22 @@ class OpenBSDScanService(BaseService):
|
|
|
376
394
|
for svc in self.query_rcctl('started'):
|
|
377
395
|
services[svc].update({'state': 'running'})
|
|
378
396
|
|
|
379
|
-
# Based on the list of services that are enabled, determine which are disabled
|
|
380
|
-
[services[svc].update({'status': 'disabled'}) for svc in services if services[svc].get('status') is None]
|
|
381
|
-
|
|
382
|
-
# and do the same for those are aren't running
|
|
383
|
-
[services[svc].update({'state': 'stopped'}) for svc in services if services[svc].get('state') is None]
|
|
384
|
-
|
|
385
397
|
# Override the state for services which are marked as 'failed'
|
|
386
398
|
for svc in self.query_rcctl('failed'):
|
|
387
399
|
services[svc].update({'state': 'failed'})
|
|
388
400
|
|
|
401
|
+
for svc in services.keys():
|
|
402
|
+
# Based on the list of services that are enabled/failed, determine which are disabled
|
|
403
|
+
if services[svc].get('status') is None:
|
|
404
|
+
services[svc].update({'status': 'disabled'})
|
|
405
|
+
|
|
406
|
+
# and do the same for those are aren't running
|
|
407
|
+
if services[svc].get('state') is None:
|
|
408
|
+
services[svc].update({'state': 'stopped'})
|
|
409
|
+
|
|
410
|
+
for svc in self.query_rcctl('rogue'):
|
|
411
|
+
services[svc]['rogue'] = True
|
|
412
|
+
|
|
389
413
|
return services
|
|
390
414
|
|
|
391
415
|
|
ansible/modules/set_fact.py
CHANGED
|
@@ -15,13 +15,13 @@ version_added: "1.2"
|
|
|
15
15
|
description:
|
|
16
16
|
- This action allows setting variables associated to the current host.
|
|
17
17
|
- These variables will be available to subsequent plays during an ansible-playbook run via the host they were set on.
|
|
18
|
-
- Set
|
|
18
|
+
- Set O(cacheable) to V(true) to save variables across executions using a fact cache.
|
|
19
19
|
Variables will keep the set_fact precedence for the current run, but will used 'cached fact' precedence for subsequent ones.
|
|
20
20
|
- Per the standard Ansible variable precedence rules, other types of variables have a higher priority, so this value may be overridden.
|
|
21
21
|
options:
|
|
22
22
|
key_value:
|
|
23
23
|
description:
|
|
24
|
-
- "The
|
|
24
|
+
- "The M(ansible.builtin.set_fact) module takes C(key=value) pairs or C(key: value) (YAML notation) as variables to set in the playbook scope.
|
|
25
25
|
The 'key' is the resulting variable name and the value is, of course, the value of said variable."
|
|
26
26
|
- You can create multiple variables at once, by supplying multiple pairs, but do NOT mix notations.
|
|
27
27
|
required: true
|
ansible/modules/set_stats.py
CHANGED
|
@@ -28,7 +28,7 @@ options:
|
|
|
28
28
|
default: no
|
|
29
29
|
aggregate:
|
|
30
30
|
description:
|
|
31
|
-
- Whether the provided value is aggregated to the existing stat
|
|
31
|
+
- Whether the provided value is aggregated to the existing stat V(true) or will replace it V(false).
|
|
32
32
|
type: bool
|
|
33
33
|
default: yes
|
|
34
34
|
extends_documentation_fragment:
|
|
@@ -55,7 +55,7 @@ attributes:
|
|
|
55
55
|
support: none
|
|
56
56
|
notes:
|
|
57
57
|
- In order for custom stats to be displayed, you must set C(show_custom_stats) in section C([defaults]) in C(ansible.cfg)
|
|
58
|
-
or by defining environment variable C(ANSIBLE_SHOW_CUSTOM_STATS) to
|
|
58
|
+
or by defining environment variable C(ANSIBLE_SHOW_CUSTOM_STATS) to V(true). See the P(ansible.builtin.default#callback) callback plugin for details.
|
|
59
59
|
version_added: "2.3"
|
|
60
60
|
'''
|
|
61
61
|
|
ansible/modules/setup.py
CHANGED
|
@@ -17,24 +17,24 @@ options:
|
|
|
17
17
|
version_added: "2.1"
|
|
18
18
|
description:
|
|
19
19
|
- "If supplied, restrict the additional facts collected to the given subset.
|
|
20
|
-
Possible values:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
20
|
+
Possible values: V(all), V(all_ipv4_addresses), V(all_ipv6_addresses), V(apparmor), V(architecture),
|
|
21
|
+
V(caps), V(chroot),V(cmdline), V(date_time), V(default_ipv4), V(default_ipv6), V(devices),
|
|
22
|
+
V(distribution), V(distribution_major_version), V(distribution_release), V(distribution_version),
|
|
23
|
+
V(dns), V(effective_group_ids), V(effective_user_id), V(env), V(facter), V(fips), V(hardware),
|
|
24
|
+
V(interfaces), V(is_chroot), V(iscsi), V(kernel), V(local), V(lsb), V(machine), V(machine_id),
|
|
25
|
+
V(mounts), V(network), V(ohai), V(os_family), V(pkg_mgr), V(platform), V(processor), V(processor_cores),
|
|
26
|
+
V(processor_count), V(python), V(python_version), V(real_user_id), V(selinux), V(service_mgr),
|
|
27
|
+
V(ssh_host_key_dsa_public), V(ssh_host_key_ecdsa_public), V(ssh_host_key_ed25519_public),
|
|
28
|
+
V(ssh_host_key_rsa_public), V(ssh_host_pub_keys), V(ssh_pub_keys), V(system), V(system_capabilities),
|
|
29
|
+
V(system_capabilities_enforced), V(user), V(user_dir), V(user_gecos), V(user_gid), V(user_id),
|
|
30
|
+
V(user_shell), V(user_uid), V(virtual), V(virtualization_role), V(virtualization_type).
|
|
31
31
|
Can specify a list of values to specify a larger subset.
|
|
32
32
|
Values can also be used with an initial C(!) to specify that
|
|
33
33
|
that specific subset should not be collected. For instance:
|
|
34
|
-
|
|
34
|
+
V(!hardware,!network,!virtual,!ohai,!facter). If V(!all) is specified
|
|
35
35
|
then only the min subset is collected. To avoid collecting even the
|
|
36
|
-
min subset, specify
|
|
37
|
-
use
|
|
36
|
+
min subset, specify V(!all,!min). To collect only specific facts,
|
|
37
|
+
use V(!all,!min), and specify the particular fact subsets.
|
|
38
38
|
Use the filter parameter if you do not want to display some collected
|
|
39
39
|
facts."
|
|
40
40
|
type: list
|
|
@@ -64,12 +64,12 @@ options:
|
|
|
64
64
|
- Path used for local ansible facts (C(*.fact)) - files in this dir
|
|
65
65
|
will be run (if executable) and their results be added to C(ansible_local) facts.
|
|
66
66
|
If a file is not executable it is read instead.
|
|
67
|
-
File/results format can be JSON or INI-format. The default
|
|
67
|
+
File/results format can be JSON or INI-format. The default O(fact_path) can be
|
|
68
68
|
specified in C(ansible.cfg) for when setup is automatically called as part of
|
|
69
69
|
C(gather_facts).
|
|
70
70
|
NOTE - For windows clients, the results will be added to a variable named after the
|
|
71
71
|
local file (without extension suffix), rather than C(ansible_local).
|
|
72
|
-
- Since Ansible 2.1, Windows hosts can use
|
|
72
|
+
- Since Ansible 2.1, Windows hosts can use O(fact_path). Make sure that this path
|
|
73
73
|
exists on the target host. Files in this path MUST be PowerShell scripts C(.ps1)
|
|
74
74
|
which outputs an object. This object will be formatted by Ansible as json so the
|
|
75
75
|
script should be outputting a raw hashtable, array, or other primitive object.
|
|
@@ -104,7 +104,7 @@ notes:
|
|
|
104
104
|
remote systems. (See also M(community.general.facter) and M(community.general.ohai).)
|
|
105
105
|
- The filter option filters only the first level subkey below ansible_facts.
|
|
106
106
|
- If the target host is Windows, you will not currently have the ability to use
|
|
107
|
-
|
|
107
|
+
O(filter) as this is provided by a simpler implementation of the module.
|
|
108
108
|
- This module should be run with elevated privileges on BSD systems to gather facts like ansible_product_version.
|
|
109
109
|
- For more information about delegated facts,
|
|
110
110
|
please check U(https://docs.ansible.com/ansible/latest/user_guide/playbooks_delegation.html#delegating-facts).
|
|
@@ -174,7 +174,7 @@ EXAMPLES = r"""
|
|
|
174
174
|
# import module snippets
|
|
175
175
|
from ..module_utils.basic import AnsibleModule
|
|
176
176
|
|
|
177
|
-
from ansible.module_utils.
|
|
177
|
+
from ansible.module_utils.common.text.converters import to_text
|
|
178
178
|
from ansible.module_utils.facts import ansible_collector, default_collectors
|
|
179
179
|
from ansible.module_utils.facts.collector import CollectorNotFoundError, CycleFoundInFactDeps, UnresolvedFactDep
|
|
180
180
|
from ansible.module_utils.facts.namespace import PrefixFactNamespace
|
ansible/modules/shell.py
CHANGED
|
@@ -16,8 +16,8 @@ DOCUMENTATION = r'''
|
|
|
16
16
|
module: shell
|
|
17
17
|
short_description: Execute shell commands on targets
|
|
18
18
|
description:
|
|
19
|
-
- The
|
|
20
|
-
- Either a free form command or
|
|
19
|
+
- The M(ansible.builtin.shell) module takes the command name followed by a list of space-delimited arguments.
|
|
20
|
+
- Either a free form command or O(cmd) parameter is required, see the examples.
|
|
21
21
|
- It is almost exactly like the M(ansible.builtin.command) module but runs
|
|
22
22
|
the command through a shell (C(/bin/sh)) on the remote node.
|
|
23
23
|
- For Windows targets, use the M(ansible.windows.win_shell) module instead.
|
|
@@ -69,7 +69,7 @@ extends_documentation_fragment:
|
|
|
69
69
|
- action_common_attributes.raw
|
|
70
70
|
attributes:
|
|
71
71
|
check_mode:
|
|
72
|
-
details: while the command itself is arbitrary and cannot be subject to the check mode semantics it adds
|
|
72
|
+
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
|
|
73
73
|
support: partial
|
|
74
74
|
diff_mode:
|
|
75
75
|
support: none
|