sous-chefs / postgresql

Development repository for the postgresql cookbook

Home Page:https://supermarket.chef.io/cookbooks/postgresql

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot specify minor version to install

sfiggins opened this issue · comments

I would like to be more specific about the release version of postgresql to install. So as not to just add the latest release. I want to install specifically 10.8 or 10.9. The documentation in the README provides an example of doing this with version 10.6. But this will fail.

This works for 9.x series, but there you cannot provide a patch revision... so no 9.6.x. I expect the error to correct is the README example which shows using version 10.6, but as a new feature I would like to have more control over the patch version for greater consistency on servers when I initialize them.

Cookbook version

7.1.4

Chef-client version

[Version of chef-client in your environment]

Platform Details

Centos-7 bento box vagrant with test-kitchen

Scenario:

Using pgdg install a specific minor release.

Steps to Reproduce:

For centos 7

cookbooks/my_postgresql/recipes/default.rb

postgresql_server_install 'PostgreSQL Server' do
version '10.9'
setup_repo true
password 'P0stgresP4ssword'
end

Expected Result:

postgresql-10-server-10.9 rpm from pgdg will be installed.

Actual Result:

Receive an error failing to install pgdg10.9

Or, if you specifically set up pgdg10, you will get errors on the client and server package names. This may also be a problem on debian systems, but I haven't tested yet.

Hello @sfiggins. I actually just ran into this today and it seems this is a limitation of the postgresql yum repo, not this cookbook specifically. If you look at the postgresql yum repos, you'll see them listed as 9.4, 9.5, 9.6 and then only major versions 10, 11, 12. However, you are correct in that using version 10.6 with RHEL/CentOS 7 will fail in this cookbook. When I get a chance, I'll create a PR to fix this error and default versions 10.x, 11.x & 12.x version to their major version until Postgres updates their repos.

I have thought of an external fix for this, which is I could use yum versionlock to put a constraint on the postgresql version to install. I haven't tested that out yet, but it seems like maybe this is more of a yum constraint problem than a postgresql cookbook problem.

If it's yum related, a satellite server might be the best option for fixing this particular bug. Closing as it's an upstream bug

commented

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.