User user/password for mysql backup, support galera formula
diff --git a/backupninja/files/handler/mysql.conf b/backupninja/files/handler/mysql.conf
index 8a16ca5..97b3089 100644
--- a/backupninja/files/handler/mysql.conf
+++ b/backupninja/files/handler/mysql.conf
@@ -1,3 +1,10 @@
+{%- if pillar.galera.master is defined %}
+ {%- from "galera/map.jinja" import master with context -%}
+{%- elif pillar.galera.slave is defined %}
+ {%- from "galera/map.jinja" import slave with context -%}
+{%- else -%}
+ {%- from "mysql/map.jinja" import server with context -%}
+{%- endif -%}
### backupninja mysql config file ###
databases = {% for db in pillar.mysql.server.get('databases', []) %} {{ db.name }}{% endfor %} {% for db_name, db in pillar.mysql.server.get('database', {}).iteritems() %} {{ db_name }}{% endfor %}
@@ -15,12 +22,12 @@
#
# 2. specifying the mysql dbuser and dbpassword,
# which generates a temporary .my.cnf in /root/.my.cnf
-# dbusername = <some-mysql-user>
-# dbpassword = <password>
+dbusername = {{ server.admin.user }}
+dbpassword = {{ server.admin.password }}
#
# 3. specify which config file to use with configfile
# (this option does not work with hotcopy)
-configfile = /etc/mysql/debian.cnf
+# configfile = /etc/mysql/debian.cnf
#
# if user and dbusername are not specified, the default is to use
# /etc/mysql/debian.cnf for configfile.