fix(kopia): update the bound home path from %h to ansible variable

update note:
- hotfix
- backups haven't run since commit '9f236b6fa5'
- the root service unit's %h always indicates root's home path
- backup service is verified
This commit is contained in:
2026-05-06 14:05:12 +09:00
parent 0f546e13b3
commit ed1058c400
@@ -21,9 +21,9 @@ ProtectHome=tmpfs
InaccessiblePaths=/boot /root InaccessiblePaths=/boot /root
{% if node['name'] == 'infra' %} {% if node['name'] == 'infra' %}
BindReadOnlyPaths=%h/containers/postgresql/backups BindReadOnlyPaths={{ node['home_path'] }}/containers/postgresql/backups
{% elif node['name'] == 'app' %} {% elif node['name'] == 'app' %}
BindReadOnlyPaths=%h/data BindReadOnlyPaths={{ node['home_path'] }}/data
{% endif %} {% endif %}
# In root namescope, %u always bring 0 # In root namescope, %u always bring 0
BindPaths=/etc/kopia BindPaths=/etc/kopia
@@ -38,10 +38,10 @@ ExecStartPre=/usr/bin/kopia repository connect server \
{% if node['name'] == 'infra' %} {% if node['name'] == 'infra' %}
ExecStart=/usr/bin/kopia snapshot create \ ExecStart=/usr/bin/kopia snapshot create \
/home/infra/containers/postgresql/backups {{ node['home_path'] }}/containers/postgresql/backups
{% elif node['name'] == 'app' %} {% elif node['name'] == 'app' %}
ExecStart=/usr/bin/kopia snapshot create \ ExecStart=/usr/bin/kopia snapshot create \
/home/app/data {{ node['home_path'] }}/data
{% endif %} {% endif %}