Ask Your Question
0

puppetlabs/postgresql dependency cycle when calling class postgresql::server::contrib

asked 2014-08-20 15:34:00 -0600

sghimire gravatar image

Using module puppetlabs/postgresql, version 3.4.2.

Here is my module:

class my_postgres_module (
  $password = "postgres",
  $pgdata = $postgresql::params::datadir,
) {

  class { 'postgresql::globals':
    manage_package_repo => true,
    datadir          => $pgdata,
    version             => '9.0',
    needs_initdb      => true,
  }
  ->
  class { '::postgresql::server': 
    postgres_password => $password,
    ipv4acls     => ['host   all   all  0.0.0.0/0  md5']
  }
  ->
  class { '::postgresql::server::contrib':
  }
}

I get the following error:

Error: Could not apply complete catalog: Found 1 dependency cycle:
(Anchor[postgresql::server::contrib::start] => Class[Postgresql::Server::Install] => Package[postgresql-server] => Class[Postgresql::Server::Install] => Package[postgresql-contrib] => Class[Postgresql::Server::Service] => Anchor[postgresql::server::service::begin] => Class[Postgresql::Server::Service] => Class[Postgresql::Server::Passwd] => Exec[set_postgres_postgrespw] => Class[Postgresql::Server::Passwd] => Class[Postgresql::Server::Firewall] => Class[Postgresql::Server::Firewall] => Anchor[postgresql::server::end] => Class[Postgresql::Server] => Class[Postgresql::Server::Contrib] => Package[postgresql-contrib])
Cycle graph written to /var/opt/lib/pe-puppet/state/graphs/cycles.dot

Does anyone know how to install the contrib package using this module? Currently when we don't include the postgresql::server::contrib class, the contrib package is not installed (We verified this by doing a yum list).

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-07-23 23:41:26 -0600

binford2k gravatar image

Yes. Don't specify dependencies when you don't need them. Take the arrows (->) out and this will work just fine.

Longer answer: The postgresql::server::contrib already specifies its dependencies. It inserts itself after the server install class, but before the server service class. But when you specify another dependency on the whole server class that contains both of those, you're effectively telling it to happen before the service class and after the service class. Clearly impossible.

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

2 followers

Stats

Asked: 2014-08-20 15:34:00 -0600

Seen: 681 times

Last updated: Jul 23