ansible-role-borgbackup icon indicating copy to clipboard operation
ansible-role-borgbackup copied to clipboard

Support to copy config to management server for pruning?

Open stroobl opened this issue 4 years ago • 2 comments

With my previous Borg backup role (without Borgmatic - it didn't exist at the time we started using Attic), I had a secured management host where I did the pruning for all hosts configured in append only mode. Would you be interested to add a feature to this role that makes it possible to copy the config to such a management host?

I already did some tests and something like this should work:

- name: Copy config to management host (for pruning)
  template:
    src: config.yaml.j2
    dest: "{{ borgmatic_mgmt_host_path }}/{{ inventory_hostname }}.yaml"
    mode: 0600
  remote_user: "{{ borgmatic_mgmt_user }}"
  become: false
  delegate_to: "{{ borgmatic_mgmt_host }}"
  when: borgmatic_mgmt_host is defined

stroobl avatar Feb 02 '21 19:02 stroobl

I like the concept of mgmt hosts and we recommend it in conjunction with append-only repos.

Regarding the snippet: Don't you think this makes the role do too many things at once and it becomes a bit convoluted? Personally, I'd put it in my playbook. But hard to tell in this case.

m3nu avatar Feb 03 '21 09:02 m3nu

I don't think it's possible to access the config.yaml.j2 template included in the role from a post_task in the playbook in an elegant way?

stroobl avatar Feb 21 '21 13:02 stroobl