Skip to content

Instantly share code, notes, and snippets.

@psy-q
Created September 6, 2012 09:03
Show Gist options
  • Select an option

  • Save psy-q/3653377 to your computer and use it in GitHub Desktop.

Select an option

Save psy-q/3653377 to your computer and use it in GitHub Desktop.
pg_user never executes on the client

I am defining a pg_user using akumria's puppet-postgresql:

https://github.com/akumria/puppet-postgresql

This is our pg_user definition in the manifest:

pg_user {'jenkins':
        name => 'jenkins',
        password => 'jenkins',
        ensure     => 'present',
        createdb   => 'true',
        createrole => 'true',
        superuser  => 'true',
    }

There is also a definition for the PostgreSQL server:

    class {'postgresql':
            version => '8.4',
    }

    class {'postgresql::server':
            version => '8.4',
            acl   => ['local all jenkins ident',
                       'local all postgres ident',
                       'local all all ident'],

    }

This works fine, the server is installed and started, pg_hba.conf is created correctly. But the pg_user part is completely ignored on the client.

This is the output of puppet agent --debug --verbose --test | grep -i postg

debug: /Stage[main]/Postgresql::Server/File[postgresql-server-config-8.4]/require: requires Package[postgresql-server-8.4]
debug: /Stage[main]/Postgresql::Server/File[postgresql-server-config-8.4]/notify: subscribes to Service[postgresql-system-8.4]
debug: /Stage[main]/Postgresql::Server/File[postgresql-server-hba-config-8.4]/require: requires Package[postgresql-server-8.4]
debug: /Stage[main]/Postgresql::Server/File[postgresql-server-hba-config-8.4]/notify: subscribes to Service[postgresql-system-8.4]
debug: /Stage[main]/Postgresql::Server/Service[postgresql-system-8.4]/subscribe: subscribes to Package[postgresql-server-8.4]
debug: Service[postgresql-system-8.4](provider=debian): Executing 'ps -ef'
debug: Service[postgresql-system-8.4](provider=debian): PID is 27239

There is no other PostgreSQL-relevant output (even without the grep -i postg). I tried to stick a debug statement in the create and destroy methods here, to see if the code is ever run:

https://github.com/akumria/puppet-postgresql/blob/master/lib/puppet/provider/pg_user/debian_postgresql.rb#L11

However, I don't know how to do that. So the question is how to help debug this issue, since there is no error message and no output at all from the usual Puppet bits and pieces (agent log, server log...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment