module-postgresql/manifests/package_source/yum_postgresql_org.pp
Chris Price fa24f24397 Re-add support for managing yumrepo
This commit creates a new class called `package_source_info`,
which has some initial framework for managing the postgresql.org
yumrepo.  It also serves as a container for the 'version'
variable that is needed by the 'platform' class in order to
use other versions of postgres besides the system default.
2012-12-02 23:06:36 -08:00

23 lines
No EOL
788 B
Puppet

class postgresql::package_source::yum_postgresql_org(
$version
) {
$version_parts = split($version, '[.]')
$package_version = "${version_parts[0]}${version_parts[1]}"
file { "/etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-${package_version}":
source => "puppet:///modules/postgresql_tests/RPM-GPG-KEY-PGDG-${package_version}"
} ->
yumrepo { "yum.postgresql.org":
descr => "PostgreSQL ${version} \$releasever - \$basearch",
baseurl => "http://yum.postgresql.org/${version}/redhat/rhel-\$releasever-\$basearch",
enabled => 1,
gpgcheck => 1,
gpgkey => "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-${package_version}",
}
if defined(Package['postgresql-server']) {
Yumrepo['yum.postgresql.org'] -> Package['postgresql-server']
}
}