Hi @juliettet@akshayyw@Tej-Singh-Rana I’ve assigned a task to setup NTP via puppet but I am facing the error below: Error: Evaluation Error: Error while evaluating a Resource Statement, Could not find declared class ntp (file: /etc/puppetlabs/code/environments/production/manifests/news.pp, line: 1, column: 1) on node jump_host.stratos.xfusioncorp.com
My puppet file is:
class { 'ntp':
servers => ['2.north-america.pool.ntp.org'],
}
class ntpconfig {
include ntp
}
node 'stapp01.stratos.xfusioncorp.com','stapp02.stratos.xfusioncorp.com','stapp03.stratos.xfusioncorp.com' {
include ntpconfig
}
Then you need to install the ntp server within the ntpconfig class:
package { 'ntp':
ensure => present,
}
…+ make sure that is is present via the default NTP config file:
# note: this block of code is also placed within the ntpconfig class
file { '/etc/ntp.conf':
ensure => present,
content => "2.north-america.pool.ntp.org",
}
…then after you include ntpconfig within your server(s) (which you have already done) block add:
Greetings @juliettet
I’ve taken a reference from your solution but unfortunately the task is failed and the reason was the server name.
I think it is mandatory to write as content => "server 2.north-america.pool.ntp.org"
rather than just content => "2.north-america.pool.ntp.org"
due to this prefix “server” thing the task got failed
You are correct: You do need to add server 2.north-america.pool.ntp.org . That’s what I did on my task. I just copy pasted your server IP as not to confuse you with the one that I had and forgot to prefix it with server.
If you fix that one thing, you should now be able to pass the task.