Ask Your Question
0

2 classes defined in a manifest - getting evaluation error

asked 2017-10-19 06:01:21 -0600

updated 2017-10-19 10:15:39 -0600

Hi,

Still quite new to puppet and having problems with my NTP configuration manifest. Was hoping someone can point me in the right direction please...

The end goal is to make new servers CIS compliant so I have a number of manifests that carry out all the scored CIS requirements and configure and lock the servers down. Most of them work fine but I'm struggling with my NTP manifest.

Here's the current setup on the puppet master:

site.pp

node default {
  include james_cis
}

init.pp (located in my james_cis module)

class james_cis {
  include james_cis::el7::scored_1_1_17
  include james_cis::el7::scored_3_6
}

(scored_3_6 is my NTP manifest) scored_3_6.pp

class james_cis::el7::scored_3_6 {
  class { 'ntp':
    servers   => ['62.73.128.137', '176.62.134.139'],
    restrict  => [
      'default kod nomodify notrap nopeer noquery',
      '-6 default kod nomodify notrap nopeer noquery',
      '127.0.0.1',
      '-6 ::1',
    ],
  }
}

(Please excuse line spacing and blue section above - formatting is a bit skeewiff)

When I run on the puppet agent I get the following error:

Error: Could not retrieve catalog from remote server:
Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Could not find declared class ntp at /etc/puppetlabs/code/environments/production/modules/james_cis/manifests/el7/scored_3_6.pp:6:1 on node rhel7puppetclient2.tools.gov.xxxxxxxxxx.co.uk

I think the problem is I have class listed twice in the scored_3_6 manifest and it doesn't like it. I've trawled through the web but not sure how I can get around this - any ideas would be appreciated.

edit retag flag offensive close merge delete

Comments

Do you have a module installed named `ntp`? Is there a directory `/etc/puppetlabs/code/environments/production/modules/ntp/`? PS: This site uses markdown for formatting.

Kai Burghardt gravatar imageKai Burghardt ( 2017-10-19 10:17:27 -0600 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2017-10-19 10:18:05 -0600

My bad, I think this error is because I haven't installed the puppetlabs ntp module.

Will install now and retry

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: 2017-10-19 06:01:21 -0600

Seen: 24 times

Last updated: Oct 19