Premier commit
This commit is contained in:
commit
518c7ab04b
49 files changed
+1120
No files matched your search
@@ -0,0 +1,22 @@
|
||||
---
|
||||
# MariaDB/tasks/backup_database.yml
|
||||
|
||||
- name: "Set timestamp of the backup"
|
||||
set_fact:
|
||||
now: "{{ lookup('pipe', 'date +%d%m%Y-%H:%M') }}"
|
||||
|
||||
- name: "Create a backup directory"
|
||||
file:
|
||||
path: "/tmp/{{ app_name }}/backups/{{ now }}/"
|
||||
mode: 0777
|
||||
owner: ansible
|
||||
state: directory
|
||||
|
||||
- name: Backup the database
|
||||
mysql_db:
|
||||
name: "{{ mariadb_database }}"
|
||||
state: dump
|
||||
login_user: root
|
||||
login_password: "{{ mariadb_root_password }}"
|
||||
target: "/tmp/{{ app_name }}/backups/{{ now }}/{{ backup_file }}"
|
||||
|
||||
Reference in new issue
Block a user