Skip to content

Commit

Permalink
Merge pull request #671 from aldavud/fix-bug-in-578
Browse files Browse the repository at this point in the history
Fix bug in 578
  • Loading branch information
igalic committed Feb 16, 2015
2 parents efa2f58 + b3c33f0 commit 3f18713
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion manifests/server/root_password.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
content => template('mysql/my.cnf.pass.erb'),
owner => 'root',
mode => '0600',
require => Mysql_user['root@localhost'],
}
if $mysql::server::create_root_user == true {
Mysql_user['root@localhost'] -> File["${::root_home}/.my.cnf"]
}
}

Expand Down
2 changes: 1 addition & 1 deletion spec/classes/mysql_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
describe 'when root_password set' do
let(:params) {{:root_password => 'SET' }}
it { is_expected.to contain_mysql_user('root@localhost') }
it { is_expected.to contain_file('/root/.my.cnf') }
it { is_expected.to contain_file('/root/.my.cnf').that_requires('Mysql_user[root@localhost]') }
end
describe 'when root_password set, create_root_user set to false' do
let(:params) {{ :root_password => 'SET', :create_root_user => false }}
Expand Down

0 comments on commit 3f18713

Please sign in to comment.