turn into installing seafile-mirror via pip(x)
This commit is contained in:
@@ -16,11 +16,19 @@
|
||||
apt:
|
||||
name:
|
||||
- moreutils # chronic
|
||||
- python3-yaml
|
||||
- pipx
|
||||
- systemd-container # necessary to use machinectl become_method
|
||||
- seafile-cli
|
||||
become: false # need to do this as root
|
||||
|
||||
- name: Install seafile-mirror with pipx
|
||||
command: pipx install seafile-mirror
|
||||
changed_when: false
|
||||
|
||||
- name: Upgrade seafile-mirror with pipx
|
||||
command: pipx upgrade seafile-mirror
|
||||
changed_when: false
|
||||
|
||||
- name: Register user info of {{ seafile_local_user.user }}
|
||||
user:
|
||||
name: "{{ seafile_local_user.user }}"
|
||||
@@ -33,24 +41,11 @@
|
||||
|
||||
- name: Ensure directory for Seafile mirror service exists
|
||||
file:
|
||||
path: "{{ seafile_mirror_dir }}/functions"
|
||||
path: "{{ seafile_mirror_dir }}"
|
||||
state: directory
|
||||
mode: 0755
|
||||
recurse: true
|
||||
|
||||
- name: Ensure Seafile mirror script and its functions exists
|
||||
copy:
|
||||
src: "seafile-mirror/{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: 0755
|
||||
loop:
|
||||
- {src: "seafile_mirror.py", dest: "{{ seafile_mirror_dir }}/"}
|
||||
- {src: "functions/__init__.py", dest: '{{ seafile_mirror_dir }}/functions/'}
|
||||
- {src: "functions/cachedb.py", dest: '{{ seafile_mirror_dir }}/functions/'}
|
||||
- {src: "functions/helpers.py", dest: '{{ seafile_mirror_dir }}/functions/'}
|
||||
- {src: "functions/seafile.py", dest: '{{ seafile_mirror_dir }}/functions/'}
|
||||
|
||||
|
||||
- name: Ensure Seafile mirror configuration exists
|
||||
template:
|
||||
src: seafile_mirror.conf.yaml.j2
|
||||
@@ -60,7 +55,7 @@
|
||||
- name: Ensure cron entry for Seafile mirror service
|
||||
cron:
|
||||
name: Seafile Mirror Service
|
||||
job: "chronic python3 {{ seafile_mirror_dir }}/seafile_mirror.py -c {{ seafile_mirror_dir }} -v"
|
||||
job: "chronic pipx run seafile-mirror -c {{ seafile_mirror_dir }} -v"
|
||||
hour: "23"
|
||||
minute: "20"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user