computer-playbook/roles/backup-docker/tasks/main.yml

37 lines
1.0 KiB
YAML
Raw Normal View History

2023-08-07 23:02:22 +02:00
- name: install pandas system wide
community.general.pacman:
name:
- lsof
- python-pandas
state: present
2022-01-23 22:01:21 +01:00
2023-11-16 16:55:16 +01:00
- name: pull backup-docker.git
2020-12-24 14:27:31 +01:00
git:
2023-11-16 16:55:16 +01:00
repo: "https://github.com/kevinveenbirkenbach/backup-docker.git"
2023-03-26 17:05:06 +02:00
dest: "{{docker_volume_backup_folder}}"
2020-12-24 14:27:31 +01:00
update: yes
register: git_result
ignore_errors: true
- name: Warn if repo is not reachable
debug:
msg: "Warning: Repository is not reachable."
when: git_result.failed
2020-12-24 14:27:31 +01:00
2023-11-16 16:55:16 +01:00
- name: configure backup-docker.service
2023-04-15 17:06:10 +02:00
template:
2023-11-16 16:55:16 +01:00
src: backup-docker.service.j2
dest: /etc/systemd/system/backup-docker.service
notify: reload backup-docker.service
2020-12-24 14:27:31 +01:00
2023-11-16 16:55:16 +01:00
- name: configure backup-docker.timer.tpl
template: src=backup-docker.timer.j2 dest=/etc/systemd/system/backup-docker.timer
notify: restart backup-docker.timer
2022-01-23 21:43:05 +01:00
2023-03-26 23:29:30 +02:00
- name: create {{docker_volume_backup_folder}}databases.csv
2022-01-23 21:43:05 +01:00
copy:
2023-03-26 23:29:30 +02:00
src: "{{ inventory_dir }}/files/{{ inventory_hostname }}{{docker_volume_backup_folder}}databases.csv"
dest: "{{docker_volume_backup_folder}}databases.csv"
2022-01-23 21:43:05 +01:00
owner: root
group: root