1
0
Fork 0
mirror of https://github.com/roles-ansible/ansible_role_restic.git synced 2024-12-11 23:41:32 +01:00

ADD: S3 compatibility

This commit is contained in:
Matthias Leutenegger 2019-12-17 14:19:25 +01:00
parent a70b578320
commit 8b0c016e7d
4 changed files with 23 additions and 6 deletions

View file

@ -3,6 +3,10 @@
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
and [human-readable changelog](https://keepachangelog.com/en/1.0.0/). and [human-readable changelog](https://keepachangelog.com/en/1.0.0/).
## Unreleased
### Added
* S3 Support
## 0.1.5 ## 0.1.5
### Changed ### Changed
* Path generation for `forget` task now checks if `src` is actually filled and not only defined. * Path generation for `forget` task now checks if `src` is actually filled and not only defined.
@ -34,4 +38,3 @@ and [human-readable changelog](https://keepachangelog.com/en/1.0.0/).
## 0.1.0 ## 0.1.0
### Added ### Added
* initial release * initial release

View file

@ -85,11 +85,13 @@ official [documentation](https://restic.readthedocs.io/en/stable/030_preparing_a
Available variables: Available variables:
| Name | Required | Description | | Name | Required | Description |
| ---------- |:--------:| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ----------------------- |:--------:| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `location` | yes | The location of the Backend. Currently, [Local](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#local) and [SFTP](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#sftp) are supported | | `location` | yes | The location of the Backend. Currently, [Local](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#local), [SFTP](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#sftp and [S3](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#amazon-s3) are supported |
| `password` | yes | The password used to secure this repository | | `password` | yes | The password used to secure this repository |
| `init` | no | Describes if the repository should be initialized or not. Use `false` if you are backuping to an already existing repo. | | `init` | no | Describes if the repository should be initialized or not. Use `false` if you are backuping to an already existing repo. |
| `aws_access_key` | no | The access key for the S3 backend |
| `aws_secret_access_key` | no | The secret access key for the S3 backend |
Example: Example:
```yaml ```yaml

View file

@ -4,6 +4,12 @@
export RESTIC_REPOSITORY={{ restic_repos[item.repo].location }} export RESTIC_REPOSITORY={{ restic_repos[item.repo].location }}
export RESTIC_PASSWORD={{ restic_repos[item.repo].password }} export RESTIC_PASSWORD={{ restic_repos[item.repo].password }}
{% if restic_repos[item.repo].aws_access_key is defined %}
AWS_ACCESS_KEY_ID={{ restic_repos[item.repo].aws_access_key }}
{% endif %}
{% if restic_repos[item.repo].aws_secret_access_key is defined %}
AWS_SECRET_ACCESS_KEY={{ restic_repos[item.repo].aws_secret_access_key }}
{% endif %}
BACKUP_NAME={{ item.name }} BACKUP_NAME={{ item.name }}
{% if item.src is defined %} {% if item.src is defined %}
BACKUP_SOURCE={{ item.src }} BACKUP_SOURCE={{ item.src }}

View file

@ -5,6 +5,12 @@
export RESTIC_REPOSITORY={{ restic_repos[item.repo].location }} export RESTIC_REPOSITORY={{ restic_repos[item.repo].location }}
export RESTIC_PASSWORD={{ restic_repos[item.repo].password }} export RESTIC_PASSWORD={{ restic_repos[item.repo].password }}
BACKUP_NAME={{ item.name }} BACKUP_NAME={{ item.name }}
{% if restic_repos[item.repo].aws_access_key is defined %}
AWS_ACCESS_KEY_ID={{ restic_repos[item.repo].aws_access_key }}
{% endif %}
{% if restic_repos[item.repo].aws_secret_access_key is defined %}
AWS_SECRET_ACCESS_KEY={{ restic_repos[item.repo].aws_secret_access_key }}
{% endif %}
{% if item.src is defined %} {% if item.src is defined %}
BACKUP_SOURCE={{ item.src }} BACKUP_SOURCE={{ item.src }}
{% endif %} {% endif %}