Puppet install ntp problem

Hi i have a task for install ntp sever on appserver 2

in path that task say create file as this content:
class { ‘ntp’ :
servers => [‘server 3.europe.pool.ntp.org iburst’]
}
class ntpconfig {
include ntp
}

node ‘stapp02.stratos.xfusioncorp.com’{
include ntpconfig
}

when parser validate all is ok
when run puppet agent -t on serapp02 get this error:

Error: Evaluation Error: Error while evaluating a Resource Statement, Could not find declared class ntp (file: /etc/puppetlabs/code/environments/production/manifests/ecommerce.pp, line: 1, column: 1) on node jump_host.stratos.xfusioncorp.com

today i do again this task
" 1. Create a puppet programming file official.pp under /etc/puppetlabs/code/environments/production/manifests directory on puppet master node i.e on Jump Server . Within the programming file define a custom class ntpconfig to install and configure ntp server on app server 3 .
2. Add NTP Server server 1.africa.pool.ntp.org in default configuration file on app server 3 , also remember to use iburst option for faster synchronization at startup.
3. Please note that do not try to start/restart/stop ntp service, as we already have a scheduled restart for this service tonight and we don’t want these changes to be applied right now.

Notes: :- Please make sure to run the puppet agent test using sudo on agent nodes, otherwise you can face certificate issues. In that case you will have to clean the certificates first and then you will be able to run the puppet agent test."

and get this:
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 (file: /etc/puppetlabs/code/environments/production/manifests/official.pp, line: 1, column: 1) on node stapp03.stratos.xfusioncorp.com
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

hello @farzaneh hope you are well. i see this post is old and don’t know if you were able to solve your issue but i had the same problem and i realize you got this error if you install ntp module as thor user so.

Before sintalling ntp module gain root access
Sudo su -
#enter thor password

install puppet ntp module
puppet module install puppetlabs-ntp

That’s all but just let me know if it works for you.

1 Like

Thank you :slightly_smiling_face:, your comment helped me validate the “Puppet Setup NTP Server” task.
Yes, we must run the command $ puppet module install puppetlabs-ntp with the root user.