Fix repo removal for testing purposes
Signed-off-by: Ken Barber <ken@bob.sh>
This commit is contained in:
parent
ce94eb348a
commit
cd2bc50cdf
3 changed files with 17 additions and 15 deletions
|
@ -3,7 +3,6 @@ class postgresql::repo (
|
||||||
$ensure = 'present',
|
$ensure = 'present',
|
||||||
$version = undef
|
$version = undef
|
||||||
) inherits postgresql::params {
|
) inherits postgresql::params {
|
||||||
if $ensure == 'present' or $ensure == true {
|
|
||||||
case $::osfamily {
|
case $::osfamily {
|
||||||
'RedHat', 'Linux': {
|
'RedHat', 'Linux': {
|
||||||
if $version == undef {
|
if $version == undef {
|
||||||
|
@ -21,4 +20,3 @@ class postgresql::repo (
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ class postgresql::repo::yum_postgresql_org inherits postgresql::repo {
|
||||||
Yumrepo['yum.postgresql.org'] -> Package<|tag == 'postgresql'|>
|
Yumrepo['yum.postgresql.org'] -> Package<|tag == 'postgresql'|>
|
||||||
} else {
|
} else {
|
||||||
yumrepo { 'yum.postgresql.org':
|
yumrepo { 'yum.postgresql.org':
|
||||||
ensure => absent,
|
enabled => absent,
|
||||||
}->
|
}->
|
||||||
file { $gpg_key_path:
|
file { $gpg_key_path:
|
||||||
ensure => absent,
|
ensure => absent,
|
||||||
|
|
|
@ -82,12 +82,16 @@ describe 'server without defaults:' do
|
||||||
pp = <<-EOS
|
pp = <<-EOS
|
||||||
class { 'postgresql::globals':
|
class { 'postgresql::globals':
|
||||||
version => "9.2",
|
version => "9.2",
|
||||||
manage_package_repo => true,
|
|
||||||
service_status => 'service postgresql-9.2 status',
|
service_status => 'service postgresql-9.2 status',
|
||||||
}
|
}
|
||||||
class { 'postgresql::server':
|
class { 'postgresql::server':
|
||||||
ensure => absent,
|
ensure => absent,
|
||||||
}
|
}
|
||||||
|
# Repo removal doesn't work on its own, so we do it here
|
||||||
|
class { 'postgresql::repo':
|
||||||
|
ensure => absent,
|
||||||
|
version => '9.2',
|
||||||
|
}
|
||||||
EOS
|
EOS
|
||||||
puppet_apply(pp) do |r|
|
puppet_apply(pp) do |r|
|
||||||
r.exit_code.should_not == 1
|
r.exit_code.should_not == 1
|
||||||
|
|
Loading…
Reference in a new issue