Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bcoca/local_backup
role that allows copying/moving remote backup_file to controller dir by config
https://github.com/bcoca/local_backup
Last synced: about 1 month ago
JSON representation
role that allows copying/moving remote backup_file to controller dir by config
- Host: GitHub
- URL: https://github.com/bcoca/local_backup
- Owner: bcoca
- License: gpl-3.0
- Created: 2021-04-28T16:47:46.000Z (over 3 years ago)
- Default Branch: devel
- Last Pushed: 2022-11-02T14:43:06.000Z (about 2 years ago)
- Last Synced: 2024-10-25T18:55:08.931Z (about 2 months ago)
- Language: Python
- Size: 25.4 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# local_backup
role that allows copying/moving remote backup_file to controller dir by configTo use just import the role and aftewards just use copy and other modules as normal.
If the `ANSIBLE_LOCAL_BACKUP` is set it will copy backup_file into that directory.
If the `ANSIBLE_REMOTE_BACKUP_CLEANUP` is also set it will remove the bakcup from the remote once copied.```
- hosts: localhost
gather_facts: false
roles:
- local_backup
tasks:
- copy: backup=yes src=testing2 dest=testing1```
If running multiple plays you really only need to load once
```
- hosts: localhost
gather_facts: false
environment:
ANSIBLE_LOCAL_BACKUP: /var/tmp/backups/
roles:
- local_backup- hosts: yolo
tasks:
- copy: backup=yes src=testing2 dest=testing1
environment:
ANSIBLE_LOCAL_BACKUP: /backupdir/
```But if running against the controller, you need to set the envionrment vars before calling Ansible
```
ANSIBLE_LOCAL_BACKUP=/backups/ ansible-playbook ...```