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

37 lines
1.0 KiB
YAML

- name: install pandas system wide
community.general.pacman:
name:
- lsof
- python-pandas
state: present
- name: pull backup-docker.git
git:
repo: "https://github.com/kevinveenbirkenbach/backup-docker.git"
dest: "{{docker_volume_backup_folder}}"
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
- name: configure backup-docker.service
template:
src: backup-docker.service.j2
dest: /etc/systemd/system/backup-docker.service
notify: reload backup-docker.service
- name: configure backup-docker.timer.tpl
template: src=backup-docker.timer.j2 dest=/etc/systemd/system/backup-docker.timer
notify: restart backup-docker.timer
- name: create {{docker_volume_backup_folder}}databases.csv
copy:
src: "{{ inventory_dir }}/files/{{ inventory_hostname }}{{docker_volume_backup_folder}}databases.csv"
dest: "{{docker_volume_backup_folder}}databases.csv"
owner: root
group: root