Permalink
Browse files

Create /root/.my.cnf even when root passwd is not managed

When the root password is not managed, it causes mysql to
fail b/c it does not create the /root/.my.cnf file (which causes
all mysql commands from the provider to fail)
  • Loading branch information...
1 parent b9e4b0a commit 765b5c252754bc1e4303d90a344edf54ddd28d65 Dan Bode committed Oct 13, 2012
Showing with 6 additions and 1 deletion.
  1. +5 −0 manifests/config.pp
  2. +1 −1 spec/classes/mysql_config_spec.rb
View
5 manifests/config.pp
@@ -116,6 +116,11 @@
require => Exec['set_mysql_rootpw'],
}
}
+ } else {
+ file { '/root/.my.cnf':
+ ensure => present,
+ require => Exec['set_mysql_rootpw'],
+ }
}
file { '/etc/mysql':
View
2 spec/classes/mysql_config_spec.rb
@@ -130,7 +130,7 @@
it { should_not contain_exec('set_mysql_rootpw') }
- it { should_not contain_file('/root/.my.cnf')}
+ it { should contain_file('/root/.my.cnf')}
it { should contain_file('/etc/mysql').with(
'owner' => 'root',

0 comments on commit 765b5c2

Please sign in to comment.