puppetlabs / puppetlabs-postgresql

Puppet module for managing PostgreSQL
Apache License 2.0
228 stars 614 forks source link

Setting version to 8.4 on Enterprise Linux 5 should have postgresql84 defaults #345

Closed senior closed 2 years ago

senior commented 10 years ago

To install Postgres 8.4 on CentOS 5, I needed code like below:

class { 'postgresql::globals':
         client_package_name => 'postgresql84',
         server_package_name => 'postgresql84-server',
         devel_package_name  => 'postgresql84-devel',
         version => '8.4',
         bindir => '/usr/bin',
         service_name => 'postgresql',
         datadir => '/var/lib/pgsql/data',
         java_package_name => 'postgresql-jdbc',
         plperl_package_name => 'postgresql84-plperl',
         contrib_package_name => 'postgresql84-contrib'}

It would be a nice feature to special case 8.4 on EL 5 and populate the defaults correctly.

igalic commented 10 years ago

That's weird. All of that should be done automatically. What does facter -p osfamily give you?

senior commented 10 years ago

You're right, but only when you pick the default version. 8.1 is the default on CentOS 5 and I am wanting 8.4. That version is included with that version of CentOS, but it's called postgresql84. So when this code executes, it gives all incorrect package names.

igalic commented 10 years ago

Yes, and the next line in that class removes the . picks postgresql84-foobar as package:

} else {
  $version_parts = split($version, '[.]')
  $package_version = "${version_parts[0]}${version_parts[1]}"
  $client_package_name = pick($client_package_name, "postgresql${package_version}")
  $server_package_name = pick($server_package_name, "postgresql${package_version}-server")
  ...

This, to me, reads as: class { 'postgresql::global': version => '8.4' } should entirely suffice, but I haven't tried any of that on CentOS 5 myself. I use it with 9.3 on Ubuntu, though.


Alternatively, you could also, manage_repo => true, and install version => 9.3 ;)

senior commented 10 years ago

Unfortunately it won't. If you do that, bindir and datadir is incorrect. Also the jdbc package (it doesn't include the 84 part) etc. There's probably more I'm forgetting.

chelnak commented 2 years ago

Hello! We are doing some house keeping and noticed that this issue has been open for a long time.

We're going to close it but please do raise another issue if the issue still persists. 😄