adhawkins.borgbase.borgbase_repo module – Module for managing repos in borgbase.
Note
This module is part of the adhawkins.borgbase collection (version 1.0.3).
To install it, use: ansible-galaxy collection install adhawkins.borgbase
.
To use it in a playbook, specify: adhawkins.borgbase.borgbase_repo
.
New in adhawkins.borgbase 1.0.0
Synopsis
Module for managing repos in borgbase.
Parameters
Parameter |
Comments |
---|---|
Number of days to send alerts if no activity detected. Default: |
|
The borgbase API key. |
|
True if repo is append only. Choices:
|
|
List of keys for append only access. |
|
Version of borg to run on this repo. Choices:
|
|
The email address associated with the borgbase account. |
|
List of keys for full access. |
|
Repo name. |
|
The password for the borgbase account. |
|
Disk quota for this repo (MB). Default: |
|
Whether quota is enabled for this repo. Choices:
|
|
Repo region. Choices:
|
|
‘present’ to ensure the repo exists, ‘absent’ to ensure it doesn’t. Choices:
|
Examples
- name: Read key from file
slurp:
src: ~/.ssh/id_rsa.pub
register: ssh_key
check_mode: yes
- name: Create key
borgbase_ssh:
state: present
email: "{{ borgbase_email }}"
password: "{{ borgbase_password }}"
name: "{{ whoami.stdout }}@{{ ansible_hostname }}"
key: "{{ ssh_key['content'] | b64decode }}"
register: borgbase_key
- name: Create repo
borgbase_repo:
state: present
email: "{{ borgbase_email }}"
password: "{{ borgbase_password }}"
name: "{{ ansible_hostname }}"
full_access_keys: [ "{{ borgbase_key.key_id }}" ]
quota_enabled: false
alert_days: 1
register: borgbase_repo
- name: Set borgbase repo id
set_fact:
borgbackup_borgbase_repo: "{{ borgbase_repo.repo_id }}"
- name: Set borgbackup_ssh_host
set_fact:
borgbackup_ssh_host: "{{ borgbackup_borgbase_repo }}.repo.borgbase.com"
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The ID of the repo that was created or deleted. Returned: always |