Ask Your Question
0

Puppetdb creates postgresdb but then fails to access it

asked 2015-07-14 19:24:42 -0600

penedo gravatar image

Using puppetlabs-pupeptdb 3.0.1 with puppetlabs-postgresql 3.4.2, on Ubuntu 12.04 with Postgres 9.3.9 and the following manifest:

  class {'java':
    version => '8',
  }

  class { 'postgresql::globals':
    manage_package_repo => true,
    version             => '9.3',
  }

  class {'::puppetdb':
    ssl_listen_address => '0.0.0.0',
    require            => [ Class['java'], Class['Postgresql::Globals'], ],
  }

  class {'puppetdb::master::config':
    require => Class['puppetdb']
  }

I get the following error:

==> puppet.dev: Error: /Stage[main]/Puppetdb::Server::Validate_db/Postgresql::Validate_db_connection[validate puppetdb postgres connection]/Exec[validate postgres connection for localhost/puppetdb]/returns: change from notrun to 0 failed: echo 'Unable to connect to defined database using: /usr/bin/psql --tuples-only --quiet -h localhost -U puppetdb -p 5432 --dbname puppetdb ' && false returned 1 instead of one of [0]

i.e. Postgres gets installed and the user puppetdb and the database get created alright (with password puppetdb), but the command quoted above do not pass the password to psql which seems to be the main issue.

Looking at the source code, I don't see a way for Puppet to pass the password to psql.

When I login to the box I can authenticate with psql using a password:

# /usr/bin/psql --tuples-only --quiet -h localhost -U puppetdb -p 5432 --dbname puppetdb
Password for user puppetdb:
puppetdb=> \l
 postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
 puppetdb  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =T/postgres          +
           |          |          |             |             | postgres=CTc/postgres+
           |          |          |             |             | puppetdb=CTc/postgres
 template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres
 template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
           |          |          |             |             | postgres=CTc/postgres

Is there something I'm missing about the way I use the module?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-07-15 00:28:49 -0600

Thomas gravatar image

puppetdb >= 3.0.0 requires puppetlabs-puppetdb module >= 5.0.0 which in turn requires puppetlabs-postgresql >= 4.0.0

according your posting at least puppetlabs-postgresql does not meet the requirement.

and puppetdb 3.x.x officially only supports postgresql >= 9.4

references: http://docs.puppetlabs.com/puppetdb/3... https://forge.puppetlabs.com/puppetla...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-07-14 19:24:42 -0600

Seen: 241 times

Last updated: Jul 15 '15