mirror of
https://github.com/roles-ansible/ansible_role_restic/
synced 2024-11-12 14:50:19 +01:00
Merge pull request #10 from arillso/use-regex-escape
Escape Restic Password correctly
This commit is contained in:
commit
700853b170
3 changed files with 7 additions and 4 deletions
|
@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|||
and [human-readable changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
## Unreleased
|
||||
### Changed
|
||||
* Password now use `regex_escape()` filter in templates
|
||||
|
||||
## [0.2.5] - 2020-06-02
|
||||
### Fixed:
|
||||
* AWS credentials are now supplied to the initialising step
|
||||
|
|
|
@ -4,12 +4,12 @@
|
|||
# Source this file to work with restic on this host
|
||||
|
||||
export RESTIC_REPOSITORY={{ restic_repos[item.repo].location }}
|
||||
export RESTIC_PASSWORD={{ restic_repos[item.repo].password }}
|
||||
export RESTIC_PASSWORD='{{ restic_repos[item.repo].password | regex_replace('\'', '\'\\\'\'') }}'
|
||||
{% if restic_repos[item.repo].aws_access_key is defined %}
|
||||
export AWS_ACCESS_KEY_ID={{ restic_repos[item.repo].aws_access_key }}
|
||||
{% endif %}
|
||||
{% if restic_repos[item.repo].aws_secret_access_key is defined %}
|
||||
export AWS_SECRET_ACCESS_KEY={{ restic_repos[item.repo].aws_secret_access_key }}
|
||||
export AWS_SECRET_ACCESS_KEY='{{ restic_repos[item.repo].aws_secret_access_key | regex_replace('\'', '\'\\\'\'') }}'
|
||||
{% endif %}
|
||||
{% if restic_repos[item.repo].aws_default_region is defined %}
|
||||
export AWS_DEFAULT_REGION={{ restic_repos[item.repo].aws_default_region }}
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
# Use this file to create a Backup and prune existing data with one execution.
|
||||
|
||||
export RESTIC_REPOSITORY={{ restic_repos[item.repo].location }}
|
||||
export RESTIC_PASSWORD={{ restic_repos[item.repo].password }}
|
||||
export RESTIC_PASSWORD='{{ restic_repos[item.repo].password | regex_replace('\'', '\'\\\'\'') }}'
|
||||
BACKUP_NAME={{ item.name }}
|
||||
{% if restic_repos[item.repo].aws_access_key is defined %}
|
||||
export AWS_ACCESS_KEY_ID={{ restic_repos[item.repo].aws_access_key }}
|
||||
{% endif %}
|
||||
{% if restic_repos[item.repo].aws_secret_access_key is defined %}
|
||||
export AWS_SECRET_ACCESS_KEY={{ restic_repos[item.repo].aws_secret_access_key }}
|
||||
export AWS_SECRET_ACCESS_KEY='{{ restic_repos[item.repo].aws_secret_access_key | regex_replace('\'', '\'\\\'\'') }}'
|
||||
{% endif %}
|
||||
{% if restic_repos[item.repo].aws_default_region is defined %}
|
||||
export AWS_DEFAULT_REGION={{ restic_repos[item.repo].aws_default_region }}
|
||||
|
|
Loading…
Reference in a new issue