Ask Your Question

Problems with require => Class['java']

asked 2016-09-05 23:39:54 -0600

cm01 gravatar image

I'm trying to understand why "require => Class['java']" only seems to work sometimes.

This cassandra module calls logstash which calls java - this works.

    file { '/etc/logstash/conf.d/cassandra.conf':
            owner   => 'root',
            group   => 'root',
            source  => 'puppet:///modules/api_cassandra/etc/logstash/conf.d/cassandra.conf',
            require => [

class logstash::classes::install {

    package {'logstash' :
        ensure  => latest,
        require => Class['java'],

If I just call logstash eg 'include logstash', I get

Error: Failed to apply catalog: Could not find dependency Class[Java] for Package[logstash] at /etc/puppetlabs/code/environments/prod/modules/logstash/manifests/classes/install.pp:3

ie fail

If I call java eg 'include java' - it works ...

So why does the middle one fail ??


edit retag flag offensive close merge delete


Where's `class { 'java': paramx => 42, }` declared?

Kai Burghardt gravatar imageKai Burghardt ( 2016-09-06 05:08:04 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-09-08 12:41:51 -0600

Raffaello gravatar image

You need to define class{'java': ensure => present } or similar depend on the java class definition or as you have already figured out need to use include java

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


Asked: 2016-09-05 23:39:54 -0600

Seen: 260 times

Last updated: Sep 08 '16