Skip to content

Commit

Permalink
debops.borgbackup role rebased from Alphix/debops
Browse files Browse the repository at this point in the history
- This commit is debops#2434 by Alphix
- Originally debops#835 by ypid
  • Loading branch information
tasosalvas committed Apr 23, 2024
1 parent 904b3ed commit b6a042f
Show file tree
Hide file tree
Showing 27 changed files with 3,218 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ Added
New DebOps roles
''''''''''''''''

- The :ref:`debops.borgbackup` role can be used to setup cluster-wide backups
using `BorgBackup`__.

.. __: https://www.borgbackup.org/

- The :ref:`debops.metricbeat` role, part of the Elastic stack, can be used to
install `Metricbeat`__, a service that can gather metrics and other non-log
data from other services and send them to Elasticsearch for processing.
Expand Down
3 changes: 3 additions & 0 deletions ansible/playbooks/layer/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
- name: Configure backup2l service
import_playbook: '../service/backup2l.yml'

- name: Configure borgbackup service
import_playbook: '../service/borgbackup.yml'

- name: Configure rsnapshot service
import_playbook: '../service/rsnapshot.yml'

Expand Down
42 changes: 42 additions & 0 deletions ansible/playbooks/service/borgbackup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
# Copyright (C) 2019-2023 Robin Schneider <[email protected]>
# Copyright (C) 2019-2023 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only

- name: Setup backup using borgbackup and borgmatic
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts:
- 'debops_service_borgbackup_server'
- 'debops_service_borgbackup_client'
- 'debops_service_borgbackup_controlled_client'
- 'debops_service_borgbackup_controller'

become: True

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

roles:

- role: secret
tags: [ 'role::secret', 'role::borgbackup' ]

- role: users
tags: [ 'role::users', 'skip::users' ]
users__dependent_accounts:
- '{{ borgbackup__users__dependent_accounts }}'

- role: authorized_keys
tags: [ 'role::authorized_keys', 'skip::authorized_keys' ]
authorized_keys__dependent_identities:
- '{{ borgbackup__authorized_keys__dependent_identities }}'

- role: sudo
tags: [ 'role::sudo', 'skip::sudo' ]
sudo__dependent_sudoers:
- '{{ borgbackup__sudo__dependent_sudoers }}'

- role: borgbackup
tags: [ 'role::borgbackup', 'skip::borgbackup' ]
20 changes: 20 additions & 0 deletions ansible/roles/borgbackup/COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
debops.borgbackup - Configure borgbackup to backup the system

Copyright (C) 2019-2023 Robin Schneider <[email protected]>
Copyright (C) 2023 David Härdeman <[email protected]>
Copyright (C) 2019-2023 DebOps https://debops.org/
SPDX-License-Identifier: GPL-3.0-only

This Ansible role is part of DebOps.

DebOps is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3, as
published by the Free Software Foundation.

DebOps is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with DebOps. If not, see https://www.gnu.org/licenses/.
Loading

0 comments on commit b6a042f

Please sign in to comment.