diff --git a/ansible/roles/borgmatic/templates/config.yaml.j2 b/ansible/roles/borgmatic/templates/config.yaml.j2 index 16ce0e4..6bfb835 100644 --- a/ansible/roles/borgmatic/templates/config.yaml.j2 +++ b/ansible/roles/borgmatic/templates/config.yaml.j2 @@ -35,14 +35,14 @@ keep_yearly: {{ borgmatic_keep_yearly }} {% if borgmatic_postgresql_databases %} # PostgreSQL database backups (streamed via pg_dump) -{% if borgmatic_pg_dump_command is defined %} -pg_dump_command: {{ borgmatic_pg_dump_command }} -{% endif %} postgresql_databases: {% for db in borgmatic_postgresql_databases %} - name: {{ db.name }} hostname: {{ db.hostname | default('localhost') }} port: {{ db.port | default(5432) }} username: {{ db.username }} +{% if borgmatic_pg_dump_command is defined %} + pg_dump_command: {{ borgmatic_pg_dump_command }} +{% endif %} {% endfor %} {% endif %}