File tree 2 files changed +6
-17
lines changed
2 files changed +6
-17
lines changed Original file line number Diff line number Diff line change 51
51
if $mysql::server::create_root_my_cnf and $root_password_set {
52
52
# TODO: use EPP instead of ERB, as EPP can handle Data of Type Sensitive without further ado
53
53
file { "${facts['root_home']}/.my.cnf" :
54
- content => epp(' mysql/my.cnf.pass.epp' ,$parameters ),
55
- owner => ' root' ,
56
- mode => ' 0600' ,
54
+ content => epp(' mysql/my.cnf.pass.epp' ,$parameters ),
55
+ owner => ' root' ,
56
+ mode => ' 0600' ,
57
+ show_diff => false ,
57
58
}
58
59
59
- # show_diff was added with puppet 3.0
60
- if versioncmp($facts [' puppetversion' ], ' 3.0' ) >= 0 {
61
- File [" ${facts['root_home']}/.my.cnf" ] { show_diff => false }
62
- }
63
60
if $mysql::server::create_root_user {
64
61
Mysql_user[' root@localhost' ] -> File [" ${facts['root_home']}/.my.cnf" ]
65
62
}
Original file line number Diff line number Diff line change 202
202
203
203
it { is_expected . to contain_mysql_user ( 'root@localhost' ) }
204
204
205
- if Puppet . version . to_f >= 3.0
206
- it { is_expected . to contain_file ( '/root/.my.cnf' ) . with ( show_diff : false ) . that_requires ( 'Mysql_user[root@localhost]' ) }
207
- else
208
- it { is_expected . to contain_file ( '/root/.my.cnf' ) . that_requires ( 'Mysql_user[root@localhost]' ) }
209
- end
205
+ it { is_expected . to contain_file ( '/root/.my.cnf' ) . with ( show_diff : false ) . that_requires ( 'Mysql_user[root@localhost]' ) }
210
206
end
211
207
212
208
describe 'when root_password set, create_root_user set to false' do
213
209
let ( :params ) { { root_password : 'SET' , create_root_user : false } }
214
210
215
211
it { is_expected . not_to contain_mysql_user ( 'root@localhost' ) }
216
212
217
- if Puppet . version . to_f >= 3.0
218
- it { is_expected . to contain_file ( '/root/.my.cnf' ) . with ( show_diff : false ) }
219
- else
220
- it { is_expected . to contain_file ( '/root/.my.cnf' ) }
221
- end
213
+ it { is_expected . to contain_file ( '/root/.my.cnf' ) . with ( show_diff : false ) }
222
214
end
223
215
224
216
describe 'when root_password set, create_root_my_cnf set to false' do
You can’t perform that action at this time.
0 commit comments