https://github.com/jtom38/ansible-role-docker_volume_management
Ansible role to backup docker volumes
https://github.com/jtom38/ansible-role-docker_volume_management
ansible backup docker docker-volumes
Last synced: 2 months ago
JSON representation
Ansible role to backup docker volumes
- Host: GitHub
- URL: https://github.com/jtom38/ansible-role-docker_volume_management
- Owner: jtom38
- Created: 2019-12-14T04:58:53.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-21T06:09:37.000Z (almost 6 years ago)
- Last Synced: 2025-03-11T01:30:05.061Z (7 months ago)
- Topics: ansible, backup, docker, docker-volumes
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# docker_volume_backup
This role helps with making backups of your docker volumes for you.
## Requirements
This role makes use of the docker cli tool on ansible_os_family == 'Debian' || 'RedHat'
## Variables
``` yaml
# Required
# Defines what task will be ran.
# Expects: 'backup' or 'restore'
# Defaults: Null
action: string# Defines what container to look for to copy the mount points for the backup job.
# Defaults: Null
container_name: string# Defines the mount point from within the container that we are going to make a backup of.
# Defaults: Null
mount_point: string# Defines where on the host device we are going to place the tar file.
# Defaults: Null
backup_location: string# Defines the name of the tar file.
# Defaults: Null
tar_file: string# Optional
# Checks to make sure that the volume is present. Creates one if not found by name.
# Defaults: false
create_volume: bool# Stops the container to run the backup on the data.
# Defaults: false
stop_container: bool```
## Examples
``` yaml
- include_role:
name: docker_volume_management
vars:
action: backup
container_name: 'ubuntu'
mount_point: '/data'
backup_folder: '~/backup'
tar_file: ubuntuData.tar- include_role:
name: docker_volume_management
vars:
action: restore
container_name: 'ubuntu'
backup_folder: '~/backup'
tar_file: ubuntuData.tar```