Foreman: The Alternative for Puppet Enterprise
This blog will provide you a quick introduction of DevOps Automation tool, Foreman. And how Foreman uses for alternative of Puppet Enterprise Console. Foreman is complete lifecycle management tool for physical and virtual servers.
What is Puppet?
Consider a scenario, where you have an infrastructure consisting of 10 servers. Being an admin, you are entitled to do a repetitive task on each of these server individually at a regular intervals. When done manually, this process is a tedious and time consuming process. In such scenarios, automation is always essential and puppet is one of the best possible solution for such automation.
Puppet is mainly designed to manage the configuration of Unix-like and Windows system. Puppet usually runs in an agent/master architecture, where a Puppet master server controls important configuration information and managed agent nodes. Puppet has two versions available the open source version and the Enterprise version.
- Open Source Puppet:
Open source Puppet is free for use and open to modification and customization. Open Source Puppet is predominantly used in smaller infrastructures and deployments. Puppet Open Source Dashboard and foreman provide a GUI console for open source puppet.
- Puppet Enterprise:
Puppet Enterprise is used by wide and expanding communities. It provides security updates for the software packages in Puppet Enterprise. It is stable, tested and hardened and includes a multi-master installer for large deployments. It also provides a GUI console call ‘PE Console’.
It is easy to manage one or more than one server with puppet but what if there are 100’s or more than 100 servers? You can manage that with puppet but you can manage that only with command line. So if you want a GUI with open source puppet where you can select the server or group of server then you can use ‘Foreman’. Foreman is open-source tool which uses GUI for configuration of your server and also for provisioning.
Foreman is the main competitor to the Puppet Enterprise console. Foreman is getting more traction these days as compared to PE because of its cost of ownership and quicker releases. It should be said that the foreman aims to do more than the PE Console. With the foreman you have the provision to configure new vm’s on OpenStack, Google Compute Engine, Rackspace, AWS and a bunch of others. Once these machines up and running, they can be managed with the Foreman.
This is where importance of The Foreman lies. The Foreman automatically installs an OS. Post this – through a very good integration with puppet – the new system will be configured. Finally, the puppet will send facts to The Foreman which monitors system over its complete life span. The foreman uses discover plugin to discover a new machine based on mac address.
The configuration of “The Foreman” and its components – in particular the configuration of:
1. Provisioning Setup – Infrastructure
– Smart-Proxies for different tasks (TFTP, DNS, DHCP, Puppet & Puppet CA)
– A Domain which references to a Smart-Proxy for DNS
– A Subnet which references to Smart-Proxies for DHCP, TFTP, DNS
2. Provisioning Setup – Puppet
– An environment for Puppet classes
3. Provisioning Setup – Host
– OS-Images and a corresponding mirror
– Provisioning templates for unattended installations (preseed, kickstart etc.)
– Templates for partition tables
– Connections between OS-images and templates for provisioning & partition tables
The mentioned Smart-Proxies are APIs based. Web services which “The Foreman” builds on existing DHCP, DNS and TFTP servers to help orchestrating the process to provision systems (see figure 1).
How to Manage Puppet with Foreman?
Puppet environments are mapped directly into Foreman. They can be used at various levels throughout the Foreman interface. They are generally used to separate classes from different types of Host, typically allowing changes to a module to tested in one environment (e.g. development) before being pushed to another (e.g. production).
The easiest way to install Foreman is to use the Foreman Installer. The Foreman Installer installs and configures all of the necessary components to run Foreman, including the following:
- Puppet master and agent
- Apache Web Server with SSL and Passenger module
Download the Foreman Installer with the following commands for ubuntu:
Install Foreman-installer with following command:
Then run the Foreman Installer with the following command:
Find the line that sets show_diff and change its value to true:
Save and exit.
Add Foreman Host to Foreman’s Database by running the puppet agent command like so:
This adds the Foreman host as the first Puppet agent node that is managed by Foreman.
Log In To Foreman Web Interface
FOREMAN is best alternative tool for the Puppet Enterprise console. Also, it is an easy way to leverage Puppet modules to manage your server infrastructure. You can monitor all hosts using Foreman Dashboard. You can browse through the publicly available Puppet modules, or write your own module to manage your environment.We will use Foreman for its reporting and External Node Classifier (ENC) capabilities, to ease the management of Puppet. Also It is suitable for infrastructures of all sizes, and works with most distributions of Linux.