diff --git a/ansible/roles/popequer_notebook/tasks/main.yaml b/ansible/roles/popequer_notebook/tasks/main.yaml index f7ec4d7..02cb237 100644 --- a/ansible/roles/popequer_notebook/tasks/main.yaml +++ b/ansible/roles/popequer_notebook/tasks/main.yaml @@ -6,6 +6,10 @@ ansible.builtin.git: repo: "git@forge.lefuturiste.fr:mbess/main-popequer-notebook.git" dest: /home/mbess/notebooks/personal +- name: Copy gitwatch script + template: + src: scripts/gitwatch.sh + dest: "{{ home }}/.local/bin/ppq_gitwatch" - name: Setup gitwatch systemd_service: scope: user diff --git a/ansible/templates/scripts/gitwatch.sh b/ansible/templates/scripts/gitwatch.sh new file mode 100644 index 0000000..33f0cde --- /dev/null +++ b/ansible/templates/scripts/gitwatch.sh @@ -0,0 +1,3 @@ +#!/usr/bin/sh + +/usr/bin/gitwatch -r -R origin -s 300 -m "docs: update from {{ device_name }}" {{ home }}/notebooks/$1 diff --git a/ansible/templates/systemd/user/popequer_gitwatch@.service b/ansible/templates/systemd/user/popequer_gitwatch@.service index 4b63431..1929673 100644 --- a/ansible/templates/systemd/user/popequer_gitwatch@.service +++ b/ansible/templates/systemd/user/popequer_gitwatch@.service @@ -4,7 +4,7 @@ Description=Sync popequer notebook with git [Service] # the buffer period in seconds 5min = 300s Type=simple -ExecStart=/usr/bin/gitwatch -r -R origin -s 300 -m "docs: update from {{ device_name }}" {{ home }}/notebooks/%i +ExecStart={{ home }}/.local/bin/gitwatch /%i ExecStop=/bin/true Restart=always RestartSec=30