Add Azure Blob Storage support, based on restic documentation

This commit is contained in:
Usman Iqbal 2023-08-23 20:54:30 +01:00
parent 0a5c1bbb94
commit a291a09cce
4 changed files with 29 additions and 1 deletions

View file

@ -102,7 +102,7 @@ Available variables:
| 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), [SFTP](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#sftp), [S3](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#amazon-s3) and [B2](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#backblaze-b2) 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), [S3](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#amazon-s3), [Azure Blob](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#microsoft-azure-blob-storage) and [B2](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html#backblaze-b2) are supported |
| `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. |

View file

@ -7,6 +7,10 @@
AWS_ACCESS_KEY_ID: '{{ item.value.aws_access_key | default("") }}'
AWS_SECRET_ACCESS_KEY: '{{ item.value.aws_secret_access_key | default("") }}'
AWS_DEFAULT_REGION: '{{ item.value.aws_default_region | default("") }}'
AZURE_ACCOUNT_NAME: '{{ item.value.azure_account_name | default("") }}'
AZURE_ACCOUNT_KEY: '{{ item.value.azure_account_key | default("") }}'
AZURE_ACCOUNT_SAS: '{{ item.value.azure_account_sas | default("") }}'
AZURE_ENDPOINT_SUFFIX: '{{ item.value.azure_endpoint_suffix | default("") }}'
B2_ACCOUNT_ID: '{{ item.value.b2_account_id | default("") }}'
B2_ACCOUNT_KEY: '{{ item.value.b2_account_key | default("") }}'
no_log: "{{ restic_no_log }}"

View file

@ -14,6 +14,18 @@ export AWS_SECRET_ACCESS_KEY='{{ restic_repos[item.repo].aws_secret_access_key |
{% if restic_repos[item.repo].aws_default_region is defined %}
export AWS_DEFAULT_REGION={{ restic_repos[item.repo].aws_default_region }}
{% endif %}
{% if restic_repos[item.repo].azure_account_name is defined %}
export AZURE_ACCOUNT_NAME={{ restic_repos[item.repo].azure_account_name }}
{% endif %}
{% if restic_repos[item.repo].azure_account_key is defined %}
export AZURE_ACCOUNT_KEY={{ restic_repos[item.repo].azure_account_key }}
{% endif %}
{% if restic_repos[item.repo].azure_account_sas is defined %}
export AZURE_ACCOUNT_SAS={{ restic_repos[item.repo].azure_account_sas }}
{% endif %}
{% if restic_repos[item.repo].azure_endpoint_suffix is defined %}
export AZURE_ENDPOINT_SUFFIX={{ restic_repos[item.repo].azure_endpoint_suffix }}
{% endif %}
{% if restic_repos[item.repo].b2_account_id is defined %}
export B2_ACCOUNT_ID={{ restic_repos[item.repo].b2_account_id }}
{% endif %}

View file

@ -57,6 +57,18 @@ export AWS_SECRET_ACCESS_KEY='{{ restic_repos[item.repo].aws_secret_access_key |
{% if restic_repos[item.repo].aws_default_region is defined %}
export AWS_DEFAULT_REGION={{ restic_repos[item.repo].aws_default_region }}
{% endif %}
{% if restic_repos[item.repo].azure_account_name is defined %}
export AZURE_ACCOUNT_NAME={{ restic_repos[item.repo].azure_account_name }}
{% endif %}
{% if restic_repos[item.repo].azure_account_key is defined %}
export AZURE_ACCOUNT_KEY={{ restic_repos[item.repo].azure_account_key }}
{% endif %}
{% if restic_repos[item.repo].azure_account_sas is defined %}
export AZURE_ACCOUNT_SAS={{ restic_repos[item.repo].azure_account_sas }}
{% endif %}
{% if restic_repos[item.repo].azure_endpoint_suffix is defined %}
export AZURE_ENDPOINT_SUFFIX={{ restic_repos[item.repo].azure_endpoint_suffix }}
{% endif %}
{% if restic_repos[item.repo].b2_account_id is defined %}
export B2_ACCOUNT_ID={{ restic_repos[item.repo].b2_account_id }}
{% endif %}