From 459be93a7e8006c9fd9a7d375660ca0a3e610dc9 Mon Sep 17 00:00:00 2001 From: Jeffrey Clark Date: Sat, 4 May 2024 15:13:50 -0500 Subject: [PATCH] (maint) drop some puppet 3 support --- manifests/server/root_password.pp | 11 ++++------- spec/classes/mysql_server_spec.rb | 12 ++---------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/manifests/server/root_password.pp b/manifests/server/root_password.pp index 2cfa88830..42146ce3c 100644 --- a/manifests/server/root_password.pp +++ b/manifests/server/root_password.pp @@ -51,15 +51,12 @@ if $mysql::server::create_root_my_cnf and $root_password_set { # TODO: use EPP instead of ERB, as EPP can handle Data of Type Sensitive without further ado file { "${facts['root_home']}/.my.cnf": - content => epp('mysql/my.cnf.pass.epp',$parameters), - owner => 'root', - mode => '0600', + content => epp('mysql/my.cnf.pass.epp',$parameters), + owner => 'root', + mode => '0600', + show_diff => false, } - # show_diff was added with puppet 3.0 - if versioncmp($facts['puppetversion'], '3.0') >= 0 { - File["${facts['root_home']}/.my.cnf"] { show_diff => false } - } if $mysql::server::create_root_user { Mysql_user['root@localhost'] -> File["${facts['root_home']}/.my.cnf"] } diff --git a/spec/classes/mysql_server_spec.rb b/spec/classes/mysql_server_spec.rb index 4cdd8c09c..5b29669e8 100644 --- a/spec/classes/mysql_server_spec.rb +++ b/spec/classes/mysql_server_spec.rb @@ -202,11 +202,7 @@ it { is_expected.to contain_mysql_user('root@localhost') } - if Puppet.version.to_f >= 3.0 - it { is_expected.to contain_file('/root/.my.cnf').with(show_diff: false).that_requires('Mysql_user[root@localhost]') } - else - it { is_expected.to contain_file('/root/.my.cnf').that_requires('Mysql_user[root@localhost]') } - end + it { is_expected.to contain_file('/root/.my.cnf').with(show_diff: false).that_requires('Mysql_user[root@localhost]') } end describe 'when root_password set, create_root_user set to false' do @@ -214,11 +210,7 @@ it { is_expected.not_to contain_mysql_user('root@localhost') } - if Puppet.version.to_f >= 3.0 - it { is_expected.to contain_file('/root/.my.cnf').with(show_diff: false) } - else - it { is_expected.to contain_file('/root/.my.cnf') } - end + it { is_expected.to contain_file('/root/.my.cnf').with(show_diff: false) } end describe 'when root_password set, create_root_my_cnf set to false' do