ansible/roles/db-backup/tasks/install.yml

37 lines
818 B
YAML
Raw Normal View History

2023-11-20 02:35:20 +00:00
---
- become: yes
block:
- name: install needed tools
apt:
update_cache: yes
pkg:
- postgresql-client-common
- mysql-client-8.0
- name: Add cron task for backup mysql
become: yes
ansible.builtin.cron:
user: "{{ account.name }}"
name: "Backup mysql"
minute: "0"
hour: "4"
job: "{{ account.home }}/mysql-backup.sh"
- name: Add cron task for backup postgres
become: yes
ansible.builtin.cron:
user: "{{ account.name }}"
name: "Backup postgres"
minute: "10"
hour: "4"
job: "{{ account.home }}/postgres-backup.sh"
- name: Add cron task for backup postgres2
become: yes
ansible.builtin.cron:
user: "{{ account.name }}"
name: "Backup postgres 2"
minute: "20"
hour: "4"
job: "{{ account.home }}/postgres-backup2.sh"