ansible-core 2.17.5rc1__py3-none-any.whl → 2.18.0rc1__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/__main__.py +2 -17
- ansible/cli/__init__.py +3 -15
- ansible/cli/config.py +187 -24
- ansible/cli/console.py +1 -1
- ansible/cli/doc.py +38 -16
- ansible/cli/galaxy.py +3 -49
- ansible/cli/inventory.py +2 -2
- ansible/cli/pull.py +2 -2
- ansible/cli/scripts/ansible_connection_cli_stub.py +1 -10
- ansible/config/base.yml +127 -57
- ansible/config/manager.py +89 -11
- ansible/constants.py +32 -9
- ansible/errors/__init__.py +5 -0
- ansible/executor/interpreter_discovery.py +1 -1
- ansible/executor/play_iterator.py +34 -0
- ansible/executor/playbook_executor.py +1 -4
- ansible/executor/powershell/become_wrapper.ps1 +4 -5
- ansible/executor/powershell/bootstrap_wrapper.ps1 +2 -3
- ansible/executor/powershell/exec_wrapper.ps1 +1 -1
- ansible/executor/powershell/module_manifest.py +2 -2
- ansible/executor/task_executor.py +50 -39
- ansible/executor/task_queue_manager.py +1 -1
- ansible/executor/task_result.py +1 -1
- ansible/galaxy/api.py +3 -4
- ansible/galaxy/collection/__init__.py +21 -10
- ansible/galaxy/collection/concrete_artifact_manager.py +10 -5
- ansible/galaxy/collection/galaxy_api_proxy.py +10 -16
- ansible/galaxy/collection/gpg.py +17 -23
- ansible/galaxy/data/COPYING +7 -0
- ansible/galaxy/data/apb/Dockerfile.j2 +1 -0
- ansible/galaxy/data/apb/Makefile.j2 +1 -0
- ansible/galaxy/data/apb/README.md +7 -3
- ansible/galaxy/data/apb/apb.yml.j2 +1 -0
- ansible/galaxy/data/apb/defaults/main.yml.j2 +1 -0
- ansible/galaxy/data/apb/handlers/main.yml.j2 +1 -0
- ansible/galaxy/data/apb/meta/main.yml.j2 +1 -0
- ansible/galaxy/data/apb/playbooks/deprovision.yml.j2 +1 -0
- ansible/galaxy/data/apb/playbooks/provision.yml.j2 +1 -0
- ansible/galaxy/data/apb/tasks/main.yml.j2 +1 -0
- ansible/galaxy/data/apb/tests/ansible.cfg +1 -0
- ansible/galaxy/data/apb/tests/inventory +1 -0
- ansible/galaxy/data/apb/tests/test.yml.j2 +1 -0
- ansible/galaxy/data/apb/vars/main.yml.j2 +1 -0
- ansible/galaxy/data/collections_galaxy_meta.yml +1 -0
- ansible/galaxy/data/container/defaults/main.yml.j2 +1 -0
- ansible/galaxy/data/container/handlers/main.yml.j2 +1 -0
- ansible/galaxy/data/container/meta/container.yml.j2 +1 -0
- ansible/galaxy/data/container/meta/main.yml.j2 +1 -0
- ansible/galaxy/data/container/tasks/main.yml.j2 +1 -0
- ansible/galaxy/data/container/tests/ansible.cfg +1 -0
- ansible/galaxy/data/container/tests/inventory +1 -0
- ansible/galaxy/data/container/tests/test.yml.j2 +1 -0
- ansible/galaxy/data/container/vars/main.yml.j2 +1 -0
- ansible/galaxy/data/default/collection/README.md.j2 +1 -0
- ansible/galaxy/data/default/collection/galaxy.yml.j2 +1 -0
- ansible/galaxy/data/default/collection/meta/runtime.yml +1 -0
- ansible/galaxy/data/default/collection/plugins/README.md.j2 +1 -0
- ansible/galaxy/data/default/role/defaults/main.yml.j2 +1 -0
- ansible/galaxy/data/default/role/handlers/main.yml.j2 +1 -0
- ansible/galaxy/data/default/role/meta/main.yml.j2 +1 -0
- ansible/galaxy/data/default/role/tasks/main.yml.j2 +1 -0
- ansible/galaxy/data/default/role/tests/inventory +1 -0
- ansible/galaxy/data/default/role/tests/test.yml.j2 +1 -0
- ansible/galaxy/data/default/role/vars/main.yml.j2 +1 -0
- ansible/galaxy/data/network/cliconf_plugins/example.py.j2 +1 -0
- ansible/galaxy/data/network/defaults/main.yml.j2 +1 -0
- ansible/galaxy/data/network/library/example_command.py.j2 +1 -0
- ansible/galaxy/data/network/library/example_config.py.j2 +1 -0
- ansible/galaxy/data/network/library/example_facts.py.j2 +1 -0
- ansible/galaxy/data/network/meta/main.yml.j2 +1 -0
- ansible/galaxy/data/network/module_utils/example.py.j2 +1 -0
- ansible/galaxy/data/network/netconf_plugins/example.py.j2 +1 -0
- ansible/galaxy/data/network/tasks/main.yml.j2 +1 -0
- ansible/galaxy/data/network/terminal_plugins/example.py.j2 +1 -0
- ansible/galaxy/data/network/tests/inventory +1 -0
- ansible/galaxy/data/network/tests/test.yml.j2 +1 -0
- ansible/galaxy/data/network/vars/main.yml.j2 +1 -0
- ansible/galaxy/dependency_resolution/providers.py +3 -3
- ansible/galaxy/role.py +1 -1
- ansible/galaxy/token.py +20 -8
- ansible/keyword_desc.yml +1 -1
- ansible/module_utils/_internal/__init__.py +0 -0
- ansible/module_utils/_internal/_concurrent/__init__.py +0 -0
- ansible/module_utils/_internal/_concurrent/_daemon_threading.py +28 -0
- ansible/module_utils/_internal/_concurrent/_futures.py +21 -0
- ansible/module_utils/ansible_release.py +2 -2
- ansible/module_utils/api.py +2 -2
- ansible/module_utils/basic.py +8 -8
- ansible/module_utils/common/collections.py +1 -1
- ansible/module_utils/common/file.py +0 -6
- ansible/module_utils/common/process.py +22 -9
- ansible/module_utils/common/text/converters.py +5 -8
- ansible/module_utils/common/text/formatters.py +20 -4
- ansible/module_utils/common/validation.py +33 -25
- ansible/module_utils/compat/paramiko.py +6 -1
- ansible/module_utils/compat/selinux.py +2 -2
- ansible/module_utils/connection.py +8 -24
- ansible/module_utils/csharp/Ansible.Become.cs +14 -25
- ansible/module_utils/csharp/Ansible.Process.cs +1 -1
- ansible/module_utils/distro/__init__.py +1 -1
- ansible/module_utils/distro/_distro.py +8 -4
- ansible/module_utils/facts/collector.py +2 -0
- ansible/module_utils/facts/default_collectors.py +3 -1
- ansible/module_utils/facts/hardware/aix.py +54 -52
- ansible/module_utils/facts/hardware/darwin.py +37 -34
- ansible/module_utils/facts/hardware/freebsd.py +55 -15
- ansible/module_utils/facts/hardware/hpux.py +3 -0
- ansible/module_utils/facts/hardware/linux.py +101 -57
- ansible/module_utils/facts/hardware/netbsd.py +3 -0
- ansible/module_utils/facts/hardware/openbsd.py +4 -1
- ansible/module_utils/facts/hardware/sunos.py +7 -1
- ansible/module_utils/facts/network/aix.py +16 -17
- ansible/module_utils/facts/network/fc_wwn.py +4 -1
- ansible/module_utils/facts/network/hpux.py +21 -4
- ansible/module_utils/facts/network/iscsi.py +7 -8
- ansible/module_utils/facts/network/linux.py +0 -2
- ansible/module_utils/facts/other/facter.py +9 -4
- ansible/module_utils/facts/other/ohai.py +5 -5
- ansible/module_utils/facts/packages.py +49 -7
- ansible/module_utils/facts/sysctl.py +33 -31
- ansible/module_utils/facts/system/distribution.py +2 -2
- ansible/module_utils/facts/system/local.py +12 -22
- ansible/module_utils/facts/system/service_mgr.py +3 -1
- ansible/module_utils/facts/system/systemd.py +47 -0
- ansible/module_utils/facts/timeout.py +1 -1
- ansible/module_utils/powershell/Ansible.ModuleUtils.AddType.psm1 +1 -1
- ansible/module_utils/powershell/Ansible.ModuleUtils.CamelConversion.psm1 +1 -1
- ansible/module_utils/splitter.py +1 -1
- ansible/modules/add_host.py +1 -1
- ansible/modules/apt.py +43 -32
- ansible/modules/apt_key.py +6 -6
- ansible/modules/apt_repository.py +23 -14
- ansible/modules/assemble.py +7 -2
- ansible/modules/assert.py +4 -4
- ansible/modules/blockinfile.py +3 -6
- ansible/modules/command.py +1 -1
- ansible/modules/copy.py +4 -4
- ansible/modules/cron.py +13 -10
- ansible/modules/deb822_repository.py +16 -17
- ansible/modules/debconf.py +25 -22
- ansible/modules/debug.py +1 -1
- ansible/modules/dnf.py +79 -164
- ansible/modules/dnf5.py +54 -29
- ansible/modules/dpkg_selections.py +2 -2
- ansible/modules/expect.py +2 -2
- ansible/modules/fetch.py +2 -2
- ansible/modules/file.py +5 -3
- ansible/modules/find.py +40 -12
- ansible/modules/gather_facts.py +4 -2
- ansible/modules/get_url.py +29 -24
- ansible/modules/git.py +35 -35
- ansible/modules/group.py +71 -1
- ansible/modules/hostname.py +2 -4
- ansible/modules/include_vars.py +5 -5
- ansible/modules/iptables.py +13 -16
- ansible/modules/known_hosts.py +16 -13
- ansible/modules/lineinfile.py +1 -4
- ansible/modules/meta.py +6 -1
- ansible/modules/mount_facts.py +651 -0
- ansible/modules/package_facts.py +63 -80
- ansible/modules/pause.py +4 -3
- ansible/modules/pip.py +14 -14
- ansible/modules/replace.py +1 -4
- ansible/modules/rpm_key.py +31 -11
- ansible/modules/service.py +8 -8
- ansible/modules/service_facts.py +20 -5
- ansible/modules/set_stats.py +1 -1
- ansible/modules/setup.py +3 -3
- ansible/modules/stat.py +3 -3
- ansible/modules/subversion.py +1 -1
- ansible/modules/systemd.py +16 -10
- ansible/modules/systemd_service.py +16 -10
- ansible/modules/sysvinit.py +4 -4
- ansible/modules/unarchive.py +35 -22
- ansible/modules/uri.py +24 -18
- ansible/modules/user.py +148 -13
- ansible/modules/validate_argument_spec.py +3 -3
- ansible/modules/wait_for_connection.py +2 -1
- ansible/modules/yum_repository.py +136 -179
- ansible/parsing/dataloader.py +2 -2
- ansible/parsing/mod_args.py +11 -10
- ansible/parsing/vault/__init__.py +8 -3
- ansible/parsing/yaml/constructor.py +10 -8
- ansible/parsing/yaml/objects.py +1 -1
- ansible/playbook/base.py +12 -23
- ansible/playbook/helpers.py +4 -0
- ansible/playbook/loop_control.py +8 -0
- ansible/playbook/play.py +4 -22
- ansible/playbook/play_context.py +0 -16
- ansible/playbook/playbook_include.py +2 -2
- ansible/playbook/role/__init__.py +2 -2
- ansible/plugins/__init__.py +2 -0
- ansible/plugins/action/__init__.py +7 -9
- ansible/plugins/action/dnf.py +7 -5
- ansible/plugins/action/package.py +5 -4
- ansible/plugins/action/reboot.py +2 -2
- ansible/plugins/become/__init__.py +1 -1
- ansible/plugins/callback/__init__.py +44 -3
- ansible/plugins/callback/default.py +1 -1
- ansible/plugins/cliconf/__init__.py +1 -1
- ansible/plugins/connection/paramiko_ssh.py +2 -80
- ansible/plugins/connection/psrp.py +33 -82
- ansible/plugins/connection/ssh.py +0 -8
- ansible/plugins/connection/winrm.py +46 -1
- ansible/plugins/doc_fragments/connection_pipelining.py +2 -2
- ansible/plugins/doc_fragments/constructed.py +10 -10
- ansible/plugins/doc_fragments/default_callback.py +8 -8
- ansible/plugins/doc_fragments/files.py +5 -5
- ansible/plugins/doc_fragments/inventory_cache.py +2 -2
- ansible/plugins/doc_fragments/result_format_callback.py +6 -6
- ansible/plugins/doc_fragments/return_common.py +1 -1
- ansible/plugins/doc_fragments/shell_common.py +2 -10
- ansible/plugins/doc_fragments/shell_windows.py +0 -9
- ansible/plugins/doc_fragments/url.py +2 -2
- ansible/plugins/doc_fragments/url_windows.py +4 -5
- ansible/plugins/doc_fragments/validate.py +1 -1
- ansible/plugins/filter/core.py +2 -0
- ansible/plugins/filter/human_to_bytes.yml +9 -0
- ansible/plugins/filter/password_hash.yml +1 -1
- ansible/plugins/filter/strftime.yml +1 -1
- ansible/plugins/filter/to_nice_json.yml +7 -3
- ansible/plugins/filter/to_uuid.yml +1 -1
- ansible/plugins/filter/unique.yml +28 -0
- ansible/plugins/inventory/script.py +1 -1
- ansible/plugins/list.py +1 -1
- ansible/plugins/loader.py +0 -11
- ansible/plugins/lookup/config.py +1 -1
- ansible/plugins/lookup/csvfile.py +21 -9
- ansible/plugins/lookup/env.py +8 -9
- ansible/plugins/lookup/ini.py +10 -1
- ansible/plugins/lookup/random_choice.py +2 -2
- ansible/plugins/lookup/url.py +7 -2
- ansible/plugins/shell/__init__.py +15 -20
- ansible/plugins/shell/powershell.py +9 -6
- ansible/plugins/strategy/__init__.py +18 -7
- ansible/plugins/strategy/linear.py +1 -13
- ansible/plugins/test/core.py +23 -1
- ansible/plugins/test/issubset.yml +1 -1
- ansible/plugins/test/subset.yml +1 -1
- ansible/plugins/test/timedout.yml +20 -0
- ansible/plugins/test/vault_encrypted.yml +6 -6
- ansible/plugins/test/vaulted_file.yml +19 -0
- ansible/release.py +2 -2
- ansible/template/__init__.py +3 -8
- ansible/utils/collection_loader/_collection_finder.py +23 -55
- ansible/utils/display.py +44 -31
- ansible/utils/galaxy.py +1 -1
- ansible/utils/jsonrpc.py +1 -1
- ansible/utils/listify.py +1 -5
- ansible/utils/path.py +3 -0
- ansible/utils/vars.py +18 -27
- ansible/vars/manager.py +7 -150
- ansible/vars/plugins.py +1 -1
- ansible_core-2.18.0rc1.dist-info/Apache-License.txt +202 -0
- {ansible_core-2.17.5rc1.dist-info → ansible_core-2.18.0rc1.dist-info}/METADATA +36 -23
- ansible_core-2.18.0rc1.dist-info/MIT-license.txt +14 -0
- ansible_core-2.18.0rc1.dist-info/PSF-license.txt +48 -0
- {ansible_core-2.17.5rc1.dist-info → ansible_core-2.18.0rc1.dist-info}/RECORD +321 -316
- {ansible_core-2.17.5rc1.dist-info → ansible_core-2.18.0rc1.dist-info}/entry_points.txt +1 -1
- ansible_core-2.18.0rc1.dist-info/simplified_bsd.txt +8 -0
- ansible_test/_data/completion/docker.txt +7 -7
- ansible_test/_data/completion/remote.txt +5 -4
- ansible_test/_data/completion/windows.txt +4 -4
- ansible_test/_data/requirements/ansible-test.txt +1 -2
- ansible_test/_data/requirements/constraints.txt +1 -2
- ansible_test/_data/requirements/sanity.ansible-doc.txt +3 -3
- ansible_test/_data/requirements/sanity.changelog.in +1 -1
- ansible_test/_data/requirements/sanity.changelog.txt +4 -4
- ansible_test/_data/requirements/sanity.import.plugin.txt +2 -2
- ansible_test/_data/requirements/sanity.import.txt +1 -1
- ansible_test/_data/requirements/sanity.integration-aliases.txt +1 -1
- ansible_test/_data/requirements/sanity.pep8.txt +1 -1
- ansible_test/_data/requirements/sanity.pylint.txt +6 -8
- ansible_test/_data/requirements/sanity.runtime-metadata.txt +2 -2
- ansible_test/_data/requirements/sanity.validate-modules.txt +3 -3
- ansible_test/_data/requirements/sanity.yamllint.in +1 -0
- ansible_test/_data/requirements/sanity.yamllint.txt +1 -1
- ansible_test/_internal/ansible_util.py +8 -35
- ansible_test/_internal/ci/azp.py +1 -1
- ansible_test/_internal/classification/__init__.py +0 -2
- ansible_test/_internal/cli/parsers/key_value_parsers.py +3 -0
- ansible_test/_internal/commands/integration/cloud/hcloud.py +1 -1
- ansible_test/_internal/commands/integration/cloud/httptester.py +1 -1
- ansible_test/_internal/commands/integration/cloud/nios.py +1 -1
- ansible_test/_internal/commands/sanity/__init__.py +96 -19
- ansible_test/_internal/commands/sanity/pylint.py +20 -24
- ansible_test/_internal/completion.py +2 -0
- ansible_test/_internal/constants.py +0 -1
- ansible_test/_internal/coverage_util.py +1 -2
- ansible_test/_internal/docker_util.py +10 -2
- ansible_test/_internal/encoding.py +4 -4
- ansible_test/_internal/host_configs.py +10 -0
- ansible_test/_internal/host_profiles.py +9 -13
- ansible_test/_internal/pypi_proxy.py +1 -1
- ansible_test/_internal/python_requirements.py +5 -14
- ansible_test/_internal/timeout.py +1 -1
- ansible_test/_internal/util.py +56 -8
- ansible_test/_internal/util_common.py +5 -1
- ansible_test/_util/controller/sanity/code-smell/action-plugin-docs.json +3 -1
- ansible_test/_util/controller/sanity/code-smell/action-plugin-docs.py +6 -3
- ansible_test/_util/controller/sanity/code-smell/empty-init.json +0 -2
- ansible_test/_util/controller/sanity/pylint/config/ansible-test-target.cfg +5 -0
- ansible_test/_util/controller/sanity/pylint/config/ansible-test.cfg +5 -0
- ansible_test/_util/controller/sanity/pylint/config/code-smell.cfg +5 -0
- ansible_test/_util/controller/sanity/pylint/config/collection.cfg +6 -0
- ansible_test/_util/controller/sanity/pylint/config/default.cfg +6 -0
- ansible_test/_util/controller/sanity/pylint/plugins/deprecated.py +1 -19
- ansible_test/_util/controller/sanity/pylint/plugins/hide_unraisable.py +3 -4
- ansible_test/_util/controller/sanity/shellcheck/exclude.txt +1 -0
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/main.py +67 -2
- ansible_test/_util/controller/sanity/validate-modules/validate_modules/schema.py +27 -5
- ansible_test/_util/target/cli/ansible_test_cli_stub.py +0 -0
- ansible_test/_util/target/common/constants.py +2 -2
- ansible_test/_util/target/injector/python.py +5 -0
- ansible_test/_util/target/pytest/plugins/ansible_pytest_coverage.py +6 -0
- ansible_test/_util/target/sanity/import/importer.py +1 -1
- ansible_test/_util/target/setup/bootstrap.sh +6 -17
- ansible_test/_util/target/setup/requirements.py +18 -24
- ansible_test/config/config.yml +1 -1
- ansible_core-2.17.5rc1.data/scripts/ansible-test +0 -44
- ansible_test/_data/requirements/sanity.mypy.in +0 -10
- ansible_test/_data/requirements/sanity.mypy.txt +0 -18
- ansible_test/_internal/commands/sanity/mypy.py +0 -274
- ansible_test/_util/controller/sanity/mypy/ansible-core.ini +0 -116
- ansible_test/_util/controller/sanity/mypy/ansible-test.ini +0 -27
- ansible_test/_util/controller/sanity/mypy/modules.ini +0 -92
- ansible_test/_util/controller/sanity/mypy/packaging.ini +0 -20
- {ansible_core-2.17.5rc1.dist-info → ansible_core-2.18.0rc1.dist-info}/COPYING +0 -0
- {ansible_core-2.17.5rc1.dist-info → ansible_core-2.18.0rc1.dist-info}/WHEEL +0 -0
- {ansible_core-2.17.5rc1.dist-info → ansible_core-2.18.0rc1.dist-info}/top_level.txt +0 -0
ansible/modules/user.py
CHANGED
|
@@ -37,19 +37,19 @@ options:
|
|
|
37
37
|
version_added: "2.6"
|
|
38
38
|
non_unique:
|
|
39
39
|
description:
|
|
40
|
-
- Optionally when used with the -u option, this option allows to change the user ID to a non-unique value.
|
|
40
|
+
- Optionally when used with the C(-u) option, this option allows to change the user ID to a non-unique value.
|
|
41
41
|
type: bool
|
|
42
42
|
default: no
|
|
43
43
|
version_added: "1.1"
|
|
44
44
|
seuser:
|
|
45
45
|
description:
|
|
46
|
-
- Optionally sets the seuser type (user_u) on
|
|
46
|
+
- Optionally sets the C(seuser) type C(user_u) on SELinux enabled systems.
|
|
47
47
|
type: str
|
|
48
48
|
version_added: "2.1"
|
|
49
49
|
group:
|
|
50
50
|
description:
|
|
51
51
|
- Optionally sets the user's primary group (takes a group name).
|
|
52
|
-
- On macOS, this defaults to V(
|
|
52
|
+
- On macOS, this defaults to V(staff).
|
|
53
53
|
type: str
|
|
54
54
|
groups:
|
|
55
55
|
description:
|
|
@@ -74,7 +74,8 @@ options:
|
|
|
74
74
|
Since Ansible 2.5, the default shell for non-system users on macOS is V(/bin/bash).
|
|
75
75
|
- On other operating systems, the default shell is determined by the underlying tool
|
|
76
76
|
invoked by this module. See Notes for a per platform list of invoked tools.
|
|
77
|
-
|
|
77
|
+
- From Ansible 2.18, the type is changed to I(path) from I(str).
|
|
78
|
+
type: path
|
|
78
79
|
home:
|
|
79
80
|
description:
|
|
80
81
|
- Optionally set the user's home directory.
|
|
@@ -95,7 +96,7 @@ options:
|
|
|
95
96
|
- To create an account with a locked/disabled password on OpenBSD, set this to V('*************').
|
|
96
97
|
- B(OS X/macOS:) Enter the cleartext password as the value. Be sure to take relevant security precautions.
|
|
97
98
|
- On macOS, the password specified in the C(password) option will always be set, regardless of whether the user account already exists or not.
|
|
98
|
-
- When the password is passed as an argument, the
|
|
99
|
+
- When the password is passed as an argument, the M(ansible.builtin.user) module will always return changed to C(true) for macOS systems.
|
|
99
100
|
Since macOS no longer provides access to the hashed passwords directly.
|
|
100
101
|
type: str
|
|
101
102
|
state:
|
|
@@ -153,7 +154,7 @@ options:
|
|
|
153
154
|
ssh_key_bits:
|
|
154
155
|
description:
|
|
155
156
|
- Optionally specify number of bits in SSH key to create.
|
|
156
|
-
- The default value depends on ssh-keygen.
|
|
157
|
+
- The default value depends on C(ssh-keygen).
|
|
157
158
|
type: int
|
|
158
159
|
version_added: "0.9"
|
|
159
160
|
ssh_key_type:
|
|
@@ -204,7 +205,7 @@ options:
|
|
|
204
205
|
- Lock the password (C(usermod -L), C(usermod -U), C(pw lock)).
|
|
205
206
|
- Implementation differs by platform. This option does not always mean the user cannot login using other methods.
|
|
206
207
|
- This option does not disable the user, only lock the password.
|
|
207
|
-
- This must be set to V(
|
|
208
|
+
- This must be set to V(false) in order to unlock a currently locked password. The absence of this parameter will not unlock a password.
|
|
208
209
|
- Currently supported on Linux, FreeBSD, DragonFlyBSD, NetBSD, OpenBSD.
|
|
209
210
|
type: bool
|
|
210
211
|
version_added: "2.6"
|
|
@@ -265,9 +266,32 @@ options:
|
|
|
265
266
|
description:
|
|
266
267
|
- Sets the umask of the user.
|
|
267
268
|
- Currently supported on Linux. Does nothing when used with other platforms.
|
|
268
|
-
- Requires O(local) is omitted or V(
|
|
269
|
+
- Requires O(local) is omitted or V(false).
|
|
269
270
|
type: str
|
|
270
271
|
version_added: "2.12"
|
|
272
|
+
password_expire_account_disable:
|
|
273
|
+
description:
|
|
274
|
+
- Number of days after a password expires until the account is disabled.
|
|
275
|
+
- Currently supported on AIX, Linux, NetBSD, OpenBSD.
|
|
276
|
+
type: int
|
|
277
|
+
version_added: "2.18"
|
|
278
|
+
uid_min:
|
|
279
|
+
description:
|
|
280
|
+
- Sets the UID_MIN value for user creation.
|
|
281
|
+
- Overwrites /etc/login.defs default value.
|
|
282
|
+
- Currently supported on Linux. Does nothing when used with other platforms.
|
|
283
|
+
- Requires O(local) is omitted or V(False).
|
|
284
|
+
type: int
|
|
285
|
+
version_added: "2.18"
|
|
286
|
+
uid_max:
|
|
287
|
+
description:
|
|
288
|
+
- Sets the UID_MAX value for user creation.
|
|
289
|
+
- Overwrites /etc/login.defs default value.
|
|
290
|
+
- Currently supported on Linux. Does nothing when used with other platforms.
|
|
291
|
+
- Requires O(local) is omitted or V(False).
|
|
292
|
+
type: int
|
|
293
|
+
version_added: "2.18"
|
|
294
|
+
|
|
271
295
|
extends_documentation_fragment: action_common_attributes
|
|
272
296
|
attributes:
|
|
273
297
|
check_mode:
|
|
@@ -356,6 +380,11 @@ EXAMPLES = r'''
|
|
|
356
380
|
ansible.builtin.user:
|
|
357
381
|
name: jane157
|
|
358
382
|
password_expire_warn: 30
|
|
383
|
+
|
|
384
|
+
- name: Set number of days after password expires until account is disabled
|
|
385
|
+
ansible.builtin.user:
|
|
386
|
+
name: jimholden2016
|
|
387
|
+
password_expire_account_disable: 15
|
|
359
388
|
'''
|
|
360
389
|
|
|
361
390
|
RETURN = r'''
|
|
@@ -582,9 +611,17 @@ class User(object):
|
|
|
582
611
|
self.password_expire_min = module.params['password_expire_min']
|
|
583
612
|
self.password_expire_warn = module.params['password_expire_warn']
|
|
584
613
|
self.umask = module.params['umask']
|
|
614
|
+
self.inactive = module.params['password_expire_account_disable']
|
|
615
|
+
self.uid_min = module.params['uid_min']
|
|
616
|
+
self.uid_max = module.params['uid_max']
|
|
585
617
|
|
|
586
|
-
if self.
|
|
587
|
-
|
|
618
|
+
if self.local:
|
|
619
|
+
if self.umask is not None:
|
|
620
|
+
module.fail_json(msg="'umask' can not be used with 'local'")
|
|
621
|
+
if self.uid_min is not None:
|
|
622
|
+
module.fail_json(msg="'uid_min' can not be used with 'local'")
|
|
623
|
+
if self.uid_max is not None:
|
|
624
|
+
module.fail_json(msg="'uid_max' can not be used with 'local'")
|
|
588
625
|
|
|
589
626
|
if module.params['groups'] is not None:
|
|
590
627
|
self.groups = ','.join(module.params['groups'])
|
|
@@ -757,6 +794,10 @@ class User(object):
|
|
|
757
794
|
else:
|
|
758
795
|
cmd.append(time.strftime(self.DATE_FORMAT, self.expires))
|
|
759
796
|
|
|
797
|
+
if self.inactive is not None:
|
|
798
|
+
cmd.append('-f')
|
|
799
|
+
cmd.append(int(self.inactive))
|
|
800
|
+
|
|
760
801
|
if self.password is not None:
|
|
761
802
|
cmd.append('-p')
|
|
762
803
|
if self.password_lock:
|
|
@@ -781,6 +822,14 @@ class User(object):
|
|
|
781
822
|
if self.system:
|
|
782
823
|
cmd.append('-r')
|
|
783
824
|
|
|
825
|
+
if self.uid_min is not None:
|
|
826
|
+
cmd.append('-K')
|
|
827
|
+
cmd.append('UID_MIN=' + str(self.uid_min))
|
|
828
|
+
|
|
829
|
+
if self.uid_max is not None:
|
|
830
|
+
cmd.append('-K')
|
|
831
|
+
cmd.append('UID_MAX=' + str(self.uid_max))
|
|
832
|
+
|
|
784
833
|
cmd.append(self.name)
|
|
785
834
|
(rc, out, err) = self.execute_command(cmd)
|
|
786
835
|
if not self.local or rc != 0:
|
|
@@ -946,6 +995,10 @@ class User(object):
|
|
|
946
995
|
cmd.append('-e')
|
|
947
996
|
cmd.append(time.strftime(self.DATE_FORMAT, self.expires))
|
|
948
997
|
|
|
998
|
+
if self.inactive is not None:
|
|
999
|
+
cmd.append('-f')
|
|
1000
|
+
cmd.append(self.inactive)
|
|
1001
|
+
|
|
949
1002
|
# Lock if no password or unlocked, unlock only if locked
|
|
950
1003
|
if self.password_lock and not info[1].startswith('!'):
|
|
951
1004
|
cmd.append('-L')
|
|
@@ -1322,7 +1375,9 @@ class User(object):
|
|
|
1322
1375
|
for d in dirs:
|
|
1323
1376
|
os.chown(os.path.join(root, d), uid, gid)
|
|
1324
1377
|
for f in files:
|
|
1325
|
-
os.
|
|
1378
|
+
full_path = os.path.join(root, f)
|
|
1379
|
+
if not os.path.islink(full_path):
|
|
1380
|
+
os.chown(full_path, uid, gid)
|
|
1326
1381
|
except OSError as e:
|
|
1327
1382
|
self.module.exit_json(failed=True, msg="%s" % to_native(e))
|
|
1328
1383
|
|
|
@@ -1444,6 +1499,14 @@ class FreeBsdUser(User):
|
|
|
1444
1499
|
else:
|
|
1445
1500
|
cmd.append(str(calendar.timegm(self.expires)))
|
|
1446
1501
|
|
|
1502
|
+
if self.uid_min is not None:
|
|
1503
|
+
cmd.append('-K')
|
|
1504
|
+
cmd.append('UID_MIN=' + str(self.uid_min))
|
|
1505
|
+
|
|
1506
|
+
if self.uid_max is not None:
|
|
1507
|
+
cmd.append('-K')
|
|
1508
|
+
cmd.append('UID_MAX=' + str(self.uid_max))
|
|
1509
|
+
|
|
1447
1510
|
# system cannot be handled currently - should we error if its requested?
|
|
1448
1511
|
# create the user
|
|
1449
1512
|
(rc, out, err) = self.execute_command(cmd)
|
|
@@ -1694,6 +1757,17 @@ class OpenBSDUser(User):
|
|
|
1694
1757
|
cmd.append('-K')
|
|
1695
1758
|
cmd.append('UMASK=' + self.umask)
|
|
1696
1759
|
|
|
1760
|
+
if self.inactive is not None:
|
|
1761
|
+
cmd.append('-f')
|
|
1762
|
+
cmd.append(self.inactive)
|
|
1763
|
+
if self.uid_min is not None:
|
|
1764
|
+
cmd.append('-K')
|
|
1765
|
+
cmd.append('UID_MIN=' + str(self.uid_min))
|
|
1766
|
+
|
|
1767
|
+
if self.uid_max is not None:
|
|
1768
|
+
cmd.append('-K')
|
|
1769
|
+
cmd.append('UID_MAX=' + str(self.uid_max))
|
|
1770
|
+
|
|
1697
1771
|
cmd.append(self.name)
|
|
1698
1772
|
return self.execute_command(cmd)
|
|
1699
1773
|
|
|
@@ -1764,6 +1838,10 @@ class OpenBSDUser(User):
|
|
|
1764
1838
|
cmd.append('-s')
|
|
1765
1839
|
cmd.append(self.shell)
|
|
1766
1840
|
|
|
1841
|
+
if self.inactive is not None:
|
|
1842
|
+
cmd.append('-f')
|
|
1843
|
+
cmd.append(self.inactive)
|
|
1844
|
+
|
|
1767
1845
|
if self.login_class is not None:
|
|
1768
1846
|
# find current login class
|
|
1769
1847
|
user_login_class = None
|
|
@@ -1860,6 +1938,10 @@ class NetBSDUser(User):
|
|
|
1860
1938
|
cmd.append('-p')
|
|
1861
1939
|
cmd.append(self.password)
|
|
1862
1940
|
|
|
1941
|
+
if self.inactive is not None:
|
|
1942
|
+
cmd.append('-f')
|
|
1943
|
+
cmd.append(self.inactive)
|
|
1944
|
+
|
|
1863
1945
|
if self.create_home:
|
|
1864
1946
|
cmd.append('-m')
|
|
1865
1947
|
|
|
@@ -1871,6 +1953,14 @@ class NetBSDUser(User):
|
|
|
1871
1953
|
cmd.append('-K')
|
|
1872
1954
|
cmd.append('UMASK=' + self.umask)
|
|
1873
1955
|
|
|
1956
|
+
if self.uid_min is not None:
|
|
1957
|
+
cmd.append('-K')
|
|
1958
|
+
cmd.append('UID_MIN=' + str(self.uid_min))
|
|
1959
|
+
|
|
1960
|
+
if self.uid_max is not None:
|
|
1961
|
+
cmd.append('-K')
|
|
1962
|
+
cmd.append('UID_MAX=' + str(self.uid_max))
|
|
1963
|
+
|
|
1874
1964
|
cmd.append(self.name)
|
|
1875
1965
|
return self.execute_command(cmd)
|
|
1876
1966
|
|
|
@@ -1946,6 +2036,10 @@ class NetBSDUser(User):
|
|
|
1946
2036
|
cmd.append('-L')
|
|
1947
2037
|
cmd.append(self.login_class)
|
|
1948
2038
|
|
|
2039
|
+
if self.inactive is not None:
|
|
2040
|
+
cmd.append('-f')
|
|
2041
|
+
cmd.append(self.inactive)
|
|
2042
|
+
|
|
1949
2043
|
if self.update_password == 'always' and self.password is not None and info[1] != self.password:
|
|
1950
2044
|
cmd.append('-p')
|
|
1951
2045
|
cmd.append(self.password)
|
|
@@ -2072,6 +2166,17 @@ class SunOS(User):
|
|
|
2072
2166
|
cmd.append('-R')
|
|
2073
2167
|
cmd.append(self.role)
|
|
2074
2168
|
|
|
2169
|
+
if self.inactive is not None:
|
|
2170
|
+
cmd.append('-f')
|
|
2171
|
+
cmd.append(self.inactive)
|
|
2172
|
+
if self.uid_min is not None:
|
|
2173
|
+
cmd.append('-K')
|
|
2174
|
+
cmd.append('UID_MIN=' + str(self.uid_min))
|
|
2175
|
+
|
|
2176
|
+
if self.uid_max is not None:
|
|
2177
|
+
cmd.append('-K')
|
|
2178
|
+
cmd.append('UID_MAX=' + str(self.uid_max))
|
|
2179
|
+
|
|
2075
2180
|
cmd.append(self.name)
|
|
2076
2181
|
|
|
2077
2182
|
(rc, out, err) = self.execute_command(cmd)
|
|
@@ -2189,6 +2294,10 @@ class SunOS(User):
|
|
|
2189
2294
|
cmd.append('-R')
|
|
2190
2295
|
cmd.append(self.role)
|
|
2191
2296
|
|
|
2297
|
+
if self.inactive is not None:
|
|
2298
|
+
cmd.append('-f')
|
|
2299
|
+
cmd.append(self.inactive)
|
|
2300
|
+
|
|
2192
2301
|
# modify the user if cmd will do anything
|
|
2193
2302
|
if cmd_len != len(cmd):
|
|
2194
2303
|
cmd.append(self.name)
|
|
@@ -2286,7 +2395,7 @@ class DarwinUser(User):
|
|
|
2286
2395
|
|
|
2287
2396
|
super(DarwinUser, self).__init__(module)
|
|
2288
2397
|
|
|
2289
|
-
# make the user hidden if option is set or
|
|
2398
|
+
# make the user hidden if option is set or defer to system option
|
|
2290
2399
|
if self.hidden is None:
|
|
2291
2400
|
if self.system:
|
|
2292
2401
|
self.hidden = 1
|
|
@@ -2674,6 +2783,17 @@ class AIX(User):
|
|
|
2674
2783
|
cmd.append('-K')
|
|
2675
2784
|
cmd.append('UMASK=' + self.umask)
|
|
2676
2785
|
|
|
2786
|
+
if self.inactive is not None:
|
|
2787
|
+
cmd.append('-f')
|
|
2788
|
+
cmd.append(self.inactive)
|
|
2789
|
+
if self.uid_min is not None:
|
|
2790
|
+
cmd.append('-K')
|
|
2791
|
+
cmd.append('UID_MIN=' + str(self.uid_min))
|
|
2792
|
+
|
|
2793
|
+
if self.uid_max is not None:
|
|
2794
|
+
cmd.append('-K')
|
|
2795
|
+
cmd.append('UID_MAX=' + str(self.uid_max))
|
|
2796
|
+
|
|
2677
2797
|
cmd.append(self.name)
|
|
2678
2798
|
(rc, out, err) = self.execute_command(cmd)
|
|
2679
2799
|
|
|
@@ -2742,6 +2862,10 @@ class AIX(User):
|
|
|
2742
2862
|
cmd.append('-s')
|
|
2743
2863
|
cmd.append(self.shell)
|
|
2744
2864
|
|
|
2865
|
+
if self.inactive is not None:
|
|
2866
|
+
cmd.append('-f')
|
|
2867
|
+
cmd.append(self.inactive)
|
|
2868
|
+
|
|
2745
2869
|
# skip if no changes to be made
|
|
2746
2870
|
if len(cmd) == 1:
|
|
2747
2871
|
(rc, out, err) = (None, '', '')
|
|
@@ -3006,6 +3130,14 @@ class BusyBox(User):
|
|
|
3006
3130
|
if self.system:
|
|
3007
3131
|
cmd.append('-S')
|
|
3008
3132
|
|
|
3133
|
+
if self.uid_min is not None:
|
|
3134
|
+
cmd.append('-K')
|
|
3135
|
+
cmd.append('UID_MIN=' + str(self.uid_min))
|
|
3136
|
+
|
|
3137
|
+
if self.uid_max is not None:
|
|
3138
|
+
cmd.append('-K')
|
|
3139
|
+
cmd.append('UID_MAX=' + str(self.uid_max))
|
|
3140
|
+
|
|
3009
3141
|
cmd.append(self.name)
|
|
3010
3142
|
|
|
3011
3143
|
rc, out, err = self.execute_command(cmd)
|
|
@@ -3115,7 +3247,7 @@ def main():
|
|
|
3115
3247
|
groups=dict(type='list', elements='str'),
|
|
3116
3248
|
comment=dict(type='str'),
|
|
3117
3249
|
home=dict(type='path'),
|
|
3118
|
-
shell=dict(type='
|
|
3250
|
+
shell=dict(type='path'),
|
|
3119
3251
|
password=dict(type='str', no_log=True),
|
|
3120
3252
|
login_class=dict(type='str'),
|
|
3121
3253
|
password_expire_max=dict(type='int', no_log=False),
|
|
@@ -3150,6 +3282,9 @@ def main():
|
|
|
3150
3282
|
authorization=dict(type='str'),
|
|
3151
3283
|
role=dict(type='str'),
|
|
3152
3284
|
umask=dict(type='str'),
|
|
3285
|
+
password_expire_account_disable=dict(type='int', no_log=False),
|
|
3286
|
+
uid_min=dict(type='int'),
|
|
3287
|
+
uid_max=dict(type='int'),
|
|
3153
3288
|
),
|
|
3154
3289
|
supports_check_mode=True,
|
|
3155
3290
|
)
|
|
@@ -16,11 +16,11 @@ version_added: "2.11"
|
|
|
16
16
|
options:
|
|
17
17
|
argument_spec:
|
|
18
18
|
description:
|
|
19
|
-
- A dictionary like AnsibleModule argument_spec. See R(argument spec definition,argument_spec)
|
|
19
|
+
- A dictionary like AnsibleModule argument_spec. See R(argument spec definition,argument_spec).
|
|
20
20
|
required: true
|
|
21
21
|
provided_arguments:
|
|
22
22
|
description:
|
|
23
|
-
- A dictionary of the arguments that will be validated according to argument_spec
|
|
23
|
+
- A dictionary of the arguments that will be validated according to argument_spec.
|
|
24
24
|
author:
|
|
25
25
|
- Ansible Core Team
|
|
26
26
|
extends_documentation_fragment:
|
|
@@ -51,7 +51,7 @@ attributes:
|
|
|
51
51
|
EXAMPLES = r'''
|
|
52
52
|
- name: verify vars needed for this task file are present when included
|
|
53
53
|
ansible.builtin.validate_argument_spec:
|
|
54
|
-
|
|
54
|
+
argument_spec: '{{ required_data }}'
|
|
55
55
|
vars:
|
|
56
56
|
required_data:
|
|
57
57
|
# unlike spec file, just put the options in directly
|
|
@@ -14,7 +14,8 @@ description:
|
|
|
14
14
|
- Waits for a total of O(timeout) seconds.
|
|
15
15
|
- Retries the transport connection after a timeout of O(connect_timeout).
|
|
16
16
|
- Tests the transport connection every O(sleep) seconds.
|
|
17
|
-
- This module makes use of internal ansible transport (and configuration) and the ping/win_ping
|
|
17
|
+
- This module makes use of internal ansible transport (and configuration) and the M(ansible.builtin.ping)/M(ansible.windows.win_ping)
|
|
18
|
+
modules to guarantee correct end-to-end functioning.
|
|
18
19
|
- This module is also supported for Windows targets.
|
|
19
20
|
version_added: '2.3'
|
|
20
21
|
options:
|