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/group.py
CHANGED
|
@@ -44,7 +44,7 @@ options:
|
|
|
44
44
|
version_added: "2.15"
|
|
45
45
|
system:
|
|
46
46
|
description:
|
|
47
|
-
- If
|
|
47
|
+
- If V(yes), indicates that the group created is a system group.
|
|
48
48
|
type: bool
|
|
49
49
|
default: no
|
|
50
50
|
local:
|
|
@@ -58,7 +58,7 @@ options:
|
|
|
58
58
|
version_added: "2.6"
|
|
59
59
|
non_unique:
|
|
60
60
|
description:
|
|
61
|
-
- This option allows to change the group ID to a non-unique value. Requires
|
|
61
|
+
- This option allows to change the group ID to a non-unique value. Requires O(gid).
|
|
62
62
|
- Not supported on macOS or BusyBox distributions.
|
|
63
63
|
type: bool
|
|
64
64
|
default: no
|
|
@@ -94,7 +94,7 @@ EXAMPLES = '''
|
|
|
94
94
|
RETURN = r'''
|
|
95
95
|
gid:
|
|
96
96
|
description: Group ID of the group.
|
|
97
|
-
returned: When
|
|
97
|
+
returned: When O(state) is C(present)
|
|
98
98
|
type: int
|
|
99
99
|
sample: 1001
|
|
100
100
|
name:
|
|
@@ -109,7 +109,7 @@ state:
|
|
|
109
109
|
sample: 'absent'
|
|
110
110
|
system:
|
|
111
111
|
description: Whether the group is a system group or not.
|
|
112
|
-
returned: When
|
|
112
|
+
returned: When O(state) is C(present)
|
|
113
113
|
type: bool
|
|
114
114
|
sample: False
|
|
115
115
|
'''
|
|
@@ -117,7 +117,7 @@ system:
|
|
|
117
117
|
import grp
|
|
118
118
|
import os
|
|
119
119
|
|
|
120
|
-
from ansible.module_utils.
|
|
120
|
+
from ansible.module_utils.common.text.converters import to_bytes
|
|
121
121
|
from ansible.module_utils.basic import AnsibleModule
|
|
122
122
|
from ansible.module_utils.common.sys_info import get_platform_subclass
|
|
123
123
|
|
|
@@ -227,14 +227,7 @@ class Group(object):
|
|
|
227
227
|
if line.startswith(to_bytes(name_test)):
|
|
228
228
|
exists = True
|
|
229
229
|
break
|
|
230
|
-
|
|
231
|
-
if not exists:
|
|
232
|
-
self.module.warn(
|
|
233
|
-
"'local: true' specified and group was not found in {file}. "
|
|
234
|
-
"The local group may already exist if the local group database exists somewhere other than {file}.".format(file=self.GROUPFILE))
|
|
235
|
-
|
|
236
230
|
return exists
|
|
237
|
-
|
|
238
231
|
else:
|
|
239
232
|
try:
|
|
240
233
|
if grp.getgrnam(self.name):
|
ansible/modules/hostname.py
CHANGED
|
@@ -81,7 +81,7 @@ from ansible.module_utils.basic import (
|
|
|
81
81
|
from ansible.module_utils.common.sys_info import get_platform_subclass
|
|
82
82
|
from ansible.module_utils.facts.system.service_mgr import ServiceMgrFactCollector
|
|
83
83
|
from ansible.module_utils.facts.utils import get_file_lines, get_file_content
|
|
84
|
-
from ansible.module_utils.
|
|
84
|
+
from ansible.module_utils.common.text.converters import to_native, to_text
|
|
85
85
|
from ansible.module_utils.six import PY3, text_type
|
|
86
86
|
|
|
87
87
|
STRATS = {
|
|
@@ -387,10 +387,29 @@ class OpenRCStrategy(BaseStrategy):
|
|
|
387
387
|
class OpenBSDStrategy(FileStrategy):
|
|
388
388
|
"""
|
|
389
389
|
This is a OpenBSD family Hostname manipulation strategy class - it edits
|
|
390
|
-
the /etc/myname file
|
|
390
|
+
the /etc/myname file for the permanent hostname and executes hostname
|
|
391
|
+
command for the current hostname.
|
|
391
392
|
"""
|
|
392
393
|
|
|
393
394
|
FILE = '/etc/myname'
|
|
395
|
+
COMMAND = "hostname"
|
|
396
|
+
|
|
397
|
+
def __init__(self, module):
|
|
398
|
+
super(OpenBSDStrategy, self).__init__(module)
|
|
399
|
+
self.hostname_cmd = self.module.get_bin_path(self.COMMAND, True)
|
|
400
|
+
|
|
401
|
+
def get_current_hostname(self):
|
|
402
|
+
cmd = [self.hostname_cmd]
|
|
403
|
+
rc, out, err = self.module.run_command(cmd)
|
|
404
|
+
if rc != 0:
|
|
405
|
+
self.module.fail_json(msg="Command failed rc=%d, out=%s, err=%s" % (rc, out, err))
|
|
406
|
+
return to_native(out).strip()
|
|
407
|
+
|
|
408
|
+
def set_current_hostname(self, name):
|
|
409
|
+
cmd = [self.hostname_cmd, name]
|
|
410
|
+
rc, out, err = self.module.run_command(cmd)
|
|
411
|
+
if rc != 0:
|
|
412
|
+
self.module.fail_json(msg="Command failed rc=%d, out=%s, err=%s" % (rc, out, err))
|
|
394
413
|
|
|
395
414
|
|
|
396
415
|
class SolarisStrategy(BaseStrategy):
|
ansible/modules/include_role.py
CHANGED
|
@@ -16,7 +16,7 @@ description:
|
|
|
16
16
|
- Dynamically loads and executes a specified role as a task.
|
|
17
17
|
- May be used only where Ansible tasks are allowed - inside C(pre_tasks), C(tasks), or C(post_tasks) play objects, or as a task inside a role.
|
|
18
18
|
- Task-level keywords, loops, and conditionals apply only to the C(include_role) statement itself.
|
|
19
|
-
- To apply keywords to the tasks within the role, pass them using the
|
|
19
|
+
- To apply keywords to the tasks within the role, pass them using the O(apply) option or use M(ansible.builtin.import_role) instead.
|
|
20
20
|
- Ignores some keywords, like C(until) and C(retries).
|
|
21
21
|
- This module is also supported for Windows targets.
|
|
22
22
|
- Does not work in handlers.
|
|
@@ -24,7 +24,7 @@ version_added: "2.2"
|
|
|
24
24
|
options:
|
|
25
25
|
apply:
|
|
26
26
|
description:
|
|
27
|
-
- Accepts a hash of task keywords (
|
|
27
|
+
- Accepts a hash of task keywords (for example C(tags), C(become)) that will be applied to all tasks within the included role.
|
|
28
28
|
version_added: '2.7'
|
|
29
29
|
name:
|
|
30
30
|
description:
|
|
@@ -53,9 +53,9 @@ options:
|
|
|
53
53
|
default: yes
|
|
54
54
|
public:
|
|
55
55
|
description:
|
|
56
|
-
- This option dictates whether the role's C(vars) and C(defaults) are exposed to the play. If set to
|
|
56
|
+
- This option dictates whether the role's C(vars) and C(defaults) are exposed to the play. If set to V(true)
|
|
57
57
|
the variables will be available to tasks following the C(include_role) task. This functionality differs from
|
|
58
|
-
standard variable exposure for roles listed under the C(roles) header or
|
|
58
|
+
standard variable exposure for roles listed under the C(roles) header or M(ansible.builtin.import_role) as they are exposed
|
|
59
59
|
to the play at playbook parsing time, and available to earlier roles and tasks as well.
|
|
60
60
|
type: bool
|
|
61
61
|
default: no
|
|
@@ -85,7 +85,7 @@ attributes:
|
|
|
85
85
|
support: none
|
|
86
86
|
notes:
|
|
87
87
|
- Handlers and are made available to the whole play.
|
|
88
|
-
- After Ansible 2.4, you can use M(ansible.builtin.import_role) for
|
|
88
|
+
- After Ansible 2.4, you can use M(ansible.builtin.import_role) for B(static) behaviour and this action for B(dynamic) one.
|
|
89
89
|
seealso:
|
|
90
90
|
- module: ansible.builtin.import_playbook
|
|
91
91
|
- module: ansible.builtin.import_role
|
ansible/modules/include_tasks.py
CHANGED
|
@@ -23,14 +23,14 @@ options:
|
|
|
23
23
|
version_added: '2.7'
|
|
24
24
|
apply:
|
|
25
25
|
description:
|
|
26
|
-
- Accepts a hash of task keywords (
|
|
26
|
+
- Accepts a hash of task keywords (for example C(tags), C(become)) that will be applied to the tasks within the include.
|
|
27
27
|
type: str
|
|
28
28
|
version_added: '2.7'
|
|
29
29
|
free-form:
|
|
30
30
|
description:
|
|
31
31
|
- |
|
|
32
32
|
Specifies the name of the imported file directly without any other option C(- include_tasks: file.yml).
|
|
33
|
-
- Is the equivalent of specifying an argument for the
|
|
33
|
+
- Is the equivalent of specifying an argument for the O(file) parameter.
|
|
34
34
|
- Most keywords, including loop, with_items, and conditionals, apply to this statement unlike M(ansible.builtin.import_tasks).
|
|
35
35
|
- The do-until loop is not supported.
|
|
36
36
|
extends_documentation_fragment:
|
ansible/modules/include_vars.py
CHANGED
|
@@ -40,7 +40,7 @@ options:
|
|
|
40
40
|
version_added: "2.2"
|
|
41
41
|
depth:
|
|
42
42
|
description:
|
|
43
|
-
- When using
|
|
43
|
+
- When using O(dir), this module will, by default, recursively go through each sub directory and load up the
|
|
44
44
|
variables. By explicitly setting the depth, this module will only go as deep as the depth.
|
|
45
45
|
type: int
|
|
46
46
|
default: 0
|
|
@@ -58,7 +58,7 @@ options:
|
|
|
58
58
|
version_added: "2.2"
|
|
59
59
|
extensions:
|
|
60
60
|
description:
|
|
61
|
-
- List of file extensions to read when using
|
|
61
|
+
- List of file extensions to read when using O(dir).
|
|
62
62
|
type: list
|
|
63
63
|
elements: str
|
|
64
64
|
default: [ json, yaml, yml ]
|
|
@@ -73,9 +73,9 @@ options:
|
|
|
73
73
|
version_added: "2.7"
|
|
74
74
|
hash_behaviour:
|
|
75
75
|
description:
|
|
76
|
-
- If set to
|
|
77
|
-
- If omitted
|
|
78
|
-
- This option is self-contained and does not apply to individual files in
|
|
76
|
+
- If set to V(merge), merges existing hash variables instead of overwriting them.
|
|
77
|
+
- If omitted (V(null)), the behavior falls back to the global C(hash_behaviour) configuration.
|
|
78
|
+
- This option is self-contained and does not apply to individual files in O(dir). You can use a loop to apply O(hash_behaviour) per file.
|
|
79
79
|
default: null
|
|
80
80
|
type: str
|
|
81
81
|
choices: ["replace", "merge"]
|
ansible/modules/iptables.py
CHANGED
|
@@ -17,7 +17,7 @@ author:
|
|
|
17
17
|
- Linus Unnebäck (@LinusU) <linus@folkdatorn.se>
|
|
18
18
|
- Sébastien DA ROCHA (@sebastiendarocha)
|
|
19
19
|
description:
|
|
20
|
-
-
|
|
20
|
+
- M(ansible.builtin.iptables) is used to set up, maintain, and inspect the tables of IP packet
|
|
21
21
|
filter rules in the Linux kernel.
|
|
22
22
|
- This module does not handle the saving and/or loading of rules, but rather
|
|
23
23
|
only manipulates the current rules that are present in memory. This is the
|
|
@@ -61,7 +61,7 @@ options:
|
|
|
61
61
|
rule_num:
|
|
62
62
|
description:
|
|
63
63
|
- Insert the rule as the given rule number.
|
|
64
|
-
- This works only with
|
|
64
|
+
- This works only with O(action=insert).
|
|
65
65
|
type: str
|
|
66
66
|
version_added: "2.5"
|
|
67
67
|
ip_version:
|
|
@@ -74,18 +74,18 @@ options:
|
|
|
74
74
|
description:
|
|
75
75
|
- Specify the iptables chain to modify.
|
|
76
76
|
- This could be a user-defined chain or one of the standard iptables chains, like
|
|
77
|
-
|
|
77
|
+
V(INPUT), V(FORWARD), V(OUTPUT), V(PREROUTING), V(POSTROUTING), V(SECMARK) or V(CONNSECMARK).
|
|
78
78
|
type: str
|
|
79
79
|
protocol:
|
|
80
80
|
description:
|
|
81
81
|
- The protocol of the rule or of the packet to check.
|
|
82
|
-
- The specified protocol can be one of
|
|
83
|
-
|
|
82
|
+
- The specified protocol can be one of V(tcp), V(udp), V(udplite), V(icmp), V(ipv6-icmp) or V(icmpv6),
|
|
83
|
+
V(esp), V(ah), V(sctp) or the special keyword V(all), or it can be a numeric value,
|
|
84
84
|
representing one of these protocols or a different one.
|
|
85
|
-
- A protocol name from
|
|
86
|
-
- A
|
|
85
|
+
- A protocol name from C(/etc/protocols) is also allowed.
|
|
86
|
+
- A V(!) argument before the protocol inverts the test.
|
|
87
87
|
- The number zero is equivalent to all.
|
|
88
|
-
-
|
|
88
|
+
- V(all) will match with all protocols and is taken as default when this option is omitted.
|
|
89
89
|
type: str
|
|
90
90
|
source:
|
|
91
91
|
description:
|
|
@@ -97,7 +97,7 @@ options:
|
|
|
97
97
|
a remote query such as DNS is a really bad idea.
|
|
98
98
|
- The mask can be either a network mask or a plain number, specifying
|
|
99
99
|
the number of 1's at the left side of the network mask. Thus, a mask
|
|
100
|
-
of 24 is equivalent to 255.255.255.0. A
|
|
100
|
+
of 24 is equivalent to 255.255.255.0. A V(!) argument before the
|
|
101
101
|
address specification inverts the sense of the address.
|
|
102
102
|
type: str
|
|
103
103
|
destination:
|
|
@@ -110,13 +110,13 @@ options:
|
|
|
110
110
|
a remote query such as DNS is a really bad idea.
|
|
111
111
|
- The mask can be either a network mask or a plain number, specifying
|
|
112
112
|
the number of 1's at the left side of the network mask. Thus, a mask
|
|
113
|
-
of 24 is equivalent to 255.255.255.0. A
|
|
113
|
+
of 24 is equivalent to 255.255.255.0. A V(!) argument before the
|
|
114
114
|
address specification inverts the sense of the address.
|
|
115
115
|
type: str
|
|
116
116
|
tcp_flags:
|
|
117
117
|
description:
|
|
118
118
|
- TCP flags specification.
|
|
119
|
-
-
|
|
119
|
+
- O(tcp_flags) expects a dict with the two keys C(flags) and C(flags_set).
|
|
120
120
|
type: dict
|
|
121
121
|
version_added: "2.4"
|
|
122
122
|
suboptions:
|
|
@@ -154,7 +154,7 @@ options:
|
|
|
154
154
|
gateway:
|
|
155
155
|
description:
|
|
156
156
|
- This specifies the IP address of host to send the cloned packets.
|
|
157
|
-
- This option is only valid when
|
|
157
|
+
- This option is only valid when O(jump) is set to V(TEE).
|
|
158
158
|
type: str
|
|
159
159
|
version_added: "2.8"
|
|
160
160
|
log_prefix:
|
|
@@ -166,7 +166,7 @@ options:
|
|
|
166
166
|
description:
|
|
167
167
|
- Logging level according to the syslogd-defined priorities.
|
|
168
168
|
- The value can be strings or numbers from 1-8.
|
|
169
|
-
- This parameter is only applicable if
|
|
169
|
+
- This parameter is only applicable if O(jump) is set to V(LOG).
|
|
170
170
|
type: str
|
|
171
171
|
version_added: "2.8"
|
|
172
172
|
choices: [ '0', '1', '2', '3', '4', '5', '6', '7', 'emerg', 'alert', 'crit', 'error', 'warning', 'notice', 'info', 'debug' ]
|
|
@@ -179,18 +179,18 @@ options:
|
|
|
179
179
|
in_interface:
|
|
180
180
|
description:
|
|
181
181
|
- Name of an interface via which a packet was received (only for packets
|
|
182
|
-
entering the
|
|
183
|
-
- When the
|
|
184
|
-
- If the interface name ends in a
|
|
182
|
+
entering the V(INPUT), V(FORWARD) and V(PREROUTING) chains).
|
|
183
|
+
- When the V(!) argument is used before the interface name, the sense is inverted.
|
|
184
|
+
- If the interface name ends in a V(+), then any interface which begins with
|
|
185
185
|
this name will match.
|
|
186
186
|
- If this option is omitted, any interface name will match.
|
|
187
187
|
type: str
|
|
188
188
|
out_interface:
|
|
189
189
|
description:
|
|
190
190
|
- Name of an interface via which a packet is going to be sent (for
|
|
191
|
-
packets entering the
|
|
192
|
-
- When the
|
|
193
|
-
- If the interface name ends in a
|
|
191
|
+
packets entering the V(FORWARD), V(OUTPUT) and V(POSTROUTING) chains).
|
|
192
|
+
- When the V(!) argument is used before the interface name, the sense is inverted.
|
|
193
|
+
- If the interface name ends in a V(+), then any interface which begins
|
|
194
194
|
with this name will match.
|
|
195
195
|
- If this option is omitted, any interface name will match.
|
|
196
196
|
type: str
|
|
@@ -206,14 +206,14 @@ options:
|
|
|
206
206
|
set_counters:
|
|
207
207
|
description:
|
|
208
208
|
- This enables the administrator to initialize the packet and byte
|
|
209
|
-
counters of a rule (during
|
|
209
|
+
counters of a rule (during V(INSERT), V(APPEND), V(REPLACE) operations).
|
|
210
210
|
type: str
|
|
211
211
|
source_port:
|
|
212
212
|
description:
|
|
213
213
|
- Source port or port range specification.
|
|
214
214
|
- This can either be a service name or a port number.
|
|
215
215
|
- An inclusive range can also be specified, using the format C(first:last).
|
|
216
|
-
- If the first port is omitted,
|
|
216
|
+
- If the first port is omitted, V(0) is assumed; if the last is omitted, V(65535) is assumed.
|
|
217
217
|
- If the first port is greater than the second one they will be swapped.
|
|
218
218
|
type: str
|
|
219
219
|
destination_port:
|
|
@@ -239,7 +239,7 @@ options:
|
|
|
239
239
|
- This specifies a destination port or range of ports to use, without
|
|
240
240
|
this, the destination port is never altered.
|
|
241
241
|
- This is only valid if the rule also specifies one of the protocol
|
|
242
|
-
|
|
242
|
+
V(tcp), V(udp), V(dccp) or V(sctp).
|
|
243
243
|
type: str
|
|
244
244
|
to_destination:
|
|
245
245
|
description:
|
|
@@ -266,14 +266,14 @@ options:
|
|
|
266
266
|
description:
|
|
267
267
|
- This allows specifying a DSCP mark to be added to packets.
|
|
268
268
|
It takes either an integer or hex value.
|
|
269
|
-
- Mutually exclusive with
|
|
269
|
+
- Mutually exclusive with O(set_dscp_mark_class).
|
|
270
270
|
type: str
|
|
271
271
|
version_added: "2.1"
|
|
272
272
|
set_dscp_mark_class:
|
|
273
273
|
description:
|
|
274
274
|
- This allows specifying a predefined DiffServ class which will be
|
|
275
275
|
translated to the corresponding DSCP mark.
|
|
276
|
-
- Mutually exclusive with
|
|
276
|
+
- Mutually exclusive with O(set_dscp_mark).
|
|
277
277
|
type: str
|
|
278
278
|
version_added: "2.1"
|
|
279
279
|
comment:
|
|
@@ -283,7 +283,7 @@ options:
|
|
|
283
283
|
ctstate:
|
|
284
284
|
description:
|
|
285
285
|
- A list of the connection states to match in the conntrack module.
|
|
286
|
-
- Possible values are
|
|
286
|
+
- Possible values are V(INVALID), V(NEW), V(ESTABLISHED), V(RELATED), V(UNTRACKED), V(SNAT), V(DNAT).
|
|
287
287
|
type: list
|
|
288
288
|
elements: str
|
|
289
289
|
default: []
|
|
@@ -301,7 +301,7 @@ options:
|
|
|
301
301
|
description:
|
|
302
302
|
- Specifies a set name which can be defined by ipset.
|
|
303
303
|
- Must be used together with the match_set_flags parameter.
|
|
304
|
-
- When the
|
|
304
|
+
- When the V(!) argument is prepended then it inverts the rule.
|
|
305
305
|
- Uses the iptables set extension.
|
|
306
306
|
type: str
|
|
307
307
|
version_added: "2.11"
|
|
@@ -317,8 +317,8 @@ options:
|
|
|
317
317
|
description:
|
|
318
318
|
- Specifies the maximum average number of matches to allow per second.
|
|
319
319
|
- The number can specify units explicitly, using C(/second), C(/minute),
|
|
320
|
-
C(/hour) or C(/day), or parts of them (so
|
|
321
|
-
|
|
320
|
+
C(/hour) or C(/day), or parts of them (so V(5/second) is the same as
|
|
321
|
+
V(5/s)).
|
|
322
322
|
type: str
|
|
323
323
|
limit_burst:
|
|
324
324
|
description:
|
|
@@ -362,10 +362,10 @@ options:
|
|
|
362
362
|
description:
|
|
363
363
|
- Set the policy for the chain to the given target.
|
|
364
364
|
- Only built-in chains can have policies.
|
|
365
|
-
- This parameter requires the
|
|
365
|
+
- This parameter requires the O(chain) parameter.
|
|
366
366
|
- If you specify this parameter, all other parameters will be ignored.
|
|
367
|
-
- This parameter is used to set default policy for the given
|
|
368
|
-
Do not confuse this with
|
|
367
|
+
- This parameter is used to set default policy for the given O(chain).
|
|
368
|
+
Do not confuse this with O(jump) parameter.
|
|
369
369
|
type: str
|
|
370
370
|
choices: [ ACCEPT, DROP, QUEUE, RETURN ]
|
|
371
371
|
version_added: "2.2"
|
|
@@ -377,9 +377,9 @@ options:
|
|
|
377
377
|
version_added: "2.10"
|
|
378
378
|
chain_management:
|
|
379
379
|
description:
|
|
380
|
-
- If
|
|
381
|
-
- If
|
|
382
|
-
other parameter passed are
|
|
380
|
+
- If V(true) and O(state) is V(present), the chain will be created if needed.
|
|
381
|
+
- If V(true) and O(state) is V(absent), the chain will be deleted if the only
|
|
382
|
+
other parameter passed are O(chain) and optionally O(table).
|
|
383
383
|
type: bool
|
|
384
384
|
default: false
|
|
385
385
|
version_added: "2.13"
|
|
@@ -387,7 +387,7 @@ options:
|
|
|
387
387
|
description:
|
|
388
388
|
- This parameter controls the running of the list -action of iptables, which is used internally by the module
|
|
389
389
|
- Does not affect the actual functionality. Use this if iptables hangs when creating chain or altering policy
|
|
390
|
-
- If
|
|
390
|
+
- If V(true), then iptables skips the DNS-lookup of the IP addresses in a chain when it uses the list -action
|
|
391
391
|
- Listing is used internally for example when setting a policy or creting of a chain
|
|
392
392
|
type: bool
|
|
393
393
|
default: false
|
|
@@ -698,7 +698,7 @@ def push_arguments(iptables_path, action, params, make_rule=True):
|
|
|
698
698
|
|
|
699
699
|
def check_rule_present(iptables_path, module, params):
|
|
700
700
|
cmd = push_arguments(iptables_path, '-C', params)
|
|
701
|
-
rc,
|
|
701
|
+
rc, stdout, stderr = module.run_command(cmd, check_rc=False)
|
|
702
702
|
return (rc == 0)
|
|
703
703
|
|
|
704
704
|
|
|
@@ -732,7 +732,7 @@ def get_chain_policy(iptables_path, module, params):
|
|
|
732
732
|
cmd = push_arguments(iptables_path, '-L', params, make_rule=False)
|
|
733
733
|
if module.params['numeric']:
|
|
734
734
|
cmd.append('--numeric')
|
|
735
|
-
rc, out,
|
|
735
|
+
rc, out, err = module.run_command(cmd, check_rc=True)
|
|
736
736
|
chain_header = out.split("\n")[0]
|
|
737
737
|
result = re.search(r'\(policy ([A-Z]+)\)', chain_header)
|
|
738
738
|
if result:
|
|
@@ -742,7 +742,7 @@ def get_chain_policy(iptables_path, module, params):
|
|
|
742
742
|
|
|
743
743
|
def get_iptables_version(iptables_path, module):
|
|
744
744
|
cmd = [iptables_path, '--version']
|
|
745
|
-
rc, out,
|
|
745
|
+
rc, out, err = module.run_command(cmd, check_rc=True)
|
|
746
746
|
return out.split('v')[1].rstrip('\n')
|
|
747
747
|
|
|
748
748
|
|
|
@@ -755,7 +755,7 @@ def check_chain_present(iptables_path, module, params):
|
|
|
755
755
|
cmd = push_arguments(iptables_path, '-L', params, make_rule=False)
|
|
756
756
|
if module.params['numeric']:
|
|
757
757
|
cmd.append('--numeric')
|
|
758
|
-
rc,
|
|
758
|
+
rc, out, err = module.run_command(cmd, check_rc=False)
|
|
759
759
|
return (rc == 0)
|
|
760
760
|
|
|
761
761
|
|
|
@@ -895,33 +895,38 @@ def main():
|
|
|
895
895
|
delete_chain(iptables_path, module, module.params)
|
|
896
896
|
|
|
897
897
|
else:
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
if
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
898
|
+
# Create the chain if there are no rule arguments
|
|
899
|
+
if (args['state'] == 'present') and not args['rule']:
|
|
900
|
+
chain_is_present = check_chain_present(
|
|
901
|
+
iptables_path, module, module.params
|
|
902
|
+
)
|
|
903
|
+
args['changed'] = not chain_is_present
|
|
904
|
+
|
|
905
|
+
if (not chain_is_present and args['chain_management'] and not module.check_mode):
|
|
906
|
+
create_chain(iptables_path, module, module.params)
|
|
907
|
+
|
|
908
|
+
else:
|
|
909
|
+
insert = (module.params['action'] == 'insert')
|
|
910
|
+
rule_is_present = check_rule_present(
|
|
911
|
+
iptables_path, module, module.params
|
|
912
|
+
)
|
|
913
|
+
|
|
914
|
+
should_be_present = (args['state'] == 'present')
|
|
915
|
+
# Check if target is up to date
|
|
916
|
+
args['changed'] = (rule_is_present != should_be_present)
|
|
917
|
+
if args['changed'] is False:
|
|
918
|
+
# Target is already up to date
|
|
919
|
+
module.exit_json(**args)
|
|
920
|
+
|
|
921
|
+
# Modify if not check_mode
|
|
922
|
+
if not module.check_mode:
|
|
923
|
+
if should_be_present:
|
|
924
|
+
if insert:
|
|
925
|
+
insert_rule(iptables_path, module, module.params)
|
|
926
|
+
else:
|
|
927
|
+
append_rule(iptables_path, module, module.params)
|
|
921
928
|
else:
|
|
922
|
-
|
|
923
|
-
else:
|
|
924
|
-
remove_rule(iptables_path, module, module.params)
|
|
929
|
+
remove_rule(iptables_path, module, module.params)
|
|
925
930
|
|
|
926
931
|
module.exit_json(**args)
|
|
927
932
|
|
ansible/modules/known_hosts.py
CHANGED
|
@@ -11,7 +11,7 @@ DOCUMENTATION = r'''
|
|
|
11
11
|
module: known_hosts
|
|
12
12
|
short_description: Add or remove a host from the C(known_hosts) file
|
|
13
13
|
description:
|
|
14
|
-
- The
|
|
14
|
+
- The M(ansible.builtin.known_hosts) module lets you add or remove a host keys from the C(known_hosts) file.
|
|
15
15
|
- Starting at Ansible 2.2, multiple entries per host are allowed, but only one for each key type supported by ssh.
|
|
16
16
|
This is useful if you're going to want to use the M(ansible.builtin.git) module over ssh, for example.
|
|
17
17
|
- If you have a very large number of host keys to manage, you will find the M(ansible.builtin.template) module more useful.
|
|
@@ -22,19 +22,19 @@ options:
|
|
|
22
22
|
description:
|
|
23
23
|
- The host to add or remove (must match a host specified in key). It will be converted to lowercase so that ssh-keygen can find it.
|
|
24
24
|
- Must match with <hostname> or <ip> present in key attribute.
|
|
25
|
-
- For custom SSH port,
|
|
25
|
+
- For custom SSH port, O(name) needs to specify port as well. See example section.
|
|
26
26
|
type: str
|
|
27
27
|
required: true
|
|
28
28
|
key:
|
|
29
29
|
description:
|
|
30
30
|
- The SSH public host key, as a string.
|
|
31
|
-
- Required if
|
|
31
|
+
- Required if O(state=present), optional when O(state=absent), in which case all keys for the host are removed.
|
|
32
32
|
- The key must be in the right format for SSH (see sshd(8), section "SSH_KNOWN_HOSTS FILE FORMAT").
|
|
33
33
|
- Specifically, the key should not match the format that is found in an SSH pubkey file, but should rather have the hostname prepended to a
|
|
34
34
|
line that includes the pubkey, the same way that it would appear in the known_hosts file. The value prepended to the line must also match
|
|
35
35
|
the value of the name parameter.
|
|
36
36
|
- Should be of format C(<hostname[,IP]> ssh-rsa <pubkey>).
|
|
37
|
-
- For custom SSH port,
|
|
37
|
+
- For custom SSH port, O(key) needs to specify port as well. See example section.
|
|
38
38
|
type: str
|
|
39
39
|
path:
|
|
40
40
|
description:
|
|
@@ -50,8 +50,8 @@ options:
|
|
|
50
50
|
version_added: "2.3"
|
|
51
51
|
state:
|
|
52
52
|
description:
|
|
53
|
-
-
|
|
54
|
-
-
|
|
53
|
+
- V(present) to add the host key.
|
|
54
|
+
- V(absent) to remove it.
|
|
55
55
|
choices: [ "absent", "present" ]
|
|
56
56
|
default: "present"
|
|
57
57
|
type: str
|
|
@@ -111,7 +111,7 @@ import re
|
|
|
111
111
|
import tempfile
|
|
112
112
|
|
|
113
113
|
from ansible.module_utils.basic import AnsibleModule
|
|
114
|
-
from ansible.module_utils.
|
|
114
|
+
from ansible.module_utils.common.text.converters import to_bytes, to_native
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
def enforce_state(module, params):
|