diff --git a/playbook.yml b/playbook.yml index e109168..08d3fd9 100644 --- a/playbook.yml +++ b/playbook.yml @@ -35,7 +35,7 @@ - { role: macbook, tags: ['macbook'], when: "'MacBook' in ansible_product_name" } - { role: screensaver, tags: ['screensaver'] } - { role: chat, tags: ['chat'] } - - { role: git-annex, tags: ['git-annex'] } + - { role: git-annex, tags: ['git-annex'], when: "gitannex is defined" } - { role: ledger, tags: ['ledger'] } - { role: mail, tags: ['mail'] } - { role: cups, tags: ['cups'] } diff --git a/roles/git-annex/tasks/main.yml b/roles/git-annex/tasks/main.yml index 03fa990..64aa5ca 100644 --- a/roles/git-annex/tasks/main.yml +++ b/roles/git-annex/tasks/main.yml @@ -14,26 +14,21 @@ - name: Enable and start git-annex assistant service service: name="git-annex@{{ user.name }}.service" enabled=yes state=started - 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 - when: gitannex is not defined + when: autostart.stat is defined and autostart.stat.size > 0 - name: Add git-annex to trusted unit list lineinfile: dest=/usr/local/etc/trusted_units state=present line="git-annex@{{ user.name }}.service,allow_offline" - when: gitannex is defined and gitannex.stop_on_untrusted is defined and gitannex.stop_on_untrusted == True + when: gitannex.stop_on_untrusted is defined and gitannex.stop_on_untrusted == True - name: Remove git-annex from trusted unit list lineinfile: dest=/usr/local/etc/trusted_units state=absent line="git-annex@{{ user.name }}.service,allow_offline" - when: gitannex is not defined or gitannex.stop_on_untrusted is not defined or gitannex.stop_on_untrusted != True + when: gitannex.stop_on_untrusted is not defined or gitannex.stop_on_untrusted != True - name: Increase the amount of inotify watchers copy: src=99-max_watches.conf dest=/etc/sysctl.d/99-max_watches.conf - when: gitannex is defined notify: - reload sysctl