fix errors with missing TTY by switching to sudo method
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
- name: Install required dependencies
|
||||
ansible.builtin.apt:
|
||||
pkg:
|
||||
- systemd-container # necessary to use machinectl become_method
|
||||
- systemd-container # necessary to use machinectl
|
||||
install_recommends: false
|
||||
|
||||
- name: Register user info of {{ user }}
|
||||
@@ -65,4 +65,7 @@
|
||||
scope: user
|
||||
become: true
|
||||
become_user: "{{ user }}"
|
||||
become_method: community.general.machinectl # in order to get XDG_RUNTIME_DIR and user's DBUS session
|
||||
become_method: ansible.builtin.sudo
|
||||
environment:
|
||||
XDG_RUNTIME_DIR: "/run/user/{{ user_info.uid }}"
|
||||
DBUS_SESSION_BUS_ADDRESS: "unix:path=/run/user/{{ user_info.uid }}/bus"
|
||||
|
||||
Reference in New Issue
Block a user