fa24f24397
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.
23 lines
No EOL
788 B
Puppet
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']
|
|
}
|
|
} |