comparison modules/website/manifests/mysql.pp @ 27:25405d1350ef puppet-3.6

Remove unnecessary log directory creation and try to fix SQL statement
author IBBoard <dev@ibboard.co.uk>
date Mon, 09 Mar 2015 03:30:18 +0000
parents aa40b53324e4
children 2078241de4ed
comparison
equal deleted inserted replaced
26:58d1818c2ded 27:25405d1350ef
25 'table_open_cache' => '500', 25 'table_open_cache' => '500',
26 'log-queries-not-using-indexes' => '1', 26 'log-queries-not-using-indexes' => '1',
27 } 27 }
28 }, 28 },
29 } 29 }
30 file { '/var/log/mysql':
31 ensure => directory,
32 owner => 'mysql',
33 group => 'mysql',
34 require => Class['mysql::server'],
35 }
36 $username = strip($mysqluser) 30 $username = strip($mysqluser)
37 $password = strip($mysqlpassword) 31 $password = strip($mysqlpassword)
38 $configured_marker = '/etc/mysql/.is-configured' 32 $configured_marker = '/etc/mysql/.is-configured'
39 exec { 'Rename root MySQL user for security': 33 exec { 'Rename root MySQL user for security':
40 command => "mysql -uroot -e 'UPDATE mysql.user SET User = \"$username\", Password = PASSWORD(\"$password\") WHERE User = \"root\"; DELETE FROM mysql.user WHERE User = ''; FLUSH PRIVILEGES;' && touch $configured_marker", 34 command => "mysql -u root -e 'UPDATE mysql.user SET User = \"$username\", Password = PASSWORD(\"$password\") WHERE User = \"root\"; DELETE FROM mysql.user WHERE User = \'\'; FLUSH PRIVILEGES;' && touch $configured_marker",
41 provider => shell, 35 provider => shell,
42 creates => $configured_marker, 36 creates => $configured_marker,
43 require => Class['mysql::server'], 37 require => Class['mysql::server'],
44 } 38 }
45 } 39 }