Skip to content

Commit 459be93

Browse files
committed
(maint) drop some puppet 3 support
1 parent 72fd570 commit 459be93

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

manifests/server/root_password.pp

+4-7
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,12 @@
5151
if $mysql::server::create_root_my_cnf and $root_password_set {
5252
# TODO: use EPP instead of ERB, as EPP can handle Data of Type Sensitive without further ado
5353
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,
5758
}
5859

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-
}
6360
if $mysql::server::create_root_user {
6461
Mysql_user['root@localhost'] -> File["${facts['root_home']}/.my.cnf"]
6562
}

spec/classes/mysql_server_spec.rb

+2-10
Original file line numberDiff line numberDiff line change
@@ -202,23 +202,15 @@
202202

203203
it { is_expected.to contain_mysql_user('root@localhost') }
204204

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]') }
210206
end
211207

212208
describe 'when root_password set, create_root_user set to false' do
213209
let(:params) { { root_password: 'SET', create_root_user: false } }
214210

215211
it { is_expected.not_to contain_mysql_user('root@localhost') }
216212

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) }
222214
end
223215

224216
describe 'when root_password set, create_root_my_cnf set to false' do

0 commit comments

Comments
 (0)