As written in README of postgresql cookbook (section yum_pgdg_postgresql)
https://github.com/opscode-cookbooks/postgresql/blob/master/README.md
"Also use override_attributes to set a number of values that will need
to have embedded version numbers. For example:"
node['postgresql']['enable_pgdg_yum'] = true
node['postgresql']['version'] = "9.2"
node['postgresql']['dir'] = "/var/lib/pgsql/9.2/data"
node['postgresql']['client']['packages'] = ["postgresql92"]
node['postgresql']['server']['packages'] = ["postgresql92-server"]
node['postgresql']['server']['service_name'] = "postgresql-9.2"
node['postgresql']['contrib']['packages'] = ["postgresql92-contrib"]
Setting those attributes is the way this cookbook work, due to the
fact that it is necessary to change standard RHEL naming conventions.
This approach gives you the finest grained contro and, in my opinioni,
you could need such kind of control because of possible conflicts with
RHEL packages dependencies.
Off course postgresql cookbook could include also an automation for
that choices, but, in my opinion, it should be a little more
sophisticated that your proposed patch.
First of all I would check if I have
node['postgresql']['enable_pgdg_yum'] = true
and not if node['postgresql']['version'] != '8.4'
Than I would also manage all ovverrides, as explained inside readme.
On top of that I would introduce a boolean variable to choose if I
want all that stuff automatically managed, or if want fine grained
control.
Marco
On Mon, May 27, 2013 at 3:20 AM, Jeffrey Jones
< >
wrote:
I had a similar issue on CentOS.
The logic for determining service names etc was a little iffy. Not sure about
Ubuntu but you might want to have a look.
Here is the pull request I had to make for CentOS:
https://github.com/rurounijones/postgresql/commit/3e7b1b798648c3b8d524704377b9ebeca49cfe59
It may give you a clue.
On 25/05/13 13:46, Toby Hede wrote:
Having some issues with the postgresql cookbook.
Using:
postgresql-cookbook 3.0.0
ubuntu 12.04 on vagrant (but I can replicate this behaviour on a 12.04
VM in teh cloud)
The install attempts to restart the pg server nmd is suddenly very
confused about the version
Error executing action `restart` on resource 'service[postgresql]'
---- Begin output of /etc/init.d/postgresql restart ----
STDOUT: * Restarting PostgreSQL 9.2 database server
[2013-05-24T11:05:41+00:00] FATAL:
Chef::Exceptions::EnclosingDirectoryDoesNotExist:
template[/etc/postgresql/9.1/main/postgresql.conf] (postgresql::server
line 60) had an error:
Chef::Exceptions::EnclosingDirectoryDoesNotExist: Parent directory
/etc/postgresql/9.1/main does not exist.
My recipe is basically:
------------------------------------------------------------
node.set['postgresql']['version'] = "9.2"
node.set['postgresql']['enable_pgdg_apt'] = true
include_recipe "postgresql::apt_pgdg_postgresql"
include_recipe "postgresql::server"
------------------------------------------------------------
Any help would be appreciated.
Cheers,
Toby
Archive powered by MHonArc 2.6.16.