...
 
Commits (10)
......@@ -16,42 +16,42 @@ verifier:
sudo: false
platforms:
- name: centos-6
- name: centos-8
driver:
image: dokken/centos-6
platform: rhel
pid_one_command: /sbin/init
hostname: localhost
intermediate_instructions:
- RUN yum -y install sudo which initscripts
- name: centos-7.4
driver:
image: dokken/centos-7
image: dokken/centos-8
platform: rhel
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:
- RUN yum -y install sudo lsof which systemd-sysv initscripts openssl net-tools
- name: fedora-31
- name: centos-7
driver:
image: dokken/centos-7
platform: rhel
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:
- RUN yum -y install sudo lsof which systemd-sysv initscripts openssl net-tools
- name: fedora-32
driver:
image: dokken/fedora-31
image: dokken/fedora-32
pid_one_command: /usr/lib/systemd/systemd
intermediate_instructions:
- RUN dnf -y install sudo
- name: ubuntu-18.04
- name: ubuntu-20.04
driver:
image: dokken/ubuntu-18.04
image: dokken/ubuntu-20.04
pid_one_command: /bin/systemd
intermediate_instructions:
- ENV DEBIAN_FRONTEND noninteractive
- RUN /usr/bin/apt-get update -y
- RUN /usr/bin/apt-get install -y ca-certificates sudo apt-transport-https lsb-release procps net-tools
- name: debian-9
- name: debian-10
driver:
image: dokken/debian-9
image: dokken/debian-10
pid_one_command: /bin/systemd
intermediate_instructions:
- ENV DEBIAN_FRONTEND noninteractive
......@@ -71,7 +71,7 @@ suites:
erlang:
install_method: "esl"
esl:
version: "1:21.3.8.16-1"
version: "1:23.0.2-1"
rabbitmq:
# export RABBITMQ_VERSION="3.7.14-alpha.11"
version: <%= ENV['RABBITMQ_VERSION'] %>
......@@ -81,9 +81,9 @@ suites:
verifier:
inspec_tests:
- test/integration/default
includes: ["ubuntu-18.04", "debian-9"]
includes: ["ubuntu-20.04", "debian-10"]
- name: default-rpm-el7-alpha
- name: default-rpm-el8-alpha
run_list:
- recipe[rabbitmq::erlang_package]
- recipe[rabbitmq::plugins]
......@@ -91,18 +91,18 @@ suites:
rabbitmq:
erlang:
enabled: true
version: "21.3.8.16"
version: "23.0.2"
# export RABBITMQ_VERSION="3.7.13-alpha.21"
version: <%= ENV['RABBITMQ_VERSION'] %>
rpm_package_url: "https://dl.bintray.com/rabbitmq/all-dev/rabbitmq-server/<%= ENV['RABBITMQ_VERSION'] %>/"
rpm_package: "rabbitmq-server-<%= ENV['RABBITMQ_VERSION'].to_s.gsub(/\-alpha/, "~alpha") %>-1.el7.noarch.rpm"
rpm_package: "rabbitmq-server-<%= ENV['RABBITMQ_VERSION'].to_s.gsub(/\-alpha/, "~alpha") %>-1.el8.noarch.rpm"
verifier:
inspec_tests:
- test/integration/default
includes: ["centos-7", "fedora-31"]
includes: ["centos-8", "fedora-32"]
- name: default-rpm-el6-alpha
- name: default-rpm-el7-alpha
run_list:
- recipe[erlang::default]
- recipe[rabbitmq::plugins]
......@@ -110,14 +110,14 @@ suites:
erlang:
install_method: "esl"
esl:
version: "21.3.8.16-1"
version: "23.0.2-1"
rabbitmq:
# export RABBITMQ_VERSION="3.7.13-alpha.21"
# export RABBITMQ_VERSION="3.8.6-alpha.21"
version: <%= ENV['RABBITMQ_VERSION'] %>
rpm_package_url: "https://dl.bintray.com/rabbitmq/all-dev/rabbitmq-server/<%= ENV['RABBITMQ_VERSION'] %>/"
rpm_package: "rabbitmq-server-<%= ENV['RABBITMQ_VERSION'].to_s.gsub(/\-alpha/, "~alpha") %>-1.el6.noarch.rpm"
rpm_package: "rabbitmq-server-<%= ENV['RABBITMQ_VERSION'].to_s.gsub(/\-alpha/, "~alpha") %>-1.el7.noarch.rpm"
verifier:
inspec_tests:
- test/integration/default
includes: ["centos-6"]
includes: ["centos-7"]
......@@ -83,6 +83,15 @@ platforms:
intermediate_instructions:
- RUN yum -y install sudo lsof which systemd-sysv initscripts openssl net-tools
- name: ubuntu-20.04
driver:
image: dokken/ubuntu-20.04
pid_one_command: /bin/systemd
intermediate_instructions:
- ENV DEBIAN_FRONTEND noninteractive
- RUN /usr/bin/apt-get update -y
- RUN /usr/bin/apt-get install -y ca-certificates sudo apt-transport-https lsb-release procps net-tools
- name: ubuntu-18.04
driver:
image: dokken/ubuntu-18.04
......@@ -176,7 +185,7 @@ suites:
verifier:
inspec_tests:
- test/integration/default
includes: ["ubuntu-18.04", "ubuntu-16.04", "debian-10", "debian-9"]
includes: ["ubuntu-20.04", "ubuntu-18.04", "ubuntu-16.04", "debian-10", "debian-9"]
- name: management-plugin-deb
run_list:
......@@ -186,9 +195,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "1:21.3.8.16-1"
version: "1:23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/integration/management_plugin
......@@ -203,9 +212,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "1:21.3.8.16-1"
version: "1:23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
systemd:
limits:
NOFILE: 54000
......@@ -274,9 +283,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "21.3.8.16-1"
version: "23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/integration/default
......@@ -307,9 +316,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "21.3.8.16-1"
version: "23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
systemd:
limits:
NOFILE: 54000
......@@ -326,9 +335,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "1:21.3.8.16-1"
version: "1:23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/integration/default
......@@ -343,9 +352,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "1:21.3.8.16-1"
version: "1:23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/integration/default
......@@ -360,9 +369,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "21.3.8.16-1"
version: "23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/integration/default
......@@ -377,9 +386,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "1:21.3.8.16-1"
version: "1:23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
attributes:
apt:
confd:
......@@ -388,9 +397,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "1:21.3.8.16-1"
version: "1:23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/integration/default
......@@ -408,9 +417,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "1:21.3.8.16-1"
version: "1:23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/integration/default
......@@ -420,7 +429,7 @@ suites:
# Team RabbitMQ Erlang packages
#
# Latest Erlang package, Debian, HiPE enabled
# Latest Erlang package, Debian
- name: rabbitmq-erlang-latest-deb
run_list:
- recipe[rabbitmq::erlang_package]
......@@ -431,12 +440,11 @@ suites:
rabbitmq:
erlang:
enabled: true
hipe: true
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/erlang_package/latest_deb
includes: ["debian-10", "debian-9", "ubuntu-18.04", "ubuntu-16.04"]
includes: ["debian-10", "debian-9", "ubuntu-18.04", "ubuntu-20.04"]
# Erlang package, Debian, version pinning
- name: rabbitmq-erlang-pinned-deb
......@@ -447,15 +455,16 @@ suites:
rabbitmq:
erlang:
enabled: true
version: "1:21.3.8.16-1"
version: "3.7.26"
version: "1:22.3.4.4-1"
version: "3.8.5"
verifier:
inspec_tests:
- test/erlang_package/pinned_deb
includes: ["debian-10", "ubuntu-18.04", "ubuntu-16.04"]
includes: ["debian-10", "ubuntu-18.04", "ubuntu-20.04"]
# Latest Erlang package, RPM
- name: rabbitmq-erlang-latest-rpm-el7
- name: rabbitmq-erlang-latest-rpm-el8
run_list:
- recipe[rabbitmq::erlang_package]
- recipe[rabbitmq::default]
......@@ -465,12 +474,48 @@ suites:
rabbitmq:
erlang:
enabled: true
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/erlang_package/latest_rpm
includes: ["fedora-31", "centos-7", "centos-8"]
# Erlang package, RPM, version pinning
- name: rabbitmq-erlang-pinned-rpm-el8
run_list:
- recipe[rabbitmq::erlang_package]
- recipe[rabbitmq::default]
attributes:
rabbitmq:
erlang:
enabled: true
version: "23.0.2"
yum:
baseurl: https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/23/el/8
repo_gpgcheck: true
version: "3.8.5"
verifier:
inspec_tests:
- test/erlang_package/pinned_rpm
includes: ["fedora-31", "centos-8"]
# Latest Erlang package, RPM
- name: rabbitmq-erlang-latest-rpm-el7
run_list:
- recipe[rabbitmq::erlang_package]
- recipe[rabbitmq::default]
attributes:
# relies on node.rabbitmq.erlang.version default
# which is nil/"install latest"
rabbitmq:
erlang:
enabled: true
version: "3.8.5"
verifier:
inspec_tests:
- test/erlang_package/latest_rpm
includes: ["centos-7"]
# Erlang package, RPM, version pinning
- name: rabbitmq-erlang-pinned-rpm-el7
run_list:
......@@ -480,15 +525,15 @@ suites:
rabbitmq:
erlang:
enabled: true
version: "21.3.8.16"
version: "22.3.4.4"
yum:
baseurl: https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/21/el/7
baseurl: https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/22/el/7
repo_gpgcheck: true
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/erlang_package/pinned_rpm
includes: ["fedora-31", "centos-7", "centos-8"]
includes: ["centos-7"]
# Latest Erlang package, RPM, CentOS 6 repo
- name: rabbitmq-erlang-latest-rpm-el6
......@@ -500,9 +545,9 @@ suites:
erlang:
enabled: true
yum:
baseurl: https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/21/el/6
baseurl: https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/23/el/6
repo_gpgcheck: false
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/erlang_package/latest_rpm
......@@ -517,11 +562,11 @@ suites:
rabbitmq:
erlang:
enabled: true
version: "21.3.8.16"
version: "22.3.4.4"
yum:
baseurl: https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/21/el/6
baseurl: https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/22/el/6
repo_gpgcheck: true
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/erlang_package/pinned_rpm
......@@ -538,7 +583,7 @@ suites:
enabled: true
zypper:
baseurl: https://download.opensuse.org/repositories/network:/messaging:/amqp/openSUSE_Leap_15.1/
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/erlang_package/latest_rpm
......
......@@ -14,12 +14,13 @@ transport:
platforms:
- name: centos-7
- name: centos-8
- name: ubuntu-16.04
- name: ubuntu-18.04
- name: ubuntu-20.04
- name: debian-10
- name: fedora-31
- name: fedora-30
- name: centos-6
- name: fedora-31
- name: opensuse-leap-15
#
......@@ -39,9 +40,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "1:21.3.8.16-1"
version: "1:23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
virtualhosts:
- vhost1
- vhost2
......@@ -72,7 +73,7 @@ suites:
verifier:
inspec_tests:
- test/integration/default
includes: ["ubuntu-18.04", "ubuntu-16.04", "debian-10"]
includes: ["ubuntu-20.04", "ubuntu-18.04", "ubuntu-16.04", "debian-10"]
- name: management-plugin-deb
run_list:
......@@ -82,9 +83,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "1:21.3.8.16-1"
version: "1:23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/integration/management_plugin
......@@ -99,16 +100,16 @@ suites:
erlang:
install_method: "esl"
esl:
version: "1:21.3.8.16-1"
version: "1:23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
systemd:
limits:
NOFILE: 54000
verifier:
inspec_tests:
- test/integration/limits
includes: ["ubuntu-18.04", "ubuntu-16.04", "debian-10"]
includes: ["ubuntu-20.04", "ubuntu-18.04", "debian-10"]
- name: use-distro-version-deb
run_list:
......@@ -170,9 +171,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "21.3.8.16-1"
version: "23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/integration/default
......@@ -186,7 +187,7 @@ suites:
rabbitmq:
erlang:
enabled: true
version: "22.3.4"
version: "22.3.4.4"
version: "3.8.5"
verifier:
inspec_tests:
......@@ -203,9 +204,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "21.3.8.16-1"
version: "23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
systemd:
limits:
NOFILE: 54000
......@@ -222,9 +223,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "1:21.3.8.16-1"
version: "1:23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/integration/default
......@@ -239,9 +240,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "1:21.3.8.16-1"
version: "1:23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/integration/default
......@@ -256,9 +257,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "21.3.8.16-1"
version: "23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/integration/default
......@@ -273,9 +274,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "1:21.3.8.16-1"
version: "1:23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
attributes:
apt:
confd:
......@@ -284,9 +285,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "1:21.3.8.16-1"
version: "1:23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/integration/default
......@@ -304,9 +305,9 @@ suites:
erlang:
install_method: "esl"
esl:
version: "1:21.3.8.16-1"
version: "1:23.0.2-1"
rabbitmq:
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/integration/default
......@@ -316,7 +317,7 @@ suites:
# Team RabbitMQ Erlang packages
#
# Latest Erlang package, Debian, HiPE enabled
# Latest Erlang package, Debian
- name: rabbitmq-erlang-latest-deb
run_list:
- recipe[rabbitmq::erlang_package]
......@@ -350,7 +351,7 @@ suites:
includes: ["ubuntu-18.04"]
# Latest Erlang package, RPM
- name: rabbitmq-erlang-latest-rpm-el7
- name: rabbitmq-erlang-latest-rpm-el8
run_list:
- recipe[rabbitmq::erlang_package]
- recipe[rabbitmq::default]
......@@ -364,10 +365,10 @@ suites:
verifier:
inspec_tests:
- test/erlang_package/latest_rpm
includes: ["fedora-30", "centos-7"]
includes: ["fedora-31", "centos-8"]
# Erlang package, RPM, version pinning
- name: rabbitmq-erlang-pinned-rpm-el7
- name: rabbitmq-erlang-pinned-rpm-el8
run_list:
- recipe[rabbitmq::erlang_package]
- recipe[rabbitmq::default]
......@@ -375,15 +376,15 @@ suites:
rabbitmq:
erlang:
enabled: true
version: "22.3.4"
version: "23.0.3"
yum:
baseurl: https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/21/el/7
baseurl: https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/23/el/8
repo_gpgcheck: true
version: "3.8.5"
verifier:
inspec_tests:
- test/erlang_package/pinned_rpm
includes: ["fedora-30", "centos-7"]
includes: ["fedora-31", "centos-8"]
# Latest Erlang package, RPM, CentOS 6 repo
- name: rabbitmq-erlang-latest-rpm-el6
......@@ -395,7 +396,7 @@ suites:
erlang:
enabled: true
yum:
baseurl: https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/21/el/6
baseurl: https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/23/el/6
repo_gpgcheck: false
version: "3.8.5"
verifier:
......@@ -412,9 +413,9 @@ suites:
rabbitmq:
erlang:
enabled: true
version: "22.3.4"
version: "22.3.4.4"
yum:
baseurl: https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/21/el/6
baseurl: https://dl.bintray.com/rabbitmq-erlang/rpm/erlang/22/el/6
repo_gpgcheck: true
version: "3.8.5"
verifier:
......@@ -433,7 +434,7 @@ suites:
enabled: true
zypper:
baseurl: https://download.opensuse.org/repositories/network:/messaging:/amqp/openSUSE_Leap_15.1
version: "3.7.26"
version: "3.8.5"
verifier:
inspec_tests:
- test/erlang_package/latest_rpm
......
AlignParameters:
AsciiComments:
Enabled: false
AsciiComments:
ChefStyle/CommentFormat:
Enabled: false
ChefModernize/FoodcriticComments:
Enabled: false
ChefModernize/ExecuteSleep:
Enabled: false
Encoding:
Layout/ParameterAlignment:
Enabled: false
Layout/ElseAlignment:
......@@ -16,18 +22,21 @@ Layout/EndAlignment:
Layout/IndentationWidth:
Enabled: false
LineLength:
Layout/LineLength:
Max: 200
MethodLength:
Max: 18
Naming/FileName:
Enabled: false
Metrics/AbcSize:
Max: 16
Metrics/MethodLength:
Max: 18
Style/Encoding:
Enabled: false
Style/RegexpLiteral:
Enabled: false
......
......@@ -186,7 +186,7 @@ No changes yet.
rabbitmq_erlang_apt_repository_on_bintray 'rabbitmq_erlang_repo_on_bintray' do
distribution node['lsb']['codename'] unless node['lsb'].nil?
# See https://www.rabbitmq.com/install-debian.html
components ['erlang-21.x']
components ['erlang-22.x']
action :add
end
......@@ -207,11 +207,8 @@ No changes yet.
``` ruby
rabbitmq_erlang_package_from_bintray 'rabbitmq_erlang' do
# This package version assumes a Debian-based distribution.
# On RHEL/CentOS/Fedora it would be '21.3.8.16'
version '1:21.3.8.16-1'
# provision a HiPE-enabled Erlang runtime if available
use_hipe true
# On RHEL/CentOS/Fedora it would be '22.3.4.4'
version '1:22.3.4.4-1'
action :install
end
......
This diff is collapsed.
......@@ -22,8 +22,8 @@ default['rabbitmq']['erlang']['enabled'] = false
# suggests that the intent is to use recipe[rabbitmq::erlang_package]
#
if !node['rabbitmq']['use_distro_version'] && !node['rabbitmq']['erlang']['enabled'] &&
(node['platform'] == 'debian' && node['platform_version'].to_i < 8 ||
platform_family?('rhel', 'centos', 'scientific') && node['platform_version'].to_i < 7)
(platform_family?('debian') && node['platform_version'].to_i < 8 ||
platform_family?('rhel') && node['platform_version'].to_i < 7)
default['erlang']['install_method'] = 'esl'
end
......@@ -248,6 +248,8 @@ default['rabbitmq']['additional_rabbit_configs'] = {}
# if setting to a specific version, apt repository components
# will have to be updated
default['rabbitmq']['erlang']['version'] = nil
# HiPE's been deprecated since Erlang/OTP 22 and is going away in Erlang/OTP 24.
# DO NOT USE.
default['rabbitmq']['erlang']['hipe'] = false
default['rabbitmq']['erlang']['retry_delay'] = 10
......
......@@ -37,7 +37,7 @@ def run_rabbitmqctl(*args)
cmd.error!
Chef::Log.debug("[rabbitmq_cluster] #{cmd.stdout}")
rescue
Chef::Application.fatal!("[rabbitmq_cluster] #{cmd.stderr}")
raise("[rabbitmq_cluster] #{cmd.stderr}")
end
end
......@@ -63,7 +63,7 @@ end
# Match regex pattern from result of rabbitmqctl cluster_status
def match_pattern_cluster_status(cluster_status, pattern)
if cluster_status.nil? || cluster_status.to_s.empty?
Chef::Application.fatal!('[rabbitmq_cluster] cluster_status should not be empty')
raise('[rabbitmq_cluster] cluster_status should not be empty')
end
match = cluster_status.match(pattern)
match && match[2]
......@@ -181,7 +181,7 @@ def change_cluster_node_type(cluster_node_type)
if err.include?('{not_clustered,"Non-clustered nodes can only be disc nodes."}')
Chef::Log.info('[rabbitmq_cluster] Node is not clustered yet, error will be ignored.')
else
Chef::Application.fatal!("[rabbitmq_cluster] #{err}")
raise("[rabbitmq_cluster] #{err}")
end
end
end
......@@ -196,7 +196,7 @@ end
action :join do
Chef::Log.info('[rabbitmq_cluster] Action join ... ')
Chef::Application.fatal!('rabbitmq_cluster with action :join requires a non-nil/empty cluster_nodes.') if new_resource.cluster_nodes.nil? || new_resource.cluster_nodes.empty?
raise('rabbitmq_cluster with action :join requires a non-nil/empty cluster_nodes.') if new_resource.cluster_nodes.nil? || new_resource.cluster_nodes.empty?
var_cluster_status = cluster_status
var_node_name = node_name
......@@ -220,7 +220,7 @@ action :join do
begin
join_cluster(var_node_name_to_join, var_node_type)
rescue JoinError => exc
Chef::Application.fatal!("[rabbitmq_cluster] #{exc.message}")
raise("[rabbitmq_cluster] #{exc.message}")
ensure
run_rabbitmqctl('start_app')
end
......@@ -232,7 +232,7 @@ end
# Action for set cluster name
action :set_cluster_name do
Chef::Application.fatal!('rabbitmq_cluster with action :join requires a non-nil/empty cluster_nodes.') if new_resource.cluster_nodes.nil? || new_resource.cluster_nodes.empty?
raise('rabbitmq_cluster with action :join requires a non-nil/empty cluster_nodes.') if new_resource.cluster_nodes.nil? || new_resource.cluster_nodes.empty?
var_cluster_status = cluster_status
var_cluster_name = new_resource.cluster_name
if current_cluster_name(var_cluster_status).nil?
......@@ -251,7 +251,7 @@ end
action :change_cluster_node_type do
Chef::Log.info('[rabbitmq_cluster] Action change_cluster_node_type ... ')
Chef::Application.fatal!('rabbitmq_cluster with action :join requires a non-nil/empty cluster_nodes.') if new_resource.cluster_nodes.nil? || new_resource.cluster_nodes.empty?
raise('rabbitmq_cluster with action :join requires a non-nil/empty cluster_nodes.') if new_resource.cluster_nodes.nil? || new_resource.cluster_nodes.empty?
var_cluster_status = cluster_status
var_node_name = node_name
......
......@@ -105,7 +105,7 @@ action :remove do
end
end
if platform_family?('rhel', 'fedora', 'amazon')
if platform_family?('rhel', 'fedora')
package new_resource.name do
action :remove
end
......
......@@ -92,7 +92,7 @@ end
action :add do
unless user_exists?(new_resource.user)
Chef::Application.fatal!('rabbitmq_user with action :add requires a non-nil/empty password.') if new_resource.password.nil? || new_resource.password.empty?
raise('rabbitmq_user with action :add requires a non-nil/empty password.') if new_resource.password.nil? || new_resource.password.empty?
# To escape single quotes in a shell, you have to close the surrounding single quotes, add
# in an escaped single quote, and then re-open the original single quotes.
......@@ -121,7 +121,7 @@ action :delete do
end
action :set_permissions do
Chef::Application.fatal!("rabbitmq_user action :set_permissions fails with nonexistent '#{new_resource.user}' user.") unless user_exists?(new_resource.user)
raise("rabbitmq_user action :set_permissions fails with nonexistent '#{new_resource.user}' user.") unless user_exists?(new_resource.user)
perm_list = new_resource.permissions.split
vhosts = new_resource.vhost.is_a?(Array) ? new_resource.vhost : [new_resource.vhost]
......@@ -138,7 +138,7 @@ action :set_permissions do
end
action :clear_permissions do
Chef::Application.fatal!("rabbitmq_user action :clear_permissions fails with nonexistent '#{new_resource.user}' user.") unless user_exists?(new_resource.user)
raise("rabbitmq_user action :clear_permissions fails with nonexistent '#{new_resource.user}' user.") unless user_exists?(new_resource.user)
vhosts = new_resource.vhost.is_a?(Array) ? new_resource.vhost : [new_resource.vhost]
# filter out vhosts for which the user already has the permissions we expect
......@@ -154,7 +154,7 @@ action :clear_permissions do
end
action :set_tags do
Chef::Application.fatal!("rabbitmq_user action :set_tags fails with nonexistent '#{new_resource.user}' user.") unless user_exists?(new_resource.user)
raise("rabbitmq_user action :set_tags fails with nonexistent '#{new_resource.user}' user.") unless user_exists?(new_resource.user)
unless user_has_tag?(new_resource.user, new_resource.tag)
cmd = "rabbitmqctl -q set_user_tags #{new_resource.user} #{new_resource.tag}"
......@@ -166,7 +166,7 @@ action :set_tags do
end
action :clear_tags do
Chef::Application.fatal!("rabbitmq_user action :clear_tags fails with nonexistent '#{new_resource.user}' user.") unless user_exists?(new_resource.user)
raise("rabbitmq_user action :clear_tags fails with nonexistent '#{new_resource.user}' user.") unless user_exists?(new_resource.user)
unless user_has_tag?(new_resource.user, '"\[\]"')
cmd = "rabbitmqctl -q set_user_tags #{new_resource.user}"
......
......@@ -98,7 +98,7 @@ if platform_family?('debian')
if node['platform_version'].to_i == 7 && !use_distro_version?
Chef::Log.warn 'Debian 7 is too old to use the recent .deb RabbitMQ packages. Falling back to distro package!'
node.normal['rabbitmq']['use_distro_version'] = true
node.override['rabbitmq']['use_distro_version'] = true
end
if use_distro_version?
......@@ -365,8 +365,9 @@ existing_erlang_key = if File.exist?(node['rabbitmq']['erlang_cookie_path']) &&
end
if node['rabbitmq']['clustering']['enable'] && (node['rabbitmq']['erlang_cookie'] != existing_erlang_key)
log "stop #{node['rabbitmq']['service_name']} to change erlang cookie" do
notifies :stop, "service[#{node['rabbitmq']['service_name']}]", :immediately
log "stopping #{node['rabbitmq']['service_name']} because shared cluster secret (the Erlang cookie) has changed"
service node['rabbitmq']['service_name'] do
action :stop
end
template node['rabbitmq']['erlang_cookie_path'] do
......
......@@ -25,8 +25,8 @@ attribute :uri, String, default: 'https://dl.bintray.com/rabbitmq-erlang/debian'
attribute :distribution, String
# Available values: 'erlang', 'erlang-21.x', 'erlang-20.x', 'erlang-19.x'
# 'erlang' means "the latest release"
attribute :components, Array, default: ['erlang'], required: true
attribute :key, String, default: '6B73A36E6026DFCA', required: true
attribute :components, Array, default: ['erlang']
attribute :key, String, default: '6B73A36E6026DFCA'
attribute :keyserver, String
attribute :trusted, [TrueClass, FalseClass], default: false
attribute :trusted, [true, false], default: false
......@@ -22,7 +22,9 @@ actions :install, :remove
default_action :install
attribute :version, String
attribute :use_hipe, [TrueClass, FalseClass], default: false
# HiPE's been deprecated since Erlang/OTP 22 and is going away in Erlang/OTP 24.
# DO NOT USE.
attribute :use_hipe, [true, false], default: false
attribute :options, [String, Array]
attribute :retries, Integer, default: 3
attribute :retry_delay, Integer, default: 10
......@@ -23,12 +23,12 @@ default_action :create
attribute :baseurl, String, required: true
attribute :gpgcheck, [TrueClass, FalseClass], default: true
attribute :gpgcheck, [true, false], default: true
attribute :gpgkey, String
attribute :repo_gpgcheck, [TrueClass, FalseClass], default: true
attribute :repo_gpgcheck, [true, false], default: true
attribute :repositoryid, String
attribute :enabled, [TrueClass, FalseClass], default: true
attribute :enabled, [true, false], default: true
attribute :priority, String
attribute :proxy, String
......@@ -38,6 +38,6 @@ attribute :proxy_password, String
attribute :sslcacert, String
attribute :sslclientcert, String
attribute :sslclientkey, String
attribute :sslverify, [TrueClass, FalseClass]
attribute :sslverify, [true, false]
attribute :timeout
......@@ -9,7 +9,7 @@
).each do |p|
describe package(p) do
it { should be_installed }
its('version') { should match(/^1:21.3/) }
its('version') { should match(/^1:22.3/) }
end
end
......
......@@ -3,7 +3,7 @@
describe package('erlang') do
it { should be_installed }
its('version') { should match(/^21.3/) }
its('version') { should match(/^(22|23)/) }
end
describe package('rabbitmq-server') do
......