Skip to content

Commit

Permalink
rabbitmq::manage_repos sets 'ensure' in apt::source
Browse files Browse the repository at this point in the history
The ensure paramenter in apt::source is set to 'present' or 'absent'
based on the value of rabbitmq::manage_repo.
  • Loading branch information
queeno committed Dec 5, 2014
1 parent 00f6472 commit 34412d1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
6 changes: 6 additions & 0 deletions manifests/repo/apt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@

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

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

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

$package_gpg_key = $rabbitmq::package_gpg_key
if $rabbitmq::manage_repos {

Class['rabbitmq::repo::rhel'] -> Package<| title == 'rabbitmq-server' |>
$package_gpg_key = $rabbitmq::package_gpg_key

exec { "rpm --import ${package_gpg_key}":
path => ['/bin','/usr/bin','/sbin','/usr/sbin'],
unless => 'rpm -q gpg-pubkey-056e8e56-468e43f2 2>/dev/null',
}
Class['rabbitmq::repo::rhel'] -> Package<| title == 'rabbitmq-server' |>

exec { "rpm --import ${package_gpg_key}":
path => ['/bin','/usr/bin','/sbin','/usr/sbin'],
unless => 'rpm -q gpg-pubkey-056e8e56-468e43f2 2>/dev/null',
}
}
}

0 comments on commit 34412d1

Please sign in to comment.