added more specific info about user scope (#72680)

in ref of #72674
This commit is contained in:
Brian Coca 2020-12-01 10:25:15 -05:00 committed by GitHub
parent a223ea5185
commit 276ad4f8f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,9 +60,11 @@ options:
description:
- run systemctl within a given service manager scope, either as the default system scope (system),
the current user's scope (user), or the scope of all users (global).
- "For systemd to work with 'user', the executing user must have its own instance of dbus started (systemd requirement).
The user dbus process is normally started during normal login, but not during the run of Ansible tasks.
- "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 ``XDG_RUNTIME_DIR`` variable, see example below.
type: str
choices: [ system, user, global ]
default: system
@ -124,6 +126,14 @@ EXAMPLES = '''
- name: Just force systemd to re-execute itself (2.8 and above)
systemd:
daemon_reexec: yes
- name: run a user service when XDG_RUNTIME_DIR is not set on remote login.
systemd:
name: myservice
state: started
scope: user
environment:
XDG_RUNTIME_DIR: "/run/user/{{ myuid }}"
'''
RETURN = '''