summaryrefslogtreecommitdiff
path: root/plugins/puppet/provider/mysql_database/mysql.rb
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2009-10-31 15:16:40 +0100
committermh <mh@immerda.ch>2009-10-31 15:16:40 +0100
commit304b199b700f130925c09c330a63fc6c4745321b (patch)
tree427b3f2febd501dfbec48b3e02a5483608c685db /plugins/puppet/provider/mysql_database/mysql.rb
parent62e9001ab2288b66ee0f84ac50a789301f658485 (diff)
move plugin directory to fit new 0.25 style
Diffstat (limited to 'plugins/puppet/provider/mysql_database/mysql.rb')
-rw-r--r--plugins/puppet/provider/mysql_database/mysql.rb55
1 files changed, 0 insertions, 55 deletions
diff --git a/plugins/puppet/provider/mysql_database/mysql.rb b/plugins/puppet/provider/mysql_database/mysql.rb
deleted file mode 100644
index 2b70e04..0000000
--- a/plugins/puppet/provider/mysql_database/mysql.rb
+++ /dev/null
@@ -1,55 +0,0 @@
-require 'puppet/provider/package'
-
-Puppet::Type.type(:mysql_database).provide(:mysql,
- :parent => Puppet::Provider::Package) do
-
- desc "Use mysql as database."
- commands :mysqladmin => '/usr/bin/mysqladmin'
- commands :mysql => '/usr/bin/mysql'
-
- # retrieve the current set of mysql users
- def self.instances
- dbs = []
-
- cmd = "#{command(:mysql)} mysql -NBe 'show databases'"
- execpipe(cmd) do |process|
- process.each do |line|
- dbs << new( { :ensure => :present, :name => line.chomp } )
- end
- end
- return dbs
- end
-
- def query
- result = {
- :name => @resource[:name],
- :ensure => :absent
- }
-
- cmd = "#{command(:mysql)} mysql -NBe 'show databases'"
- execpipe(cmd) do |process|
- process.each do |line|
- if line.chomp.eql?(@resource[:name])
- result[:ensure] = :present
- end
- end
- end
- result
- end
-
- def create
- mysqladmin "create", @resource[:name]
- end
- def destroy
- mysqladmin "-f", "drop", @resource[:name]
- end
-
- def exists?
- if mysql("mysql", "-NBe", "show databases").match(/^#{@resource[:name]}$/)
- true
- else
- false
- end
- end
-end
-