Skip to content

Commit

Permalink
Remove garethr/erlang dependency
Browse files Browse the repository at this point in the history
Most of the distributions handle the erlang installation automatically.
The garethr/erlang dependency is not needed there and can be added
manually in case it's needed.
  • Loading branch information
toabctl committed Jan 24, 2014
1 parent 2c0f33b commit de0acd2
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 29 deletions.
1 change: 0 additions & 1 deletion Modulefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ project_page 'http://github.com/puppetlabs/puppetlabs-rabbitmq'
## Add dependencies, if any:
dependency 'puppetlabs/stdlib', '>= 2.0.0'
dependency 'puppetlabs/apt', '>= 1.0.0'
dependency 'garethr/erlang', '>= 0.1.0'
dependency 'nanliu/staging', '>= 0.3.1'
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
4. [Usage - Configuration options and additional functionality](#usage)
5. [Reference - An under-the-hood peek at what the module is doing and how](#reference)
5. [Limitations - OS compatibility, etc.](#limitations)
* [RedHat module dependencies](#redhat-module-dependecies)
6. [Development - Guide for contributing to the module](#development)

##Overview
Expand Down Expand Up @@ -315,6 +316,19 @@ The module has been tested on:

Testing on other platforms has been light and cannot be guaranteed.

### RedHat module dependencies
To have a suitable erlang version installed on RedHat systems,
you have to install another puppet module from http://forge.puppetlabs.com/garethr/erlang with:

puppet module install garethr-erlang

This module handles the packages for erlang.
To use the module, add the following snippet to your site.pp or an appropriate profile class:

include 'erlang'
class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']

##Development

Puppet Labs modules on the Puppet Forge are open projects, and community
Expand Down
7 changes: 0 additions & 7 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
$env_config = $rabbitmq::params::env_config,
$env_config_path = $rabbitmq::params::env_config_path,
$erlang_cookie = $rabbitmq::params::erlang_cookie,
$erlang_manage = $rabbitmq::params::erlang_manage,
$manage_service = $rabbitmq::params::manage_service,
$management_port = $rabbitmq::params::management_port,
$node_ip_address = $rabbitmq::params::node_ip_address,
Expand Down Expand Up @@ -54,7 +53,6 @@
) inherits rabbitmq::params {

validate_bool($admin_enable)
validate_bool($erlang_manage)
# Validate install parameters.
validate_re($package_apt_pin, '^(|\d+)$')
validate_string($package_ensure)
Expand Down Expand Up @@ -107,11 +105,6 @@
validate_hash($config_variables)
validate_hash($config_kernel_variables)

if $erlang_manage {
include '::erlang'
Class['::erlang'] -> Class['::rabbitmq::install']
}

include '::rabbitmq::install'
include '::rabbitmq::config'
include '::rabbitmq::service'
Expand Down
1 change: 0 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@

#install
$admin_enable = true
$erlang_manage = false
$management_port = '15672'
$package_apt_pin = ''
$package_gpg_key = 'http://www.rabbitmq.com/rabbitmq-signing-key-public.asc'
Expand Down
15 changes: 0 additions & 15 deletions spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,6 @@
end
end

context 'with erlang_manage set to true' do
let(:params) {{ :erlang_manage => true }}
it 'includes erlang' do
should contain_class('erlang')
end
end

context 'with erlang_manage set to false' do
let(:params) {{ :erlang_manage => false }}
it 'doesnt include erlang' do
should_not contain_class('erlang')
end
end


context 'deprecated parameters' do
describe 'cluster_disk_nodes' do
let(:params) {{ :cluster_disk_nodes => ['node1', 'node2'] }}
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper_system.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
# We need EPEL for erlang.
if node.facts['osfamily'] == 'RedHat'
shell('rpm -i http://mirrors.rit.edu/epel/6/i386/epel-release-6-8.noarch.rpm')
shell('yum -y install erlang')
end

# Install modules and dependencies
puppet_module_install(:source => proj_root, :module_name => 'rabbitmq')
shell('puppet module install garethr-erlang')
shell('puppet module install puppetlabs-stdlib')
shell('puppet module install puppetlabs-apt')
shell('puppet module install nanliu-staging')
Expand Down
2 changes: 0 additions & 2 deletions spec/system/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
describe "rabbitmq class:" do
context 'should run successfully' do
pp="
class { 'erlang': epel_enable => true}
class { 'rabbitmq': }
Class['erlang'] -> Class['rabbitmq']
"

context puppet_apply(pp) do
Expand Down
2 changes: 0 additions & 2 deletions spec/system/clustering_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
describe "rabbitmq class:" do
context 'should run successfully' do
pp="
class { 'erlang': epel_enable => true}
class { 'rabbitmq':
config_cluster => true,
cluster_nodes => ['rabbit1', 'rabbit2'],
cluster_node_type => 'ram',
wipe_db_on_cookie_change => true,
}
Class['erlang'] -> Class['rabbitmq']
"

context puppet_apply(pp) do
Expand Down
5 changes: 5 additions & 0 deletions tests/erlang_deps.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# install first the garethr-erlang module. See README.md
include 'erlang'

class { 'erlang': epel_enable => true}
Class['erlang'] -> Class['rabbitmq']

0 comments on commit de0acd2

Please sign in to comment.