Disable certain user services

This commit is contained in:
2024-04-14 02:02:58 +02:00
parent 97409130ab
commit 7287ff76a5

View File

@@ -54,16 +54,21 @@
- "/home/{{ user.name }}/.config/systemd/" - "/home/{{ user.name }}/.config/systemd/"
- "/home/{{ user.name }}/.config/systemd/user/" - "/home/{{ user.name }}/.config/systemd/user/"
- name: stop xdg-user-dirs service - set_fact:
undesired_user_services:
- gpg-agent.socket
- gpg-agent-browser.socket
- gpg-agent-ssh.socket
- gpg-agent-extra.socket
- xdg-user-dirs-update.service
- gnome-keyring-daemon.service
- name: stop undesired service
systemd_service: systemd_service:
name: xdg-user-dirs-update.service name: "{{ item }}"
scope: user scope: user
state: stopped state: stopped
loop: "{{ undesired_user_services }}"
- name: remove xdg user directory configuration
file:
path: "/home/{{ user.name }}/.config/user-dirs.dirs"
state: absent
# No way to use the `systemd` module here, as it needs a logind # No way to use the `systemd` module here, as it needs a logind
# session. So we have to handle the symlinks for masking ourselves. # session. So we have to handle the symlinks for masking ourselves.
@@ -72,12 +77,7 @@
state: link state: link
dest: "/home/{{ user.name }}/.config/systemd/user/{{ item }}" dest: "/home/{{ user.name }}/.config/systemd/user/{{ item }}"
src: "/dev/null" src: "/dev/null"
with_items: loop: "{{ undesired_user_services }}"
- gpg-agent.socket
- gpg-agent-browser.socket
- gpg-agent-ssh.socket
- gpg-agent-extra.socket
- xdg-user-dirs-update.service
- name: create directory for getty autologin - name: create directory for getty autologin
file: file: