Re: minor change in inkling/postgresql – PostgreSQL

102 views
Skip to first unread message

OXS007

unread,
Aug 29, 2012, 6:52:57 AM8/29/12
to puppet...@googlegroups.com

On more thing the postgresql-9.1 is installed but when you run service postgresql-9.1 start you get

/var/lib/pgsql/9.1/data is missing, Use "service postgresql-9.1.4 initdb" to initialize the cluster first.

Any idea ?

Op woensdag 29 augustus 2012 02:14:54 UTC-4 schreef OXS007 het volgende:
Hi,

When running the Postgresql module the database installed by default is 8.4 what we need is 9.1 where do i define the version to be installed by puppet.

If i edit the params,pp like;

$client_package_name   = 'postgresql91'
$server_package_name   = 'postgresql91'

The 9.1 is being installed but i get some errors like these;

Execution of '/sbin/service postgresql start' returned 1

Thanks in forward for you help.

OXS007

unread,
Aug 29, 2012, 7:15:13 AM8/29/12
to puppet...@googlegroups.com
I think i figured it out in the Postgresql module edit the params.pp so that it looks like this;

case $::osfamily {

    'RedHat': {

      $service_name             = 'postgresql-9.1'

      $client_package_name      = 'postgresql91'

      $server_package_name      = 'postgresql91-server'

      $needs_initdb             = true

      $initdb_path              = '/usr/pgsql-9.1/bin/initdb'

      $createdb_path            = '/usr/pgsql-9.1/bin/createdb'

      $psql_path                = '/usr/pgsql-9.1/bin/psql'

      $datadir                  = '/var/lib/pgsql/9.1/data/'

      $pg_hba_conf_path         = '/var/lib/pgsql/9.1/data/pg_hba.conf'

      $postgresql_conf_path     = '/var/lib/pgsql/9.1/data/postgresql.conf'

      $firewall_supported       = true

      $persist_firewall_command = '/sbin/iptables-save > /etc/sysconfig/iptables'

Chris Price

unread,
Aug 29, 2012, 4:43:49 PM8/29/12
to puppet...@googlegroups.com
Hello OSX007,

You are on the right track, for sure.  The goal of the params.pp is to set default values for those things and allow you to override them in your own manifests.  It's definitely OK for you to edit params.pp directly if you know for sure that the settings you've specified will always be the ones that you want, but otherwise you should be able to override them in your own manifests and pass them in without modifying the module's params.pp directly.  This would allow you to potentially use the module to manage both 8.x and 9.x instances.

I'd love to put together a "test" manifest that illustrates how to do what you're doing w/o modifying params.pp directly, and submit a pull request to the module so that it will be easier for other folks to figure out how to do it in the future.  I'd also love to provide a single parameter like "postgres_version" that you could just set to "9.1" and then add code to the module that would switch all of those path variables to the correct values for you.  I hope to continue submitting pull requests with features like that over time, but if you have any such submissions you'd like to make yourself, I'm sure they'd be welcomed!

Jeremy Kitchen

unread,
Sep 6, 2012, 4:31:19 AM9/6/12
to puppet...@googlegroups.com
On Wed, Aug 29, 2012 at 09:43:49AM -0700, Chris Price wrote:
> I'd love to put together a "test" manifest that illustrates how to do what
> you're doing w/o modifying params.pp directly,

I'd love to see this, myself, for educational purposes. I'm still pretty
new to puppet and the variable scoping scares me a bit, so I'd like to
see some good examples of how people are doing overridable defaults like
this!

-Jeremy

Chris Price

unread,
Sep 6, 2012, 5:21:57 PM9/6/12
to puppet...@googlegroups.com
Thanks or the feedback, Jeremy.  Knowing that there are folks out there who would find it useful helps me to prioritize :)  I still have this on my to-do list, and hope to get a chance to work on it sometime in the next week or so.  I'll send another response to this thread as soon as I do.
Reply all
Reply to author
Forward
0 new messages