File tree 4 files changed +24
-2
lines changed
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:
219
219
* [ ` default_user ` ] ( #-rabbitmq--default_user )
220
220
* [ ` default_pass ` ] ( #-rabbitmq--default_pass )
221
221
* [ ` delete_guest_user ` ] ( #-rabbitmq--delete_guest_user )
222
+ * [ ` enable_centos_release ` ] ( #-rabbitmq--enable_centos_release )
222
223
* [ ` env_config ` ] ( #-rabbitmq--env_config )
223
224
* [ ` env_config_path ` ] ( #-rabbitmq--env_config_path )
224
225
* [ ` environment_variables ` ] ( #-rabbitmq--environment_variables )
@@ -508,6 +509,15 @@ Controls whether default guest user is deleted.
508
509
509
510
Default value: ` false `
510
511
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
+
511
521
##### <a name =" -rabbitmq--env_config " ></a >` env_config `
512
522
513
523
Data 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 161
161
# Password to set for the `default_user` in rabbitmq.config.
162
162
# @param delete_guest_user
163
163
# 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.
164
167
# @param env_config
165
168
# The template file to use for rabbitmq_env.config.
166
169
# @param env_config_path
369
372
String $default_user = ' guest' ,
370
373
String $default_pass = ' guest' ,
371
374
Boolean $delete_guest_user = false ,
375
+ Boolean $enable_centos_release = false ,
372
376
String $env_config = ' rabbitmq/rabbitmq-env.conf.epp' ,
373
377
Stdlib::Absolutepath $env_config_path = ' /etc/rabbitmq/rabbitmq-env.conf' ,
374
378
Optional[String] $erlang_cookie = undef ,
513
517
default: {
514
518
}
515
519
}
516
- } elsif $facts [' os' ][' family' ] == ' RedHat' {
520
+ } elsif $facts [' os' ][' family' ] == ' RedHat' and $enable_centos_release {
517
521
package { 'centos-release-rabbitmq-38' :
518
522
ensure => ' present' ,
519
523
}
Original file line number Diff line number Diff line change 39
39
it { is_expected . not_to contain_class ( 'rabbitmq::repo::rhel' ) }
40
40
it { is_expected . not_to contain_yumrepo ( 'rabbitmq' ) }
41
41
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'
43
44
end
44
45
45
46
context 'with service_restart => false' do
48
49
it { is_expected . not_to contain_class ( 'rabbitmq::config' ) . that_notifies ( 'Class[rabbitmq::service]' ) }
49
50
end
50
51
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
+
51
58
context 'with repos_ensure => true' do
52
59
let ( :params ) { { repos_ensure : true } }
53
60
You can’t perform that action at this time.
0 commit comments