summaryrefslogtreecommitdiffstats
path: root/lib/ansible/modules/systemd.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-05 16:16:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-05 16:16:49 +0000
commit48e387c5c12026a567eb7b293a3a590241c0cecb (patch)
tree80f2573be2d7d534b8ac4d2a852fe43f7ac35324 /lib/ansible/modules/systemd.py
parentReleasing progress-linux version 2.16.6-1~progress7.99u1. (diff)
downloadansible-core-48e387c5c12026a567eb7b293a3a590241c0cecb.tar.xz
ansible-core-48e387c5c12026a567eb7b293a3a590241c0cecb.zip
Merging upstream version 2.17.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib/ansible/modules/systemd.py')
-rw-r--r--lib/ansible/modules/systemd.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/lib/ansible/modules/systemd.py b/lib/ansible/modules/systemd.py
index 7dec044..8340de3 100644
--- a/lib/ansible/modules/systemd.py
+++ b/lib/ansible/modules/systemd.py
@@ -3,8 +3,7 @@
# Copyright: (c) 2016, Brian Coca <bcoca@ansible.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
-from __future__ import absolute_import, division, print_function
-__metaclass__ = type
+from __future__ import annotations
DOCUMENTATION = '''
@@ -15,6 +14,8 @@ version_added: "2.2"
short_description: Manage systemd units
description:
- Controls systemd units (services, timers, and so on) on remote hosts.
+ - M(ansible.builtin.systemd) is renamed to M(ansible.builtin.systemd_service) to better reflect the scope of the module.
+ M(ansible.builtin.systemd) is kept as an alias for backward compatibility.
options:
name:
description:
@@ -28,11 +29,13 @@ options:
- V(started)/V(stopped) are idempotent actions that will not run commands unless necessary.
V(restarted) will always bounce the unit.
V(reloaded) will always reload and if the service is not running at the moment of the reload, it is started.
+ - If set, requires O(name).
type: str
choices: [ reloaded, restarted, started, stopped ]
enabled:
description:
- Whether the unit should start on boot. B(At least one of state and enabled are required.)
+ - If set, requires O(name).
type: bool
force:
description:
@@ -41,7 +44,8 @@ options:
version_added: 2.6
masked:
description:
- - Whether the unit should be masked or not, a masked unit is impossible to start.
+ - Whether the unit should be masked or not. A masked unit is impossible to start.
+ - If set, requires O(name).
type: bool
daemon_reload:
description:
@@ -64,7 +68,7 @@ options:
- "For systemd to work with 'user', the executing user must have its own instance of dbus started and accessible (systemd requirement)."
- "The user dbus process is normally started during normal login, but not during the run of Ansible tasks.
Otherwise you will probably get a 'Failed to connect to bus: no such file or directory' error."
- - The user must have access, normally given via setting the C(XDG_RUNTIME_DIR) variable, see example below.
+ - The user must have access, normally given via setting the C(XDG_RUNTIME_DIR) variable, see the example below.
type: str
choices: [ system, user, global ]
@@ -86,12 +90,11 @@ attributes:
platform:
platforms: posix
notes:
- - Since 2.4, one of the following options is required O(state), O(enabled), O(masked), O(daemon_reload), (O(daemon_reexec) since 2.8),
- and all except O(daemon_reload) and (O(daemon_reexec) since 2.8) also require O(name).
+ - O(state), O(enabled), O(masked) requires O(name).
- Before 2.4 you always required O(name).
- - Globs are not supported in name, i.e C(postgres*.service).
- - The service names might vary by specific OS/distribution
- - The order of execution when having multiple properties is to first enable/disable, then mask/unmask and then deal with service state.
+ - Globs are not supported in name, in other words, C(postgres*.service).
+ - The service names might vary by specific OS/distribution.
+ - The order of execution when having multiple properties is to first enable/disable, then mask/unmask and then deal with the service state.
It has been reported that systemctl can behave differently depending on the order of operations if you do the same manually.
requirements:
- A system managed by systemd.