Skip to content

Commit

Permalink
Merge 334005e into d4b06b7
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Mar 7, 2018
2 parents d4b06b7 + 334005e commit 7d6d12c
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .msync.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
modulesync_config_version: '1.6.0'
modulesync_config_version: '1.8.0'
15 changes: 9 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,26 @@ matrix:
include:
- rvm: 2.1.9
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=16
- rvm: 2.4.2
env: PUPPET_VERSION="~> 4.0" CHECK=test PARALLEL_TEST_PROCESSORS=12
- rvm: 2.4.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
- rvm: 2.4.2
- rvm: 2.5.0
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=test_with_coveralls
- rvm: 2.4.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=rubocop
- rvm: 2.4.2
- rvm: 2.4.3
bundler_args: --without system_tests development release
env: PUPPET_VERSION="~> 5.0" CHECK=build DEPLOY_TO_FORGE=yes
- rvm: 2.4.2
- rvm: 2.4.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/ubuntu-16.04 CHECK=beaker
services: docker
sudo: required
- rvm: 2.4.2
- rvm: 2.4.3
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_set=docker/centos-7 CHECK=beaker
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def location_for(place, fake_version = nil)
end

group :test do
gem 'puppetlabs_spec_helper', '~> 2.5.0', :require => false
gem 'puppetlabs_spec_helper', '~> 2.6.0', :require => false
gem 'rspec-puppet', '~> 2.5', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'rspec-puppet-utils', :require => false
Expand Down Expand Up @@ -57,7 +57,7 @@ group :system_tests do
end

group :release do
gem 'github_changelog_generator', :require => false if RUBY_VERSION >= '2.2.2'
gem 'github_changelog_generator', :require => false, :git => 'https://github.com/skywinder/github-changelog-generator' if RUBY_VERSION >= '2.2.2'
gem 'puppet-blacksmith', :require => false
gem 'voxpupuli-release', :require => false, :git => 'https://github.com/voxpupuli/voxpupuli-release-gem'
gem 'puppet-strings', '~> 1.0', :require => false
Expand Down
21 changes: 21 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,27 @@
notify => Class['Rabbitmq::Service'],
}
}
'Archlinux': {
file { '/etc/systemd/system/rabbitmq.service.d':
ensure => directory,
owner => '0',
group => '0',
mode => '0755',
selinux_ignore_defaults => true,
}
-> file { '/etc/systemd/system/rabbitmq.service.d/limits.conf':
content => template('rabbitmq/rabbitmq-server.service.d/limits.conf'),
owner => '0',
group => '0',
mode => '0644',
notify => Exec['rabbitmq-systemd-reload'],
}
exec { 'rabbitmq-systemd-reload':
command => '/bin/systemctl daemon-reload',
notify => Class['Rabbitmq::Service'],
refreshonly => true,
}
}
default: {
}
}
Expand Down
2 changes: 0 additions & 2 deletions spec/acceptance/nodesets/fedora-25-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
# platform is fedora 24 because there is no
# puppet-agent for fedora 25 by 2016-12-30
HOSTS:
fedora-25-x64:
roles:
Expand Down
16 changes: 16 additions & 0 deletions spec/acceptance/nodesets/fedora-26-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
HOSTS:
fedora-26-x64:
roles:
- master
platform: fedora-26-x86_64
box: fedora/26-cloud-base
hypervisor: vagrant
CONFIG:
type: aio
...
# vim: syntax=yaml
18 changes: 18 additions & 0 deletions spec/acceptance/nodesets/fedora-27-x64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
# This file is managed via modulesync
# https://github.com/voxpupuli/modulesync
# https://github.com/voxpupuli/modulesync_config
#
# platform is fedora 26 because there is no puppet-agent
# for fedora 27 as of 2017-11-17
HOSTS:
fedora-27-x64:
roles:
- master
platform: fedora-26-x86_64
box: fedora/27-cloud-base
hypervisor: vagrant
CONFIG:
type: aio
...
# vim: syntax=yaml
43 changes: 25 additions & 18 deletions spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
context "on #{os}" do
let(:facts) { facts }

packagename = case facts[:osfamily]
when 'Archlinux'
'rabbitmq'
else
'rabbitmq-server'
end
has_systemd = (
(facts[:os]['family'] == 'RedHat' && facts[:os]['release']['major'].to_i >= 7) ||
(facts[:os]['family'] == 'Debian' && facts[:os]['release']['full'] == '16.04') ||
Expand All @@ -30,7 +36,7 @@
it { is_expected.to contain_class('rabbitmq::config') }
it { is_expected.to contain_class('rabbitmq::service') }

it { is_expected.to contain_package('rabbitmq-server').with_ensure('installed').with_name('rabbitmq-server') }
it { is_expected.to contain_package('rabbitmq-server').with_ensure('installed').with_name(packagename) }

context 'with default params' do
it { is_expected.not_to contain_class('rabbitmq::repo::apt') }
Expand Down Expand Up @@ -137,7 +143,7 @@

if has_systemd
it do
is_expected.to contain_file('/etc/systemd/system/rabbitmq-server.service.d/limits.conf').
is_expected.to contain_file("/etc/systemd/system/#{packagename}.service.d/limits.conf").
with_owner('0').
with_group('0').
with_mode('0644').
Expand All @@ -162,7 +168,7 @@

context 'on systems with systemd', if: has_systemd do
it {
is_expected.to contain_file('/etc/systemd/system/rabbitmq-server.service.d').with(
is_expected.to contain_file("/etc/systemd/system/#{packagename}.service.d").with(
'ensure' => 'directory',
'owner' => '0',
'group' => '0',
Expand All @@ -171,7 +177,7 @@
)
}

it { is_expected.to contain_file('/etc/systemd/system/rabbitmq-server.service.d/limits.conf') }
it { is_expected.to contain_file("/etc/systemd/system/#{packagename}.service.d/limits.conf") }

it {
is_expected.to contain_exec('rabbitmq-systemd-reload').with(
Expand Down Expand Up @@ -205,18 +211,19 @@
it 'installs a package called rabbitmqadmin' do
is_expected.to contain_package('rabbitmqadmin').with_name('rabbitmqadmin')
end
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')
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
end
if %w[RedHat Debian SUSE].include?(facts[:os]['family'])
it { is_expected.to contain_package('python') }
end
if %w[Archlinux FreeBSD OpenBSD].include?(facts[:os]['family'])
if %w[FreeBSD OpenBSD].include?(facts[:os]['family'])
it { is_expected.to contain_package('python2') }
end
end
Expand All @@ -230,7 +237,7 @@
end
end

context 'with $management_ip_address undef and service_manage set to true' do
context 'with $management_ip_address undef and service_manage set to true', unless: facts[:osfamily] == 'Archlinux' do
let(:params) { { admin_enable: true, management_ip_address: :undef } }

it 'we enable the admin interface by default' do
Expand All @@ -241,7 +248,7 @@
is_expected.to contain_archive('rabbitmqadmin').with_source('http://127.0.0.1:15672/cli/rabbitmqadmin')
end
end
context 'with service_manage set to true, node_ip_address = undef, and default user/pass specified' do
context 'with service_manage set to true, node_ip_address = undef, and default user/pass specified', unless: facts[:osfamily] == 'Archlinux' do
let(:params) { { admin_enable: true, default_user: 'foobar', default_pass: 'hunter2', node_ip_address: :undef } }

it 'we use the correct URL to rabbitmqadmin' do
Expand All @@ -252,7 +259,7 @@
)
end
end
context 'with service_manage set to true and default user/pass specified' do
context 'with service_manage set to true and default user/pass specified', unless: facts[:osfamily] == 'Archlinux' do
let(:params) { { admin_enable: true, default_user: 'foobar', default_pass: 'hunter2', management_ip_address: '1.1.1.1' } }

it 'we use the correct URL to rabbitmqadmin' do
Expand All @@ -263,7 +270,7 @@
)
end
end
context 'with service_manage set to true and archive_options set' do
context 'with service_manage set to true and archive_options set', unless: facts[:osfamily] == 'Archlinux' do
let(:params) do
{
admin_enable: true,
Expand All @@ -279,7 +286,7 @@
)
end
end
context 'with service_manage set to true and management port specified' do
context 'with service_manage set to true and management port specified', unless: facts[:osfamily] == 'Archlinux' do
# note that the 2.x management port is 55672 not 15672
let(:params) { { admin_enable: true, management_port: 55_672, management_ip_address: '1.1.1.1' } }

Expand All @@ -291,7 +298,7 @@
)
end
end
context 'with ipv6, service_manage set to true and management port specified' do
context 'with ipv6, service_manage set to true and management port specified', unless: facts[:osfamily] == 'Archlinux' do
# note that the 2.x management port is 55672 not 15672
let(:params) { { admin_enable: true, management_port: 55_672, management_ip_address: '::1' } }

Expand Down

0 comments on commit 7d6d12c

Please sign in to comment.