What is Puppet?
Puppet is a configuration management and automation solution for the servers’ deployment, configuration, and management. In addition, it performs the following subsequent functions.
- For every single host, there will be a different configuration file which is defined by Puppet. It monitors and checks continuously if the configuration of the file is not changed. If it finds any changes in the file, it reverts to its original configuration on the host.
- Dynamic scaling-up of machines.
- It is a centralized management system that controls all the configured machines and automatically pushes the master-server or repo-based change to all the configured servers.
Puppet uses a concept of Master-Slave where the master communicates the slave through a secure and encrypted channel using SSL.
How Do We Use It?
Puppet is used in many ways to automate the tasks, such as:
- Base system configuration that includes registry, NTP, firewalls, and services.
- The management of web servers: Apache, Nginx, Tomcat, and IIS.
- The management of database systems: PostgreSQL, My SQL, Microsoft SQL Server, and Oracle.
- Management of application/middleware systems such as Redis, ActiveMQ, RabbitMQ, IIB, IBM, IBM MQ, Fusion/WebLogic, and Java.
- Source Control such as Gitlab and Github.
- Monitoring tools like SNMP, Splunk, NewRelic, Prometheus, Sensu, Zabbix, and Nagios.
- Patch Management. Puppet is used for OS patching of Windows and Linux servers.
- Package-Management: Puppet can also be used to install the software directly on windows servers.
- The containerization and cloud-native: Openshift, Terraform, Kubernetes, and Docker.
- Networking such as Barracuda, Palo Alto, F5, Cisco Nexus, and Cisco Catalyst.
Companies Adopting Puppet
There are many companies adopting Puppet to simplify their tasks. A few of them are below:
- Spotify – Global music streaming network.
- Google – An internet search engine.
- Staples – An American office retail company.
- AT&T – Carrier of both fixed and mobile networks.
- AON – Global professional services firm.
- US Air Force
You can configure systems with Puppet either in a client-server architecture, using the Puppet agent and Puppet master applications, or in a stand-alone architecture, using the Puppet apply application.
- Puppetmaster – The Puppet Master handles the complete data that belongs to the configuration. It runs on a designated server that manages the complete tasks like deploying, configuration, etc.
- Puppet Agent – Puppet agent runs on the client-server. Puppetmaster manages and maintains the client machines.
- Config repository – It is a place where all the information related to configuration and nodes is placed. Data is pulled whenever required.
- Facts – They are global variables obtaining important machine-level information used to analyze the current state of nodes.
- Catalog – All configurations that are written in Puppet are converted to a compiled format called catalog.
- Manifests – Manifests are the actual codes for configuring the clients.
- Class – Like other programming languages, even Puppet has classes to organize its code better.
- Resources – In puppet codes, the coding block is defined by declaring resources to represent packages, files, users, commands.
- Nodes – All servers or clients that need to be managed are called nodes.
Working with Puppet
The Puppet architecture is an agent-server model, where the master server or primary server controls the configuration data of the client nodes that it manages.
Puppet has a master-slave architecture.
- The client agent sends a certificate with its ID to the server.
- The server signs the certificates and sends them back.
- This will authenticate further communication between the client and the master.
- The facter collects the state of the clients and sends it to the master.
- Based on the fact sent, the master compiles the manifests into catalogs.
- Catalogs are sent to the clients.
- The agents execute these manifests on its machine.
- A report is generated by the client that describes the changes made and is sent to the master.
This process is required at regular intervals, ensuring all client systems are up to date communication of Puppet Master and Slave.
Server-agent communication follows this pattern:
- Puppet Slave requests for the Master certificate.
- Puppet Master compiles and sends the Master Certificate.
- Puppet Master requests for the Slave certificate.
- Puppet slave sends the Slave certificate.
- Puppet Master requests.
Common Issues Faced while Installing the Agent Agent
- Mismatch of the configuration file.
- Master server not reachable due to port block.
- DNS host not reachable.
- Servers not reachable during remote installation.
Installation of Puppet on Windows Servers
There are three methods to install Puppet on the servers:
Remote Installation on the Group of Servers
Requirements for remote installation:
- An input file that has the list of servers.
- Installer script has a code to loop remote installation, script that pop-up the credentials required for authentication, and remote script execution on servers.
- Jump server where you can execute the remote script.
Puppet agent can be installed on a group of servers simultaneously using an installer script installer.ps1 remotely. The installer script has the code that will fetch and download the required files from the repository through the puppet master: https://puppetmaster:8140/packages/current/install.ps1 and copies the file to the required system directory folder in the server.
Steps for installation:
- Open Powershell as admin
- Redirect the prompt to the directory where the remote installation script is located.
- Run the remote installation script in .ps1 format.
- Enter the credentials that authenticate the domain.
- The script then remotely installs the agent on the list of servers given in the input file.
- Output the status of installation whether it is a success or failure.
Puppet agents can also be installed locally by copying the installer.ps1 file in the system directory. Once the file is copied to the local directory, we can install the puppet agent below.
.\Installer.ps1 -server puppetmasterserver.example.com -ge_environment <environment> -ge_location <serverlocation> -doinstall $true
Steps for local installation:
- RDP to the server that
- Open Powershell as admin in the server.
- Redirect to the location where the script is present.
- Use the above command to install the puppet agent on the server locally.
- Once the installation is completed, you will see the installation status on the PowerShell window.
Steps for installation:
- Installation of puppet agent in workgroup servers is the same as the local installation, but if the DNS name is not resolvable from windows host and if there is no Host A DNS record for Puppet server.
- Edit the host file that is in the path – C:\Windows\system32\drivers\etc\hosts
- Input the file with Ip address and puppet master server in the format – 192.168.xx.xx puppetserver.example.com
Once the file is saved, follow the procedure of local installation.
Puppet automation tool seems robust, user-friendly interface, as well as very declarative. Installation was very easy for me; it was nothing to worry about dependencies during installation.
AIS seeks professionals of a certain character and level of excellence in their skill. Take your career to the cloud and join us!