Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I#m trying to setup a VM with postgresql and gitlab. I'm using the following packages: gitlab & postgresql

This is my init.pp

class { 'postgresql::server':
  ip_mask_deny_postgres_user => '',
  ip_mask_allow_all_users    => '',
  listen_addresses           => '*',
  ipv4acls                   => ['host all johndoe cert'],
  manage_firewall            => true,
  postgres_password          => 'TPSrep0rt!',

class { 
    git_email         => '',
    git_comment       => 'GitLab Performates',
    gitlab_domain     => '',
    gitlab_dbtype     => 'pgsql',
    gitlab_dbname     => 'gitlab',
    gitlab_dbuser     => 'gitlab',
    gitlab_dbpwd      => 'gitlab',
    ldap_enabled      => false,

nearly copied form the examples

But when I try to provision my VM i always get

Error: Duplicate declaration: Package[postgresql-client] is already declared; cannot redeclare at /etc/puppet/modules/postgresql/manifests/client.pp:12 on node

I'm only referencing to postgresql::server and gitlab ensures that postgresql-client is installed so thy does it complain?

share|improve this question
Pretty sure you want to remove postgres_password here and change it everywhere used ;) – zhenech Jan 13 '14 at 21:01
Can't say without seeing the code. Try commenting things out and see. Comment out the pgsql::server declaration and see if the catalog compiles. That will give you a clue as to where the dupe is. – Danila Ladner Jan 13 '14 at 21:02
@zhenech it is just the sample password from the modules example page so I won't use this pass ;) – soupdiver Jan 14 '14 at 10:15
up vote 2 down vote accepted

The problem here is, that you cannot define two resources with the same name in Puppet.

The PostgreSQL module defines the Package['postgresql-client'] here:

And GitLab here:

As GitLab uses the ensure_packages function from stdlib, this should work if postgres is loaded before gitlab, but with Puppet you do not ensure (heh, sorry) the order of module-loading.

A proper fix would be using ensure_packages in the PostgreSQL module too. You can either patch that locally, or workaround the double-definition by removing one of the postgresql-client package definitions.

share|improve this answer
thanks man! this helped me out! So is this a "fault" in the postgresql module and should be fixed or is it normal that these things happen? – soupdiver Jan 13 '14 at 22:34
These things happen, sadly. You could ask for a fix in the posgresql module (e.g. via the mentioned ensure_packages function from stdlib), but if I'd be the author, I would not consider this a show stopper (but certainly a nice to have feature). – zhenech Jan 14 '14 at 7:09
u say no show stopper but this stop the module from working properly with other modules and in my eyes this is a huge disadvantage or ?! – soupdiver Jan 14 '14 at 10:15
disadvantage, yes, but in a not-too-common case and one could also argue that gitlab does not actually need the postgresql client ("only" the ruby bindings and libpq). in any case, open a bug, let the authors decide. – zhenech Jan 14 '14 at 20:16
ok thanks for sharing your opinion! – soupdiver Jan 15 '14 at 9:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.