2023-08-07 23:02:22 +02:00
|
|
|
- name: install pandas system wide
|
|
|
|
community.general.pacman:
|
|
|
|
name:
|
|
|
|
- lsof
|
|
|
|
- python-pandas
|
|
|
|
state: present
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_backup_docker_to_local is not defined
|
2022-01-23 22:01:21 +01:00
|
|
|
|
2023-11-16 17:07:28 +01:00
|
|
|
- name: pull backup-docker-to-local.git
|
2020-12-24 14:27:31 +01:00
|
|
|
git:
|
2023-11-16 17:07:28 +01:00
|
|
|
repo: "https://github.com/kevinveenbirkenbach/backup-docker-to-local.git"
|
2023-11-17 12:35:39 +01:00
|
|
|
dest: "{{backup_docker_to_local_folder}}"
|
2020-12-24 14:27:31 +01:00
|
|
|
update: yes
|
2023-05-28 23:08:38 +02:00
|
|
|
register: git_result
|
|
|
|
ignore_errors: true
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_backup_docker_to_local is not defined
|
2023-05-28 23:08:38 +02:00
|
|
|
|
|
|
|
- name: Warn if repo is not reachable
|
|
|
|
debug:
|
|
|
|
msg: "Warning: Repository is not reachable."
|
2023-12-12 15:10:11 +01:00
|
|
|
when: git_result is defined and git_result.failed is defined and run_once_cleanup_failed_docker_backups is not defined
|
2020-12-24 14:27:31 +01:00
|
|
|
|
2023-11-16 17:07:28 +01:00
|
|
|
- name: configure backup-docker-to-local.service
|
2023-04-15 17:06:10 +02:00
|
|
|
template:
|
2023-11-16 17:07:28 +01:00
|
|
|
src: backup-docker-to-local.service.j2
|
|
|
|
dest: /etc/systemd/system/backup-docker-to-local.service
|
|
|
|
notify: reload backup-docker-to-local.service
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_backup_docker_to_local is not defined
|
2020-12-24 14:27:31 +01:00
|
|
|
|
2023-11-16 17:07:28 +01:00
|
|
|
- name: configure backup-docker-to-local.timer.tpl
|
|
|
|
template: src=backup-docker-to-local.timer.j2 dest=/etc/systemd/system/backup-docker-to-local.timer
|
2023-11-16 19:43:54 +01:00
|
|
|
register: backup_docker_to_local_timer
|
|
|
|
changed_when: backup_docker_to_local_timer.changed or activate_all_timers | default(false) | bool
|
2023-11-16 17:07:28 +01:00
|
|
|
notify: restart backup-docker-to-local.timer
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_backup_docker_to_local is not defined
|
2022-01-23 21:43:05 +01:00
|
|
|
|
2023-11-17 12:35:39 +01:00
|
|
|
- name: create {{backup_docker_to_local_folder}}databases.csv
|
2022-01-23 21:43:05 +01:00
|
|
|
copy:
|
2023-11-17 12:35:39 +01:00
|
|
|
src: "{{ inventory_dir }}/files/{{ inventory_hostname }}{{backup_docker_to_local_folder}}databases.csv"
|
|
|
|
dest: "{{backup_docker_to_local_folder}}databases.csv"
|
2022-01-23 21:43:05 +01:00
|
|
|
owner: root
|
|
|
|
group: root
|
2023-12-12 15:10:11 +01:00
|
|
|
when: run_once_backup_docker_to_local is not defined
|
|
|
|
|
|
|
|
- name: run the backup_docker_to_local tasks once
|
|
|
|
set_fact:
|
|
|
|
run_once_backup_docker_to_local: true
|
|
|
|
when: run_once_backup_docker_to_local is not defined
|