summaryrefslogtreecommitdiff
path: root/lib/puppet/provider/mysql_database
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2015-06-05 15:53:26 -0300
committerdrebs <drebs@riseup.net>2015-06-05 15:53:26 -0300
commit494241a212d7db9cf576adf9b06c01458e65ecb5 (patch)
treed7fb652f7332ca277a439518cd293aa38ba06e50 /lib/puppet/provider/mysql_database
parent59fe3f1d51aa0ac1c5fd7029ecce7da7e1c6aafd (diff)
downloadpuppet-mysql-494241a212d7db9cf576adf9b06c01458e65ecb5.tar.gz
puppet-mysql-494241a212d7db9cf576adf9b06c01458e65ecb5.tar.bz2
add conf file to provider commandsadapt-to-jessie
Diffstat (limited to 'lib/puppet/provider/mysql_database')
-rw-r--r--lib/puppet/provider/mysql_database/mysql.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/puppet/provider/mysql_database/mysql.rb b/lib/puppet/provider/mysql_database/mysql.rb
index 18b0a5a..fe21b79 100644
--- a/lib/puppet/provider/mysql_database/mysql.rb
+++ b/lib/puppet/provider/mysql_database/mysql.rb
@@ -11,7 +11,7 @@ Puppet::Type.type(:mysql_database).provide(:mysql,
def self.instances
dbs = []
- cmd = "#{command(:mysql)} mysql -NBe 'show databases'"
+ cmd = "#{command(:mysql)} --defaults-extra-file=/root/.my.cnf mysql -NBe 'show databases'"
execpipe(cmd) do |process|
process.each do |line|
dbs << new( { :ensure => :present, :name => line.chomp } )
@@ -26,7 +26,7 @@ Puppet::Type.type(:mysql_database).provide(:mysql,
:ensure => :absent
}
- cmd = "#{command(:mysql)} mysql -NBe 'show databases'"
+ cmd = "#{command(:mysql)} --defaults-extra-file=/root/.my.cnf mysql -NBe 'show databases'"
execpipe(cmd) do |process|
process.each do |line|
if line.chomp.eql?(@resource[:name])
@@ -38,14 +38,14 @@ Puppet::Type.type(:mysql_database).provide(:mysql,
end
def create
- mysqladmin "create", @resource[:name]
+ mysqladmin "--defaults-extra-file=/root/.my.cnf", "create", @resource[:name]
end
def destroy
- mysqladmin "-f", "drop", @resource[:name]
+ mysqladmin "--defaults-extra-file=/root/.my.cnf", "-f", "drop", @resource[:name]
end
def exists?
- if mysql("mysql", "-NBe", "show databases").match(/^#{@resource[:name]}$/)
+ if mysql("--defaults-extra-file=/root/.my.cnf ", "mysql", "-NBe", "show databases").match(/^#{@resource[:name]}$/)
true
else
false