module-postgresql/manifests/repo/apt_postgresql_org.pp
Marco Nenciarini 0cb71c7c5f Support apt.postgresql.org version specific packages.
This change will allow to test beta and release candidate version of
postgres from apt.postgresql.org.

For stable version this change will make available the libpq package
for that specific version (that will not hurts).
2013-09-25 18:01:07 +02:00

30 lines
1,014 B
Puppet

# PRIVATE CLASS: do not use directly
class postgresql::repo::apt_postgresql_org inherits postgresql::repo {
if($ensure == 'present' or $ensure == true) {
# Here we have tried to replicate the instructions on the PostgreSQL site:
#
# http://www.postgresql.org/download/linux/debian/
#
apt::pin { 'apt.postgresql.org':
originator => 'apt.postgresql.org',
priority => 500,
}->
apt::source { 'apt.postgresql.org':
location => 'http://apt.postgresql.org/pub/repos/apt/',
release => "${::lsbdistcodename}-pgdg",
repos => "main ${version}",
key => 'ACCC4CF8',
key_source => 'http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc',
include_src => false,
}
Apt::Source['apt.postgresql.org']->Package<|tag == 'postgresql'|>
} else {
apt::source { 'apt.postgresql.org':
ensure => absent,
}
apt::pin { 'apt.postgresql.org':
ensure => absent,
}
}
}