community.general.kopia_repository module – Manage Kopia repository
Note
This module is part of the community.general collection (version 13.1.0).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.general.
To use it in a playbook, specify: community.general.kopia_repository.
New in community.general 13.1.0
Synopsis
Manage a Kopia repository using the Kopia CLI.
Supports creating, connecting, disconnecting, syncing, and throttling repositories.
Parameters
Parameter |
Comments |
|---|---|
Backend storage configuration for the repository. Required if |
|
Access key ID for the backend. Required if |
|
Bucket name for the backend. Required if |
|
Azure Blob Storage container name. Required if |
|
Path to a JSON credentials file for authentication. Optional if |
|
S3-compatible endpoint URL. Optional if |
|
Google Drive folder ID to use as the backend root. Required if |
|
SFTP server hostname. Required if |
|
Path to the SSH private key file for SFTP authentication. Optional if |
|
Path to a known_hosts file for SFTP host key verification. Optional if |
|
Local file system path or remote path for the backend. Required if |
|
SFTP server port. Optional if |
|
Object key prefix within the backend storage. Optional if |
|
Backend storage provider. Use Choices:
|
|
S3 bucket region. Optional if |
|
Azure Shared Access Signature token for authentication. Optional alternative to |
|
Secret access key for the backend. Required if |
|
Session token for temporary AWS credentials. Optional if |
|
Azure storage account name. Required if |
|
Azure storage domain override. Optional if |
|
Azure storage account key used to authenticate. Optional if |
|
WebDAV server URL. Required if |
|
SFTP username for authentication. Required if |
|
Password for WebDAV authentication. Optional if |
|
Username for WebDAV authentication. Optional if |
|
Path to the Kopia config file for this repository connection. Defaults to the Kopia default config path when not set. |
|
TLS certificate fingerprint of the Kopia server. Required if |
|
Repository password used to encrypt and decrypt repository contents. |
|
Desired state of the Kopia repository. Choices:
|
|
Throttle limits for the repository connection. Only used when |
|
Maximum number of concurrent read operations. |
|
Maximum number of concurrent write operations. |
|
Maximum download speed in bytes per second. Set to |
|
Maximum number of list requests per second. |
|
Maximum number of read requests per second. |
|
Maximum upload speed in bytes per second. Set to |
|
Maximum number of write requests per second. |
|
URL of the Kopia server to connect to. Required if |
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
Can run in |
|
Support: full |
Returns details on what has changed (or possibly needs changing in |
Examples
- name: Create a Kopia repository with S3 backend
community.general.kopia_repository:
state: created
password: secret
config: /etc/kopia/root.config
backend:
provider: s3
bucket: my-bucket
access_key: myaccesskey
secret_access_key: mysecretaccesskey
- name: Create a Kopia repository on the local filesystem
community.general.kopia_repository:
state: created
password: secret
backend:
provider: filesystem
path: /mnt/backup/kopia
- name: Connect to a Kopia repository server
community.general.kopia_repository:
state: connected
password: secret
config: /etc/kopia/root.config
url: https://kopia.example.com:51515
fingerprint_tls: AA:BB:CC:DD:EE:FF
backend:
provider: server
- name: Connect directly to an Azure backend
community.general.kopia_repository:
state: connected
password: secret
backend:
provider: azure
container: my-container
storage_account: mystorageaccount
storage_key: mystoragekey
- name: Disconnect the Kopia repository
community.general.kopia_repository:
state: disconnected
config: /etc/kopia/root.config
- name: Sync Kopia repository to an S3 location
community.general.kopia_repository:
state: synced
password: secret
config: /etc/kopia/root.config
backend:
provider: s3
bucket: my-synced-bucket
access_key: myaccesskey
secret_access_key: mysecretaccesskey
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
|---|---|
Output from the Kopia repository command. Returned: always Sample: |