duplicity_playbooks/backup_ovh1.yml

28 lines
825 B
YAML
Executable File

---
- 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
# python3-swiftclient is a requirement of duplicity
- name: Install python3-swiftclient
ansible.builtin.package:
name: python3-swiftclient
state: present
- name: Archive volume
ansible.builtin.include_tasks: "tasks/backup_volume.yml"
with_items: "{{ BACKUP_OVH1_VOLUMES }}"
- name: Archive MySQL DB
ansible.builtin.include_tasks: "tasks/backup_mysql_db.yml"