Copying a remote MySQL Database

40 views
Skip to first unread message

Steven Parsons

unread,
Nov 18, 2015, 5:33:08 PM11/18/15
to Ansible Project, ste...@dessci.com
I am wondering if anyone has copied a MySQL database from a location and then restored it locally using Ansible? I thought I had it figured out with the following syntax, but for some reason its failing.

- name: Install python-mysqldb
  apt: name=python-mysqldb state=latest

- name: Copy MySQL Database
  mysql_db: login_host=onthe.web.net login_user=someone login_password=cheese state=dump name=cheese target=/tmp/cheese.sql
  mysql_db: state=import name=cheese target=/tmp/cheese.sql

Any help would be appreciated.

Steven

Dick Davies

unread,
Nov 19, 2015, 9:00:05 AM11/19/15
to ansible list

split 'Copy MySQL Database' into two separate tasks, with one action each.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/9cf850d5-d844-49da-9e2a-672f14483513%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steven Parsons

unread,
Nov 19, 2015, 4:55:41 PM11/19/15
to Ansible Project, di...@hellooperator.net
Awesome that worked, thanks for the help.

Steven
Reply all
Reply to author
Forward
0 new messages