Compare commits

...

3 Commits

Author SHA1 Message Date
f96e9dbecd remove unused submodule file 2025-04-03 14:50:21 +02:00
49581d9829 fix REUSE compliance 2025-04-03 14:49:41 +02:00
d66c55f2ab replace systemd user tasks with separated role 2025-04-03 14:49:07 +02:00
4 changed files with 13 additions and 36 deletions

4
.gitmodules vendored
View File

@@ -1,4 +0,0 @@
# SPDX-FileCopyrightText: 2023 Max Mehl <https://mehl.mx>
#
# SPDX-License-Identifier: Apache-2.0

View File

@@ -14,6 +14,7 @@ and makes sure all requirements and systemd jobs are set up properly.
## Requirements ## Requirements
* [ansible-role-users](https://src.mehl.mx/mxmehl/ansible-role-users) * [ansible-role-users](https://src.mehl.mx/mxmehl/ansible-role-users)
* [ansible-role-systemd-user](https://src.mehl.mx/mxmehl/ansible-role-systemd-user)
## Configure ## Configure

View File

@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2025 Max Mehl <https://mehl.mx>
#
# SPDX-License-Identifier: Apache-2.0
--- ---
seafile_cron: seafile_cron:
minute: "20" minute: "20"

View File

@@ -17,7 +17,6 @@
name: name:
- moreutils # chronic - moreutils # chronic
- pipx - pipx
- systemd-container # necessary to use machinectl become_method
- seafile-cli - seafile-cli
become: false # need to do this as root become: false # need to do this as root
@@ -63,18 +62,6 @@
month: "{{ seafile_cron.month }}" month: "{{ seafile_cron.month }}"
weekday: "{{ seafile_cron.weekday }}" weekday: "{{ seafile_cron.weekday }}"
- name: Ensure user systemd directory exists
file:
path: "{{ seafile_local_user_info.home }}/.config/systemd/user/"
state: directory
mode: "0755"
- name: Ensure systemd service file is present
template:
src: seaf-daemon.service.j2
dest: "{{ seafile_local_user_info.home }}/.config/systemd/user/seaf-daemon.service"
mode: "0644"
- name: Ensure Seafile config dir exists - name: Ensure Seafile config dir exists
file: file:
path: "{{ seafile_local_user_info.home }}/config" path: "{{ seafile_local_user_info.home }}/config"
@@ -87,22 +74,11 @@
register: result register: result
changed_when: '"already exists" not in result.stdout' changed_when: '"already exists" not in result.stdout'
- name: "Check whether user is lingering: {{ seafile_local_user.user }}" - name: Setup systemd user service
stat: include_role:
path: "/var/lib/systemd/linger/{{ seafile_local_user.user }}" name: systemd-user
register: seafile_local_user_lingering apply:
- name: Ensure systemd lingering is enabled for user {{ seafile_local_user.user }}
command: loginctl enable-linger {{ seafile_local_user.user }}
become: false become: false
changed_when: false vars:
when: not seafile_local_user_lingering.stat.exists user: "{{ seafile_local_user.user }}"
service: seaf-daemon
- name: Ensure systemd service is running and enabled
systemd:
name: seaf-daemon
state: started
enabled: true
daemon_reload: true
scope: user
become_method: community.general.machinectl # in order to get XDG_RUNTIME_DIR and user's DBUS session