giner / ansible-role-barman

Ansible role to Install and configure Barman on Linux with optional: regular backup (running by cron), wals and snapshots uploading to S3 (running by cron), metrics collection (by telegraf)
https://galaxy.ansible.com/giner/barman
Apache License 2.0
8 stars 5 forks source link

Support for defining custom cron jobs #3

Closed jabbors closed 2 years ago

jabbors commented 2 years ago

I have a use case where I'd like to manage custom cron jobs for each backup job, ie I'd want to backup the backups to another remote server using tools like borg or restic.

The configuration could look something like

- name: my-server
    params:
      - <irrelevant>
    pgpass:
      - <irrelevant>
    backup_schedule:
      cron:
        hour: 2
        minute: 11
      custom:
        job: 'borg create ssh://user@remote.server.com:/home/barman/my-server::$(date --iso-8601=date) /var/lib/barman/my-server'
        cron:
          hour: 3
          minute: 13

Do you think this would be useful? I can create a PR if you think it will be valuable for this module.

giner commented 2 years ago

Hi @jabbors,

Thank you for using the role and efforts in making it better. Your suggestion sounds reasonable to me.

jabbors commented 2 years ago

The custom section can even be a list. I'll wrap up a PR for this.

giner commented 2 years ago

Implemented with #6