Getting started

Example inventory

To configure rsnapshot on a host using the debops.rsnapshot role, that host needs to be included in the [debops_service_rsnapshot] Ansible inventory group:

[debops_service_rsnapshot]
hostname

By default the role will create only the configuration for its own host, but with the no_create_root option enabled - if the snapshot directory is not present, the snapshots will not be created. You can either create the host subdirectory in /var/cache/rsnapshot/hosts/ directory to enable the snapshots, or change the configuration to point the snapshot directory to removable media.

Example playbook

If you are using this role without DebOps, here's an example Ansible playbook that uses the debops.rsnapshot role:

---

- name: Manage rsnapshot service
  collections: [ 'debops.debops', 'debops.roles01',
                 'debops.roles02', 'debops.roles03' ]
  hosts: [ 'debops_service_rsnapshot' ]
  become: True

  environment: '{{ inventory__environment | d({})
                   | combine(inventory__group_environment | d({}))
                   | combine(inventory__host_environment  | d({})) }}'

  roles:

    - role: rsnapshot
      tags: [ 'role::rsnapshot', 'skip::rsnapshot' ]

Ansible tags

You can use Ansible --tags or --skip-tags parameters to limit what tasks are performed during Ansible run. This can be used after host is first configured to speed up playbook execution, when you are sure that most of the configuration has not been changed.

Available role tags:

role::rsnapshot

Main role tag, should be used in the playbook to execute all of the role tasks as well as role dependencies.

Other resources

List of other useful resources related to the debops.rsnapshot Ansible role: