better git-annex config options

This commit is contained in:
Pig Monkey 2016-01-30 14:17:47 -08:00
parent 9e362a2999
commit d55cc7d734
3 changed files with 16 additions and 5 deletions

View file

@ -215,9 +215,10 @@ activated when there are no active network connections. This allows the
git-annex assistant to be used when on trusted networks and when offline, but
not when on untrusted networks.
If the `gitannex.stopped_on` variable is set to anything other than
`untrusted`, the NetworkManager dispatchers will not be installed, resulting in
the git-annex assistant service not being stopped on untrusted networks.
If the `gitannex.stop_on_untrusted` variable is set to anything other than
`True` or is not defined, the git-annex unit will not be added to the trusted
unit file, resulting in the git-annex assistant not being stopped on untrusted
networks.
## Known Issues

View file

@ -84,7 +84,7 @@ tarsnapper:
run_on: trusted
gitannex:
stopped_on: untrusted
stop_on_untrusted: True
bitlbee:
run_on: trusted

View file

@ -9,8 +9,18 @@
service: name="git-annex@{{ user.name }}.service" enabled=yes state=started
when: gitannex is defined
- name: Disable and stop git-annex assistant service
service: name="git-annex@{{ user.name }}.service" enabled=no state=stopped
when: gitannex is not defined
- 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.stopped_on == "untrusted"
when: gitannex is defined and 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