summaryrefslogtreecommitdiff
path: root/lib/puppet/provider/mysql_database/mysql.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/provider/mysql_database/mysql.rb')
-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