diff options
-rw-r--r-- | group_vars/all/vars.yml | 2 | ||||
-rw-r--r-- | roles/radicale/templates/config.j2 | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/group_vars/all/vars.yml b/group_vars/all/vars.yml index 4536b9f..442bbab 100644 --- a/group_vars/all/vars.yml +++ b/group_vars/all/vars.yml @@ -163,6 +163,8 @@ radicale: home: /home/radicale etcdir: /usr/local/etc/radicale2 wwwdir: /usr/local/www/radicale2 + # Enable versioning with git + git: true users: - name: aly pass: "{{ vault_radicale_users_aly_pass }}" diff --git a/roles/radicale/templates/config.j2 b/roles/radicale/templates/config.j2 index 182cad1..8b23cd8 100644 --- a/roles/radicale/templates/config.j2 +++ b/roles/radicale/templates/config.j2 @@ -65,9 +65,12 @@ type = owner_only type = multifilesystem filesystem_folder = {{ radicale.home }} +{% if radicale.git %} +{% set git = "/usr/local/bin/git" %} # Command that is run after changes to storage # See: http://radicale.org/versioning/ -hook = ([ -d .git ] || /usr/local/bin/git init) && /usr/local/bin/git add -A && (/usr/local/bin/git diff --cached --quiet || /usr/local/bin/git commit -m "Changes by %(user)s") +hook = ([ -d .git ] || {{git}} init) && {{git}} add -A && ({{git}} diff --cached --quiet || {{git}} commit -m "Changes by %(user)s") +{% endif %} # Web interface backend |