use home dir directly

This commit is contained in:
2025-04-03 14:57:59 +02:00
parent f96e9dbecd
commit fe0b002258
2 changed files with 5 additions and 10 deletions

View File

@@ -11,7 +11,7 @@ StartLimitBurst=3
[Service] [Service]
Type=simple Type=simple
ExecStart=/usr/bin/seaf-daemon -c {{ seafile_local_user_info.home }}/.ccnet -d {{ seafile_local_user_info.home }}/config/seafile-data -w {{ seafile_local_user_info.home }}/config/seafile ExecStart=/usr/bin/seaf-daemon -c %h/.ccnet -d %h/config/seafile-data -w %h/config/seafile
Restart=always Restart=always
RestartSec=10 RestartSec=10
# Restart every day # Restart every day

View File

@@ -20,15 +20,9 @@
- seafile-cli - seafile-cli
become: false # need to do this as root become: false # need to do this as root
- name: Register user info of {{ seafile_local_user.user }}
user:
name: "{{ seafile_local_user.user }}"
check_mode: true
register: seafile_local_user_info
- name: Define directory for Seafile mirror service as fact - name: Define directory for Seafile mirror service as fact
set_fact: set_fact:
seafile_mirror_dir: "{{ seafile_local_user_info.home }}/seafile_mirror" seafile_mirror_dir: "~/seafile_mirror"
- name: Ensure directory for Seafile mirror service exists - name: Ensure directory for Seafile mirror service exists
file: file:
@@ -64,13 +58,13 @@
- name: Ensure Seafile config dir exists - name: Ensure Seafile config dir exists
file: file:
path: "{{ seafile_local_user_info.home }}/config" path: "~/config"
state: directory state: directory
mode: "0755" mode: "0755"
- name: Ensure Seafile config dir is initialised - name: Ensure Seafile config dir is initialised
command: command:
cmd: seaf-cli init -d "{{ seafile_local_user_info.home }}/config" cmd: seaf-cli init -d "~/config"
register: result register: result
changed_when: '"already exists" not in result.stdout' changed_when: '"already exists" not in result.stdout'
@@ -82,3 +76,4 @@
vars: vars:
user: "{{ seafile_local_user.user }}" user: "{{ seafile_local_user.user }}"
service: seaf-daemon service: seaf-daemon
copy_file: seaf-daemon.service