Foreman – Adding and configuring the NTP module on Ubuntu 16.04/18.04
In our tutorial Install and configure Foreman on Ubuntu 16.04/18.04 I’ll guide you through the installation process and important first steps of configuring Foreman, a tool that lets you manage and organize your complete server infrastructure. In this tutorial, I’ll go one step further and show you how to add the NTP module to Foreman and configure it to be mapped to one of your hosts. This tutorial requires the configuration you made in the Install and Configure Foreman tutorial under Ubuntu 16.04/18.04.
The NTP module and its use for the puppet server of your Foreman tool
In the tutorial referenced above I mention Puppet as a component of Foreman. Puppet consists of a central server. This server consists of the puppet master and the clients, which are understood as nodes of the puppet master. You can imagine the functioning between the puppet master and the puppet nodes in such a way that the nodes log on to the master and ask there for the current configuration. The master passes the configuration information to the nodes.
The puppet server can be used to perform a number of tasks, such as passing files to be copied to specific locations. As part of this, a node can be instructed to check file permissions and correct them if necessary. Depending on the operating system, a node can be forced to check whether certain services are active or whether certain packages are installed in the latest version. The puppet server can instruct a node to execute certain commands. Puppet requires accurate scheduling to perform the sample tasks described above. This is where the NTP module comes in, which allows time synchronization between networks.
Install the NTP module
In the following you install the NTP module: The NTP module is one of Puppet’s most important requirements for managing NTP services.
/opt/puppetlabs/bin/puppet module install puppetlabs-ntp -i /etc/puppetlabs/code/modules/
The output of the command presented above should correspond to the one shown in the screenshot below with possible deviation of the version number(s).
In the Foreman web console, navigate to the Class menu item of the Configure main menu item to read the puppet classes available after installing the NTP module from the puppet master and fill the Foreman database.
On the page you will be redirected to, you can import the NPT module via the button in the upper right corner to import the environment of your FQDN.
Select the NTP module for the development and production environment and click the Update button.
Now you can manage the NTP module and Foreman via the dashboard.
Configure the NTP module
After you have imported the NTP module, search for the NTP class in the list of available puppet classes. In the drop-down of the Actions column of this class, select “Overwrite all parameters” as shown in the screenshot below. This will allow Foreman to manage the NTP class parameters of the puppet server.
Then go back to Hosts in the menu and switch to the Edit Mode for the respective host in the Actions column via the Edit button.
In the Puppet classes tab, expand the NTP module by clicking the + icon. This will add the NTP class to the host. Confirm this process with the Send button.
After assigning the NTP class to the respective host, you will automatically be redirected to the details area of this host, as shown in the screenshot.
If you click the YAML button there, you will see the NTP class and the list of associated parameters passed to Puppet via the External Node Classifier (ENC) interface. The screenshot below demonstrates how this list works.
Finally, via the terminal of your Ubuntu server, run the following command on the Foreman host to display the NTP service that has been automatically reconfigured by Puppet and the NTP module.
puppet agent --test
To check whether the NTP module has been installed, restarted, and configured, click the Reports button next to the YAML button in the details pane of the relevant host. There you will find a list of the reports created so far. Depending on how long Foreman and the NTP module have been installed between each other, this listing may already contain a number of past items following the last report created.
If you click on a report that was generated before the implementation of the NTP module and its subsequent assignment to the respective host via the configuration of the NTP module shown above, the report can resemble a report as you can see from the screenshot below.
The report that was created after configuring the NTP module should look like a report as shown in the following screenshot. In this case the puppet master is able to accept agents or nodes.
I showed you how to use the puppet server of your Foreman tool to manage time synchronization. I was happy to help you and wish you every success with the life cycle management tool Foreman. 🙂
From our column to Foreman also still interesting and helpful:
- We at gridscale have developed a plugin that allows you to generate and manage server templates offered by gridscale directly in Foreman. For more information Foreman provided by gridscale: Create and manage your servers in Foreman with the plugin from gridscale.io
In our tutorial Install and configure Foreman on Ubuntu 16.04/18.04 I’ll guide you through the installation process and important first steps of configuring Foreman, a tool that lets you manage and organize your complete server infrastructure. In this tutorial, I’ll go one step further and show you how to add the NTP module to Foreman […]
Thank you for your feedback!
We will get back to you as soon as the article is finished.