diff --git a/manifests/init.pp b/manifests/init.pp index 3d881df38..0cdae56b2 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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, @@ -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) diff --git a/manifests/params.pp b/manifests/params.pp index 6c61bbbc7..51ebe181a 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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 diff --git a/manifests/repo/apt.pp b/manifests/repo/apt.pp index 641099ec7..50687a1cc 100644 --- a/manifests/repo/apt.pp +++ b/manifests/repo/apt.pp @@ -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, diff --git a/manifests/repo/rhel.pp b/manifests/repo/rhel.pp index 4ae751701..284909945 100644 --- a/manifests/repo/rhel.pp +++ b/manifests/repo/rhel.pp @@ -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 diff --git a/spec/classes/rabbitmq_spec.rb b/spec/classes/rabbitmq_spec.rb index a60295cde..8006c8d6f 100644 --- a/spec/classes/rabbitmq_spec.rb +++ b/spec/classes/rabbitmq_spec.rb @@ -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' ) @@ -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