From ab04cfc8d553913bfc6d9bc5bf9294aa55beaf49 Mon Sep 17 00:00:00 2001 From: Pig Monkey Date: Sat, 2 Apr 2016 14:19:11 -0700 Subject: [PATCH] only start git-annex if autostart file exists The service will fail otherwise. --- roles/git-annex/tasks/main.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/roles/git-annex/tasks/main.yml b/roles/git-annex/tasks/main.yml index 4f1837a..b6a7155 100644 --- a/roles/git-annex/tasks/main.yml +++ b/roles/git-annex/tasks/main.yml @@ -8,9 +8,13 @@ - reload systemd config - restart git-annex +- name: Check if git-annex autostart file exists + stat: path=/home/{{ user.name }}/.config/git-annex/autostart + register: autostart + - name: Enable and start git-annex assistant service service: name="git-annex@{{ user.name }}.service" enabled=yes state=started - when: gitannex is defined + when: gitannex is defined and autostart.stat is defined and autostart.stat.size > 0 - name: Disable and stop git-annex assistant service service: name="git-annex@{{ user.name }}.service" enabled=no state=stopped