@dwardoric @badnetmask dbus errors are typically due to lingering not being active, or XDG_RUNTIME_DIR not being set. But you had lingering active already, you said. Welcome to the wonderful world of systemd
It can work, but I’m afraid I can’t advise any more than what I already shared.
If all else fails, maybe you should try the latest Claude/Gemini/ChatPT LLM’s to let them come up with a minimal code example that is equivalent to what you’re trying to do.
davdr@fosstodon.org
@davdr@fosstodon.org
Posts
-
I know this is a long shot but: Is there a way to loop over a set of tasks in ansible and changing "remote_user" (not "become_user")? -
I know this is a long shot but: Is there a way to loop over a set of tasks in ansible and changing "remote_user" (not "become_user")?@dwardoric @badnetmask and yet this is what https://github.com/linux-system-roles/systemd does, no? Maybe your error is related to another issue?
-
I know this is a long shot but: Is there a way to loop over a set of tasks in ansible and changing "remote_user" (not "become_user")?@dwardoric could it be because systemd lingering was not enabled for that user?
Anyway, one way I used machinectl before (from the systemd-container package) is:
$ sudo machinectl shell myuser@
This should drop you in a shell for *myuser*, where you can execute systemctl commands like you would normally expect. For example:
$ systemctl --user list-units
-
I know this is a long shot but: Is there a way to loop over a set of tasks in ansible and changing "remote_user" (not "become_user")?@dwardoric check out https://github.com/linux-system-roles/systemd/blob/main/tasks/manage_units.yml where they so the same (probably) as what you need: use `become` with`become_user` and set `XDG_RUNTIME_DIR`