how backup and restore mysql database using ansible1 min read
Hi All, This document shows you how backup and restore MySQL database using ansible.
Ansible is a Provisioning and configuration management tool which can be used for both Linux and windows platform. Ansible has reached the best place under the best DevOps tools because it is very is easy and simple.
Ansible playbook is written in YAML file which is human readable and understandable which makes ansible popular.
Step 1: Create a YAML file
Paste the below contents, explanations are given below.
First task perform DB backup to /opt/backup.sql file of wordpress_db with above mentioned DB username and password where 192.168.10.22 is the DB host.
The second task restore database from /opt/backup.sql to restoredb database with above mentioned DB username and password.