File tree Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Expand file tree Collapse file tree 4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -219,6 +219,7 @@ The following parameters are available in the `rabbitmq` class:
219219* [ ` default_user ` ] ( #-rabbitmq--default_user )
220220* [ ` default_pass ` ] ( #-rabbitmq--default_pass )
221221* [ ` delete_guest_user ` ] ( #-rabbitmq--delete_guest_user )
222+ * [ ` enable_centos_release ` ] ( #-rabbitmq--enable_centos_release )
222223* [ ` env_config ` ] ( #-rabbitmq--env_config )
223224* [ ` env_config_path ` ] ( #-rabbitmq--env_config_path )
224225* [ ` environment_variables ` ] ( #-rabbitmq--environment_variables )
@@ -508,6 +509,15 @@ Controls whether default guest user is deleted.
508509
509510Default value: ` false `
510511
512+ ##### <a name =" -rabbitmq--enable_centos_release " ></a >` enable_centos_release `
513+
514+ Data type: ` Boolean `
515+
516+ Enable the ` centos-release-rabbitmq-38 ` if set to ` true ` and if the OS is in the
517+ RedHat family and ` repos_ensure ` is ` false ` . Defaults to true on CentOS.
518+
519+ Default value: ` false `
520+
511521##### <a name =" -rabbitmq--env_config " ></a >` env_config `
512522
513523Data type: ` String `
Original file line number Diff line number Diff line change 1+ rabbitmq::enable_centos_release : true
Original file line number Diff line number Diff line change 161161# Password to set for the `default_user` in rabbitmq.config.
162162# @param delete_guest_user
163163# Controls whether default guest user is deleted.
164+ # @param enable_centos_release
165+ # Enable the `centos-release-rabbitmq-38` if set to `true` and if the OS is in the
166+ # RedHat family and `repos_ensure` is `false`. Defaults to true on CentOS.
164167# @param env_config
165168# The template file to use for rabbitmq_env.config.
166169# @param env_config_path
369372 String $default_user = ' guest' ,
370373 String $default_pass = ' guest' ,
371374 Boolean $delete_guest_user = false ,
375+ Boolean $enable_centos_release = false ,
372376 String $env_config = ' rabbitmq/rabbitmq-env.conf.epp' ,
373377 Stdlib::Absolutepath $env_config_path = ' /etc/rabbitmq/rabbitmq-env.conf' ,
374378 Optional[String] $erlang_cookie = undef ,
513517 default: {
514518 }
515519 }
516- } elsif $facts [' os' ][' family' ] == ' RedHat' {
520+ } elsif $facts [' os' ][' family' ] == ' RedHat' and $enable_centos_release {
517521 package { 'centos-release-rabbitmq-38' :
518522 ensure => ' present' ,
519523 }
Original file line number Diff line number Diff line change 3939 it { is_expected . not_to contain_class ( 'rabbitmq::repo::rhel' ) }
4040 it { is_expected . not_to contain_yumrepo ( 'rabbitmq' ) }
4141
42- it { is_expected . to contain_package ( 'centos-release-rabbitmq-38' ) } if os_facts [ 'os' ] [ 'family' ] == 'RedHat'
42+ it { is_expected . to contain_package ( 'centos-release-rabbitmq-38' ) } if os_facts [ 'os' ] [ 'name' ] == 'CentOS'
43+ it { is_expected . not_to contain_package ( 'centos-release-rabbitmq-38' ) } if os_facts [ 'os' ] [ 'name' ] == 'RedHat'
4344 end
4445
4546 context 'with service_restart => false' do
4849 it { is_expected . not_to contain_class ( 'rabbitmq::config' ) . that_notifies ( 'Class[rabbitmq::service]' ) }
4950 end
5051
52+ context 'with enable_centos_release set to false' do
53+ let ( :params ) { { enable_centos_release : false } }
54+
55+ it { is_expected . not_to contain_package ( 'centos-release-rabbitmq-38' ) } if os_facts [ 'os' ] [ 'family' ] == 'RedHat'
56+ end
57+
5158 context 'with repos_ensure => true' do
5259 let ( :params ) { { repos_ensure : true } }
5360
You can’t perform that action at this time.
0 commit comments