Skip to content

Commit

Permalink
Rename variable 'manage_repos' to 'repos_ensure'
Browse files Browse the repository at this point in the history
'manage_repos' doesn't describe the intended behaviour of the variable.
We decided to rename it to 'repos_ensure'. This will break backward
compatibility.
  • Loading branch information
queeno committed Dec 5, 2014
1 parent da24604 commit a5879f4
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
$package_name = $rabbitmq::params::package_name,
$package_provider = $rabbitmq::params::package_provider,
$package_source = $rabbitmq::params::package_source,
$manage_repos = $rabbitmq::params::manage_repos,
$repos_ensure = $rabbitmq::params::repos_ensure,
$plugin_dir = $rabbitmq::params::plugin_dir,
$port = $rabbitmq::params::port,
$tcp_keepalive = $rabbitmq::params::tcp_keepalive,
Expand Down Expand Up @@ -63,7 +63,7 @@
validate_string($package_gpg_key)
validate_string($package_name)
validate_string($package_provider)
validate_bool($manage_repos)
validate_bool($repos_ensure)
validate_re($version, '^\d+\.\d+\.\d+(-\d+)*$') # Allow 3 digits and optional -n postfix.
# Validate config parameters.
validate_array($cluster_disk_nodes)
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
$management_port = '15672'
$package_apt_pin = ''
$package_gpg_key = 'http://www.rabbitmq.com/rabbitmq-signing-key-public.asc'
$manage_repos = true
$repos_ensure = true
$service_ensure = 'running'
$service_manage = true
#config
Expand Down
4 changes: 2 additions & 2 deletions manifests/repo/apt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@

Class['rabbitmq::repo::apt'] -> Package<| title == 'rabbitmq-server' |>

$ensure_repo = $rabbitmq::manage_repos ? {
$ensure_source = $rabbitmq::repos_ensure ? {
false => 'absent',
default => 'present',
}

apt::source { 'rabbitmq':
ensure => $ensure_repo,
ensure => $ensure_source,
location => $location,
release => $release,
repos => $repos,
Expand Down
2 changes: 1 addition & 1 deletion manifests/repo/rhel.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Imports the gpg key if it doesn't already exist.
class rabbitmq::repo::rhel {

if $rabbitmq::manage_repos {
if $rabbitmq::repos_ensure {

$package_gpg_key = $rabbitmq::package_gpg_key

Expand Down
8 changes: 4 additions & 4 deletions spec/classes/rabbitmq_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
end

context 'on Debian' do
let(:params) {{ :manage_repos => false }}
let(:params) {{ :repos_ensure => false }}
let(:facts) {{ :osfamily => 'Debian', :lsbdistid => 'Debian', :lsbdistcodename => 'squeeze' }}
it 'does ensure rabbitmq apt::source is absent when manage_repos is false' do
it 'does ensure rabbitmq apt::source is absent when repos_ensure is false' do
should contain_apt__source('rabbitmq').with(
'ensure' => 'absent'
)
Expand All @@ -45,9 +45,9 @@
end

context 'on Redhat' do
let(:params) {{ :manage_repos => false }}
let(:params) {{ :repos_ensure => false }}
let(:facts) {{ :osfamily => 'RedHat' }}
it 'does not import repo public key when manage_repos is false' do
it 'does not import repo public key when repos_ensure is false' do
should_not contain_exec('rpm --import http://www.rabbitmq.com/rabbitmq-signing-key-public.asc')
end
end
Expand Down

0 comments on commit a5879f4

Please sign in to comment.