Showing with 89 additions and 29 deletions.
  1. +9 −0 CHANGELOG.md
  2. +27 −0 REFERENCE.md
  3. +1 −0 data/common.yaml
  4. +1 −2 data/family/Archlinux.yaml
  5. +2 −1 data/family/RedHat.yaml
  6. +16 −0 manifests/init.pp
  7. +24 −12 manifests/repo/rhel.pp
  8. +1 −1 metadata.json
  9. +8 −13 spec/classes/rabbitmq_spec.rb
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
Each new release typically also includes the latest modulesync defaults.
These should not affect the functionality of the module.

## [v12.0.1](https://github.com/voxpupuli/puppet-rabbitmq/tree/v12.0.1) (2022-06-17)

[Full Changelog](https://github.com/voxpupuli/puppet-rabbitmq/compare/v12.0.0...v12.0.1)

**Fixed bugs:**

- Fixing Yum repo [\#907](https://github.com/voxpupuli/puppet-rabbitmq/pull/907) ([bishopbm1](https://github.com/bishopbm1))
- Use default install method on Archlinux [\#905](https://github.com/voxpupuli/puppet-rabbitmq/pull/905) ([wyardley](https://github.com/wyardley))

## [v12.0.0](https://github.com/voxpupuli/puppet-rabbitmq/tree/v12.0.0) (2022-03-28)

[Full Changelog](https://github.com/voxpupuli/puppet-rabbitmq/compare/v11.1.0...v12.0.0)
Expand Down
27 changes: 27 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,23 @@ class { 'rabbitmq':
}
```

##### Offline installation from local mirror:

```puppet
class { 'rabbitmq':
key_content => template('openstack/rabbit.pub.key'),
repo_gpg_key => '/tmp/rabbit.pub.key',
}
```

##### Use external package key source for any (apt/rpm) package provider:

```puppet
class { 'rabbitmq':
repo_gpg_key => 'http://www.some_site.some_domain/some_key.pub.key',
}
```

##### To use RabbitMQ Environment Variables, use the parameters `environment_variables` e.g.:

```puppet
Expand Down Expand Up @@ -600,6 +617,16 @@ Default value: 'installed'

Data type: `Optional[String]`

RPM package GPG key to import. Uses source method. Should be a URL for Debian/RedHat OS family, or a file name for
RedHat OS family. Set to https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
for Debian/RedHat OS Family by default.

Default value: `undef`

##### `repo_gpg_key`

Data type: `Optional[String]`

RPM package GPG key to import. Uses source method. Should be a URL for Debian/RedHat OS family, or a file name for
RedHat OS family. Set to https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey for Debian/RedHat OS Family by
default. Note, that `key_content`, if specified, would override this parameter for Debian OS family.
Expand Down
1 change: 1 addition & 0 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ rabbitmq::node_ip_address: ~
rabbitmq::package_apt_pin: ~
rabbitmq::package_ensure: 'installed'
rabbitmq::package_gpg_key: ~
rabbitmq::repo_gpg_key: ~
rabbitmq::package_name: 'rabbitmq'
rabbitmq::package_source: ~
rabbitmq::package_provider: ~
Expand Down
3 changes: 1 addition & 2 deletions data/family/Archlinux.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
---
rabbitmq::python_package: 'python2'
rabbitmq::rabbitmqadmin_package: 'rabbitmqadmin'
rabbitmq::python_package: 'python'
3 changes: 2 additions & 1 deletion data/family/RedHat.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
rabbitmq::package_name: 'rabbitmq-server'
rabbitmq::service_name: 'rabbitmq-server'
rabbitmq::package_gpg_key: 'https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey'
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'
16 changes: 16 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@
# package_gpg_key => 'http://www.some_site.some_domain/some_key.pub.key',
# }
#
# @example Offline installation from local mirror:
# class { 'rabbitmq':
# key_content => template('openstack/rabbit.pub.key'),
# repo_gpg_key => '/tmp/rabbit.pub.key',
# }
#
# @example Use external package key source for any (apt/rpm) package provider:
# class { 'rabbitmq':
# repo_gpg_key => 'http://www.some_site.some_domain/some_key.pub.key',
# }
#
# @example To use RabbitMQ Environment Variables, use the parameters `environment_variables` e.g.:
# class { 'rabbitmq':
# port => '5672',
Expand Down Expand Up @@ -211,6 +222,10 @@
# Determines the ensure state of the package. Set to installed by default, but could be changed to latest.
# @param package_gpg_key
# RPM package GPG key to import. Uses source method. Should be a URL for Debian/RedHat OS family, or a file name for
# RedHat OS family. Set to https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc
# for Debian/RedHat OS Family by default.
# @param repo_gpg_key
# RPM package GPG key to import. Uses source method. Should be a URL for Debian/RedHat OS family, or a file name for
# RedHat OS family. Set to https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey for Debian/RedHat OS Family by
# default. Note, that `key_content`, if specified, would override this parameter for Debian OS family.
# @param package_name
Expand Down Expand Up @@ -355,6 +370,7 @@
Optional[Variant[Numeric, String]] $package_apt_pin = undef,
String $package_ensure = 'installed',
Optional[String] $package_gpg_key = undef,
Optional[String] $repo_gpg_key = undef,
Variant[String, Array] $package_name = 'rabbitmq',
Optional[String] $package_source = undef,
Optional[String] $package_provider = undef,
Expand Down
36 changes: 24 additions & 12 deletions manifests/repo/rhel.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,34 @@
#
# @api private
class rabbitmq::repo::rhel (
$location = "https://packagecloud.io/rabbitmq/rabbitmq-server/el/${facts['os'][release][major]}/\$basearch",
String $key_source = $rabbitmq::package_gpg_key,
$location = "https://packagecloud.io/rabbitmq/rabbitmq-server/el/${facts['os'][release][major]}/\$basearch",
String $repo_key_source = $rabbitmq::repo_gpg_key,
String $package_key_source = $rabbitmq::package_gpg_key,
) {
# Import package key from rabbitmq to be able to
# sign the package and the repo.
# rabbitmq key is gpg-pubkey-6026dfca-573adfde
exec { "rpm --import ${package_key_source}":
path => ['/bin','/usr/bin','/sbin','/usr/sbin'],
unless => 'rpm -q gpg-pubkey-6026dfca-573adfde 2>/dev/null',
before => YumRepo['rabbitmq'],
}

yumrepo { 'rabbitmq':
ensure => present,
name => 'rabbitmq_rabbitmq-server',
baseurl => $location,
gpgkey => $key_source,
enabled => 1,
gpgcheck => 1,
ensure => present,
name => 'rabbitmq_rabbitmq-server',
baseurl => $location,
gpgkey => $repo_key_source,
enabled => 1,
gpgcheck => 1,
repo_gpgcheck => 1,
}

# This may still be needed to prevent warnings
# packagecloud key is gpg-pubkey-d59097ab-52d46e88
exec { "rpm --import ${key_source}":
path => ['/bin','/usr/bin','/sbin','/usr/sbin'],
unless => 'rpm -q gpg-pubkey-6026dfca-573adfde 2>/dev/null',
# packagecloud key is gpg-pubkey-4d206f89-5bbb8d59
exec { "rpm --import ${repo_key_source}":
path => ['/bin','/usr/bin','/sbin','/usr/sbin'],
unless => 'rpm -q gpg-pubkey-4d206f89-5bbb8d59 2>/dev/null',
require => YumRepo['rabbitmq'],
}
}
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppet-rabbitmq",
"version": "12.0.0",
"version": "12.0.1",
"author": "voxpupuli",
"summary": "Installs, configures, and manages RabbitMQ.",
"license": "Apache-2.0",
Expand Down
21 changes: 8 additions & 13 deletions spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,20 +231,15 @@
end
end

if facts[:os]['family'] == 'Archlinux'
it 'installs a package called rabbitmqadmin' do
is_expected.to contain_package('rabbitmqadmin').with_name('rabbitmqadmin')
end
else
it 'we enable the admin interface by default' do
is_expected.to contain_class('rabbitmq::install::rabbitmqadmin')
is_expected.to contain_rabbitmq_plugin('rabbitmq_management').with(
notify: 'Class[Rabbitmq::Service]'
)
is_expected.to contain_archive('rabbitmqadmin').with_source('http://1.1.1.1:15672/cli/rabbitmqadmin')
end
it 'we enable the admin interface by default' do
is_expected.to contain_class('rabbitmq::install::rabbitmqadmin')
is_expected.to contain_rabbitmq_plugin('rabbitmq_management').with(
notify: 'Class[Rabbitmq::Service]'
)
is_expected.to contain_archive('rabbitmqadmin').with_source('http://1.1.1.1:15672/cli/rabbitmqadmin')
end
it { is_expected.to contain_package('python') } if %w[RedHat Debian SUSE].include?(facts[:os]['family'])

it { is_expected.to contain_package('python') } if %w[RedHat Debian SUSE Archlinux].include?(facts[:os]['family'])
it { is_expected.to contain_package('python2') } if %w[FreeBSD OpenBSD].include?(facts[:os]['family'])
end

Expand Down