windmill-backup/playbooks/borg-server.yaml

43 lines
1.3 KiB
YAML

# Copyright 2019 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Install borg-server
hosts: borg-server:!disabled
tasks:
- name: Setup openstack.borgbackup role
include_role:
name: openstack.borgbackup
- name: Ensure /opt/backups exists
become: true
file:
path: /opt/backups
state: directory
mode: 0755
- name: Setup openstack.borgbackup role
include_role:
name: openstack.borgbackup
vars:
borgbackup_task_manager:
- pre
- config
borgbackup_user_name: "borg_{{ hostvars[borg_client].inventory_hostname_short }}"
borgbackup_user_home: "/opt/backups/borg_{{ hostvars[borg_client].inventory_hostname_short }}"
with_inventory_hostnames:
- borg-client:!disabled
loop_control:
loop_var: borg_client