comparison modules/mysql/lib/puppet/provider/mysql_database/mysql.rb @ 26:58d1818c2ded puppet-3.6

Update MySQL module (which adds "staging" module)
author IBBoard <dev@ibboard.co.uk>
date Mon, 09 Mar 2015 01:34:59 +0000
parents 956e484adc12
children 48d3a1948e4d
comparison
equal deleted inserted replaced
25:13adb555a7e2 26:58d1818c2ded
29 end 29 end
30 end 30 end
31 end 31 end
32 32
33 def create 33 def create
34 mysql([defaults_file, '-NBe', "create database if not exists `#{@resource[:name]}` character set #{@resource[:charset]} collate #{@resource[:collate]}"].compact) 34 mysql([defaults_file, '-NBe', "create database if not exists `#{@resource[:name]}` character set `#{@resource[:charset]}` collate `#{@resource[:collate]}`"].compact)
35 35
36 @property_hash[:ensure] = :present 36 @property_hash[:ensure] = :present
37 @property_hash[:charset] = @resource[:charset] 37 @property_hash[:charset] = @resource[:charset]
38 @property_hash[:collate] = @resource[:collate] 38 @property_hash[:collate] = @resource[:collate]
39 39
40 exists? ? (return true) : (return false) 40 exists? ? (return true) : (return false)
41 end 41 end
42 42
43 def destroy 43 def destroy
44 mysql([defaults_file, '-NBe', "drop database `#{@resource[:name]}`"].compact) 44 mysql([defaults_file, '-NBe', "drop database if exists `#{@resource[:name]}`"].compact)
45 45
46 @property_hash.clear 46 @property_hash.clear
47 exists? ? (return false) : (return true) 47 exists? ? (return false) : (return true)
48 end 48 end
49 49