Add mbsync timer and service

This commit is contained in:
flyingscorpio@clevo 2023-04-06 19:55:57 +02:00
parent 426886fafc
commit 1ee9d56222
4 changed files with 44 additions and 0 deletions

View file

@ -0,0 +1,9 @@
[Unit]
Description=Mailbox synchronization service
[Service]
Type=oneshot
ExecStart=/usr/bin/mbsync -Va
[Install]
WantedBy=default.target

View file

@ -0,0 +1,10 @@
[Unit]
Description=Mailbox synchronization timer
[Timer]
OnBootSec=2m
OnUnitActiveSec=5m
Unit=mbsync.service
[Install]
WantedBy=timers.target

View file

@ -0,0 +1,5 @@
---
- name: Reload user systemd
ansible.builtin.systemd:
daemon-reload: true
scope: user

View file

@ -101,3 +101,23 @@
src: mbsyncrc.j2
dest: ~/.mbsyncrc
mode: 0644
- name: Copy mbsync service and timer
ansible.builtin.copy:
src: "{{ item }}"
dest: "~/.config/systemd/user/{{ item }}"
mode: 0644
with_items:
- mbsync.service
- mbsync.timer
notify: Reload user systemd
- name: Flush handlers
ansible.builtin.meta: flush_handlers
- name: Enable mbsync.timer
ansible.builtin.systemd:
name: mbsync.timer
enabled: true
state: started
scope: user