summaryrefslogtreecommitdiffstats
path: root/plugins/puppet/provider/mysql_database/mysql.rb
blob: b12d042922945a3ca356a02bb418ae4391cc673b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Puppet::Type.type(:mysql_database).provide(:mysql) do
	desc "Use mysql as database."
	commands :mysqladmin => '/usr/bin/mysqladmin'
	commands :mysqlshow => '/usr/bin/mysqlshow'

	def create
		mysqladmin "create", @resource[:name]
	end
	def destroy
		mysqladmin "-f", "drop", @resource[:name]
	end
	def exists?
		if /\| #{@resource[:name]} /.match(mysqlshow)
			true
		else
			false
		end
	end
end