161 lines
4.7 KiB
Markdown
161 lines
4.7 KiB
Markdown
# Ansible role: Bareos
|
|
|
|
[](https://git.yaegashi.fr/nishiki/ansible-role-bareos/releases)
|
|
[](https://git.yaegashi.fr/nishiki/ansible-role-bareos/src/branch/master/LICENSE)
|
|
|
|
Install and configure the bareos client, server and storage
|
|
|
|
## Requirements
|
|
|
|
* Ansible >= 2.9
|
|
* Debian Buster
|
|
|
|
## Role variables
|
|
|
|
## General
|
|
|
|
* `bareos_version` - the bareos version to install (default: `19.2`)
|
|
* `bareos_distribution_major_version` - (default: `{{ ansible_distribution_major_version }}`)
|
|
* `bareos_server_name` - the bareos server name (default: `bareos`)
|
|
* `bareos_server_password` - the bareos server password
|
|
|
|
## Client
|
|
|
|
* `bareos_client` - install bareos client (default: `true`)
|
|
* `bareos_client_name` - set the client name (default: `{{ inventory_hostname_short }}`)
|
|
* `bareos_client_max_concurrent_jobs` - set the number max concurrent job (default: `2`)
|
|
|
|
### Server
|
|
|
|
* `bareos_server` - install bareos directory (default: `false`)
|
|
* `bareos_server_max_concurrent_jobs` - set the number max concurrent jobs (default: `10`)
|
|
* `bareos_server_heartbeat_interval` - set the heartbeat interval (default: `1 min`)
|
|
* `bareos_server_console_password` - set the console password
|
|
* `bareos_server_database_type` - set the database type: sqlite3 or postgresql (default: `postgresql`)
|
|
* `bareos_server_database_name` - set the database name (default: `bareos`)
|
|
* `bareos_server_database_user` - set the database user (default: `bareos`)
|
|
* `bareos_server_database_host` - set the database host
|
|
* `bareos_server_database_password` - set the database password
|
|
* `bareos_server_filesets` - hash with the filesets definitions (see all fileset options in [bareos documentation](https://docs.bareos.org/Configuration/Director.html#fileset-options-ressource)
|
|
|
|
```yaml
|
|
root:
|
|
paths:
|
|
- /
|
|
options:
|
|
compression: GZIP
|
|
excludes:
|
|
- /proc
|
|
- /sys
|
|
```
|
|
|
|
* `bareos_server_clients` - hash with the client definitions
|
|
|
|
```yaml
|
|
localhost:
|
|
address: localhost
|
|
password: secret
|
|
retention: '14 days'
|
|
jobs:
|
|
restore:
|
|
name: Restore
|
|
type: Restore
|
|
storage: local_storage
|
|
fileset: root
|
|
full:
|
|
level: Full
|
|
schedule: full_and_incr
|
|
storage: local_storage
|
|
fileset: root
|
|
maximum_bandwidth: 5Mb/s
|
|
incremental:
|
|
level: Incremental
|
|
schedule: full_and_incr
|
|
storage: local_storage
|
|
fileset: root
|
|
```
|
|
|
|
* `bareos_server_storages` - hash with the storage definitions
|
|
|
|
```yaml
|
|
local_storage:
|
|
address: 127.0.0.1
|
|
password: secret
|
|
device: file_storage
|
|
```
|
|
|
|
* `bareos_server_schedules` - hash with the schedules definitions
|
|
|
|
```yaml
|
|
full_and_incr:
|
|
- Level=Full sun at 0:05
|
|
- Level=Incremental mon-sat at 3:05
|
|
```
|
|
|
|
* `bareos_server_profiles` - hash with the ACL user's profiles
|
|
|
|
```yaml
|
|
sysadmin:
|
|
Command: all
|
|
Job: all
|
|
Schedule: all
|
|
Catalog: all
|
|
Pool: all
|
|
Storage: all
|
|
Client: all
|
|
FileSet: all
|
|
Where: all
|
|
```
|
|
|
|
* `bareos_server_users` - hash with the users to connect bareos
|
|
|
|
```yaml
|
|
admin:
|
|
password: secret
|
|
profile: sysadmin
|
|
```
|
|
|
|
### Storage
|
|
|
|
* `bareos_storage` - install bareos storage (default: `false`)
|
|
* `bareos_storage_name` - set the storage name (default: `{{ inventory_hostname_short }}`)
|
|
* `bareos_storage_max_concurrent_jobs` - set the number max concurrent jobs (default: `10`)
|
|
* `bareos_storage_devices` - hash with the storage devices (see all options in [bareos documentation](https://docs.bareos.org/Configuration/StorageDaemon.html#device-resource)
|
|
|
|
```yaml
|
|
file_storage:
|
|
MediaType: File
|
|
ArchiveDevice: /var/lib/bareos/storage
|
|
AutomaticMount: 'yes'
|
|
RandomAccess: 'yes'
|
|
AlwaysOpen: 'yes'
|
|
LabelMedia: 'yes'
|
|
```
|
|
|
|
## Development
|
|
|
|
### Test with molecule and docker
|
|
|
|
* install [docker](https://docs.docker.com/engine/installation/)
|
|
* install `python3` and `python3-pip`
|
|
* install molecule and dependencies `pip3 install molecule molecule-docker docker ansible-lint pytest-testinfra yamllint`
|
|
* run `molecule test`
|
|
|
|
## License
|
|
|
|
```yaml
|
|
Copyright (c) 2021 Adrien Waksberg
|
|
|
|
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.
|
|
```
|