Ask Your Question
0

Problems with require => Class['java']

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

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'],
            Class['logstash::classes::configuration'],
           ],
    }

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 ??

Cheers
Chris

edit retag flag offensive close merge delete

Comments

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

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

1 Answer

Sort by ยป oldest newest most voted
0

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

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

Stats

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

Seen: 62 times

Last updated: Sep 08 '16