2023-10-22 14:57:23 +00:00
|
|
|
---
|
|
|
|
- name: backup_ovh1
|
|
|
|
hosts: localhost
|
|
|
|
gather_facts: false
|
|
|
|
vars_files: main.yml
|
|
|
|
tasks:
|
|
|
|
- name: Assert environment variable is not empty
|
|
|
|
ansible.builtin.include_tasks: "tasks/assert_env_var_not_empty.yml"
|
|
|
|
with_items: "{{ BACKUP_OVH1_REQUIRED_ENV_VARS }}"
|
|
|
|
|
|
|
|
- name: Create backup directory
|
|
|
|
ansible.builtin.file:
|
|
|
|
path: "{{ WORKDIR }}/backup"
|
|
|
|
state: directory
|
|
|
|
|
2024-04-14 17:39:49 +00:00
|
|
|
# python3-swiftclient is a requirement of duplicity
|
2023-10-22 14:57:23 +00:00
|
|
|
- name: Install python3-swiftclient
|
|
|
|
ansible.builtin.package:
|
|
|
|
name: python3-swiftclient
|
|
|
|
state: present
|
|
|
|
|
2024-04-28 08:28:53 +00:00
|
|
|
- name: Backup standard volume
|
2024-04-14 17:39:49 +00:00
|
|
|
ansible.builtin.include_tasks: "tasks/backup_volume.yml"
|
|
|
|
with_items: "{{ BACKUP_OVH1_VOLUMES }}"
|
2023-10-22 14:57:23 +00:00
|
|
|
|
2024-04-28 08:28:53 +00:00
|
|
|
- name: Prepare MySQL_DB backup volume
|
|
|
|
ansible.builtin.include_tasks: "tasks/prepare_MySQL_DB_backup_volume.yml"
|
|
|
|
|
|
|
|
- name: Backup last MySQL dumps
|
|
|
|
ansible.builtin.include_tasks: "tasks/backup_volume.yml"
|
|
|
|
with_items:
|
2024-04-28 09:49:38 +00:00
|
|
|
- name: mysql-server_dumps
|
2024-04-28 08:28:53 +00:00
|
|
|
dir: "{{ WORKDIR }}/backup/MySQL_DB"
|