Skip to content

Commit

Permalink
Re-enable repos_ensure by default
Browse files Browse the repository at this point in the history
This re-enables repos_ensure by default so that the newer packages
hosted in packagecloud are installed.
  • Loading branch information
kajinamit committed Mar 28, 2024
1 parent 2605e30 commit a18ab27
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
4 changes: 2 additions & 2 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -778,11 +778,11 @@ Default value: `'python'`
Data type: `Boolean`

Ensure that a repo with the official (and newer) RabbitMQ package is configured, along with its signing key.
Defaults to false (use system packages). This does not ensure that soft dependencies (like EPEL on RHEL systems) are present.
Defaults to true. This does not ensure that soft dependencies (like EPEL on RHEL systems) are present.
It also does not solve the erlang dependency. See https://www.rabbitmq.com/which-erlang.html for a good breakdown of the
different ways of handling the erlang deps. See also https://github.com/voxpupuli/puppet-rabbitmq/issues/788

Default value: `false`
Default value: `true`

##### <a name="-rabbitmq--service_ensure"></a>`service_ensure`

Expand Down
3 changes: 2 additions & 1 deletion data/family/RedHat.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
rabbitmq::python_package: 'python3'
rabbitmq::package_name: 'rabbitmq-server'
rabbitmq::service_name: 'rabbitmq-server'
rabbitmq::package_gpg_key: 'https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc'
rabbitmq::repo_gpg_key: 'https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey'
rabbitmq::repo_gpg_key: 'https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey'
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
# Name of the package required by rabbitmqadmin.
# @param repos_ensure
# Ensure that a repo with the official (and newer) RabbitMQ package is configured, along with its signing key.
# Defaults to false (use system packages). This does not ensure that soft dependencies (like EPEL on RHEL systems) are present.
# Defaults to true. This does not ensure that soft dependencies (like EPEL on RHEL systems) are present.
# It also does not solve the erlang dependency. See https://www.rabbitmq.com/which-erlang.html for a good breakdown of the
# different ways of handling the erlang deps. See also https://github.com/voxpupuli/puppet-rabbitmq/issues/788
# @param service_ensure
Expand Down Expand Up @@ -377,7 +377,7 @@
Variant[String, Array] $package_name = 'rabbitmq',
Optional[String] $package_source = undef,
Optional[String] $package_provider = undef,
Boolean $repos_ensure = false,
Boolean $repos_ensure = true,
Boolean $manage_python = true,
String $python_package = 'python',
String $rabbitmq_user = 'rabbitmq',
Expand Down
35 changes: 18 additions & 17 deletions spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@
it { is_expected.to contain_package('rabbitmq-server-plugins') } if os_facts[:os]['family'] == 'Suse'

context 'with default params' do
it { is_expected.not_to contain_class('rabbitmq::repo::apt') }
it { is_expected.not_to contain_apt__source('rabbitmq') }
it { is_expected.not_to contain_class('rabbitmq::repo::rhel') }
it { is_expected.not_to contain_yumrepo('rabbitmq') }
end

context 'with service_restart => false' do
let(:params) { { service_restart: false } }

it { is_expected.not_to contain_class('rabbitmq::config').that_notifies('Class[rabbitmq::service]') }
end

context 'with repos_ensure => true' do
let(:params) { { repos_ensure: true } }

if os_facts[:os]['family'] == 'Debian'
it 'includes rabbitmq::repo::apt' do
is_expected.to contain_class('rabbitmq::repo::apt').
Expand Down Expand Up @@ -85,8 +70,23 @@
end
end

context 'with service_restart => false' do
let(:params) { { service_restart: false } }

it { is_expected.not_to contain_class('rabbitmq::config').that_notifies('Class[rabbitmq::service]') }
end

context 'with repos_ensure => false' do
let(:params) { { repos_ensure: false } }

it { is_expected.not_to contain_class('rabbitmq::repo::apt') }
it { is_expected.not_to contain_apt__source('rabbitmq') }
it { is_expected.not_to contain_class('rabbitmq::repo::rhel') }
it { is_expected.not_to contain_yumrepo('rabbitmq') }
end

context 'with no pin', if: os_facts[:os]['family'] == 'Debian' do
let(:params) { { repos_ensure: true, package_apt_pin: '' } }
let(:params) { { package_apt_pin: '' } }

describe 'it sets up an apt::source' do
it {
Expand All @@ -100,7 +100,7 @@
end

context 'with pin', if: os_facts[:os]['family'] == 'Debian' do
let(:params) { { repos_ensure: true, package_apt_pin: '700' } }
let(:params) { { package_apt_pin: '700' } }

describe 'it sets up an apt::source and pin' do
it {
Expand Down Expand Up @@ -245,6 +245,7 @@
is_expected.to contain_class('rabbitmq::install::rabbitmqadmin')
is_expected.not_to contain_package('python')
is_expected.not_to contain_package('python2')
is_expected.not_to contain_package('python3')
end
end

Expand Down

0 comments on commit a18ab27

Please sign in to comment.