Table of Contents
In this article, I will take you through the best 50 Best Puppet Interview Questions and Answers. Puppet spans across your hybrid environments to automate infrastructure and application workflows and ongoing management. We meet teams where they are and take them to where they need to be by leveraging automation code across teams, deployments, applications, and infrastructure in a secure and scalable way.
Puppet Interview Questions
1. What is Puppet?
Ans: Puppet is an open source configuration management tool and produced by Puppet Labs. It’s written in Ruby and released as a free software.
2. What is the architecture of Puppet?
Ans: Puppet is Open Source software. It is based on Client-server architecture. It is a Model-Driven system. The client is also called Agent. And the server is called the Master.
It has the following architectural components:-
Configuration Language: Puppet provides a language that is used to configure Resources. We have to specify what Action has to be applied to which Resource. The Action has three items for each Resource: type, title, and list of attributes of a resource. Puppet code is written in Manifests files.
Resource Abstraction: We can create Resource Abstraction in Puppet so that we can configure resources on different platforms. Puppet agent uses a Factor for passing the information of an environment to the Puppet server. In Fact, we have information about IP, hostname, OS etc of the environment.
Transaction: In Puppet, Agent sends Factor to Master server. Master sends back the catalog to Client. The agent applies any configuration changes to the system. Once all changes are applied, the result is sent to Server.
3. What are the main use cases of Puppet Enterprise?
Ans: We can use Puppet Enterprise for the following scenarios:-
a)Node Management: We can manage a large number of nodes with Puppet.
b)Code Management: With Puppet, we can define Infrastructure as code. We can review, deploy, and test the environment configuration for Development, Testing and Production environments.
c)Reporting & Visualization: Puppet provides Graphical tools to visualize and see the exact status of infrastructure configuration.
d)Provisioning Automation: With Puppet, we can automate the deployment and creation of new servers and resources. So users and business can get their infrastructure requirements completed very fast with Puppet.
e)Orchestration: For a large Cluster of nodes, we can orchestrate the complete process by using Puppet. It can follow the order in which we want to deploy the infrastructure environments.
f)Automation of Configuration: With Configuration automation, the chances of manual errors are reduced. The process becomes more reliable with this.
4. Which is the Puppet Main Manifest?
Ans: A Puppet program, called a manifest, has a file name that uses the ".pp" extension. Puppet's default main manifest is /etc/puppet/manifests/site.pp.
5. What is Module and How it is different from Manifest?
Ans: Whatever the manifests we defined in modules, can call or include into other manifests. Which makes easier management of Manifests. It helps you to push specific manifests on a specific Node or Agent.
6. What is Factor?
Ans: Sometimes you need to write manifests on conditional expression based on agent-specific data which is available through Factor. Factor provides information like Kernel version, Dist release, IP Address, CPU info, etc. You can define your factor also.
7. What is the use of etckeeper-commit-post and etckeeper-commit-pre on Puppet Agent?
Ans: a)etckeeper-commit-post: In this configuration file you can define command and scripts which execute after pushing configuration on Agent.
b)etckeeper-commit-pre: In this configuration file you can define command and scripts which execute before pushing configuration on Agent.
8. What is Puppet Kick?
Ans: By default Puppet Agent request to Puppet Master after a periodic time which was known as “run interval”. Puppet Kick is a utility which allows you to trigger Puppet Agent from Puppet Master.
9. What is MCollective?
Ans: MCollective is a powerful orchestration framework. Run actions on thousands of servers simultaneously, using existing plugins or writing your own.
10. What’s special about Puppet’s model-driven design?
Ans: Traditionally, managing the configurations of a large group of computers has meant a series of imperative steps; in its rawest state, SSH and a for a loop. This general approach grew more sophisticated over time, but it retained the more profound limitations at its root.
Puppet takes a different approach, which is to model everything — the current state of the node, the desired configuration state, the actions taken during configuration enforcement — as data: each node receives a catalog of resources and relationships, compares it to the current system state, and makes changes as needed to bring the system into compliance.
The benefits go far beyond just healing the headaches of configuration drift and unknown system state: modeling systems as data let Puppet simulate configuration changes, track the history of a (sap training) system over its lifecycle, and prove that refactored manifest code still produces the same system state. It also drastically lowers the barrier to entry for hacking and extending Puppet: instead of analyzing code and reverse-engineering the effects of each step, a user can just parse data, and sysadmins have been able to add significant value to their Puppet deployments with an afternoon’s worth of Perl scripting.
11. Why does Puppet have its language? Why not use XML or YAML as the configuration format?
Ans: The language used for manifests is ultimately Puppet’s human interface, and XML and YAML, being data formats developed around the processing capabilities of computers, are horrible human interfaces. While some people are comfortable reading and writing them, there’s a reason why we use web browsers instead of just reading the HTML directly. Also, using XML or YAML would limit any assurance that the interface was declarative — one process might treat an XML configuration differently from another.
12. Can Puppet manage workstations?
Ans: Yes, Puppet can manage any machine and is used to manage many organizations that have a mix of laptops and desktops.
13. Does Puppet run on Windows?
Ans: Yes. As of Puppet 2.7.6 basic types and providers do run on Windows, and the test suite is being run on Windows to ensure future compatibility. More information can be found on the Puppet on Windows page, and bug reports and patches are welcome.
14. What size organizations should use Puppet?
Ans: There is no minimum or maximum organization size that can benefit from Puppet, but there are sizes that are more likely to benefit. Organizations with only a handful of servers are unlikely to consider maintaining those servers to be a real problem, while those that have more need to consider carefully how they eliminate manual management tasks.
15. My servers are all unique; can Puppet still help?
All servers are at least somewhat unique, but very few servers are unique; hostnames and IP addresses (e.g.) will always differ, but nearly every server runs a relatively standard operating system. Servers are also often very similar to other servers within a single organization — all Solaris servers might have similar security settings, or all web servers might have roughly equivalent configurations — even if they’re very different from servers in other organizations. Finally, servers are often needlessly unique, in that they have been built and managed manually with no attempt at retaining appropriate consistency.
Puppet can help both on the side of consistency and uniqueness. Puppet can be used to express the consistency that should exist, even if that consistency spans arbitrary sets of servers based on any data like operating system, data center, or physical location. Puppet can also be used to handle uniqueness, either by allowing the special provision of what makes a given host unique or through specifying exceptions to otherwise standard classes.
16. What is Puppet Labs?
Ans: Puppet Labs (formerly Reductive Labs) is a small, private company focused on re-framing the server automation problem.
17. How should I upgrade Puppet and Factor?
Ans: The best way to install and upgrade Puppet and Factor is via your operating system’s package management system, using either your vendor’s repository or one of Puppet Labs’ public repositories.
If you have installed Puppet from source, make sure you remove old versions entirely (including all application and library files) before upgrading. Configuration data (usually located in/etc/puppet or /var/lib/puppet, although the location can vary) can be left in place between installs.
18. What characters are permitted in a class name? In a module name? In other identifiers?
Ans: Class names can contain lowercase letters, numbers, and underscores, and should begin with a lowercase letter. can be used as a namespace separator.
The same rules should be used when naming defined resource types, modules, and parameters, although modules and parameters cannot use the namespace separator.
Variable names can include alphanumeric characters and underscore, and are case-sensitive.
19. How do I document my manifests?
Ans: The puppet language includes a simple documentation syntax, which is currently documented on the Puppet Manifest Documentation wiki page. The puppet doc command uses this inline documentation to automatically generate RDoc or HTML documents for your manifests and modules.
20. How do I manage passwords on Red Hat Enterprise Linux, CentOS, and Fedora Core?
Ans: As described in the Type reference, you need the Shadow Password Library, which is provided by the ruby-shadow package. The ruby-shadow library is available natively for fc6 (and higher) and should build on the corresponding RHEL and CentOS variants.
21. How do all of these variables, like $operatingsystem, get set?
Ans: The variables are all set by Factor. You can get a full listing of the available variables and their values by running factor by itself in a shell.
22. What is Puppet Module and How it is different from Puppet Manifest?
Ans: A Puppet Module is a collection of Manifests and data (such as facts, files, and templates), and they have a specific directory structure. Modules are useful for organizing your Puppet code because they allow you to split your code into multiple Manifests. It is considered the best practice to use Modules to organize almost all of your Puppet Manifests.
Puppet programs are called Manifests. Manifests are composed of Puppet code and their file names use the .pp extension.
23. What happens if I am on Puppet 2.6x or earlier?
Ans: Nothing changes for you. Puppet 2.6.x remains licensed as GPLv2. The license change is not retroactive.
24. Does this change affect all the components of a Puppet?
Ans: As part of this change, we’re also changing the license of the Factor system inventory tool to Apache. This change will take effect with Factor version 1.6.0, and earlier versions of Factor will remain licensed under the GPLv2 license. This change will bring the licensing of Puppet’s two key components into alignment.
25. What is Puppet Catalog?
Ans: When configuring a node, the Puppet Agent uses a document called a catalog, which it downloads from a Puppet Master. The catalog describes the desired state for each resource that should be managed and may specify dependency (pivotal training) information for resources that should be managed in a certain order.
Puppet compiles a catalog using three main sources of configuration info:
26. What are the Commands to sign Requested Certificates?
Ans: Below are the commands to sign requested certificates.
puppet –sign hostname-of-agent (2.6)
puppet ca sign hostname-of-agent (3.0)
27. What does this mean if I or my company have or want to contribute code to Puppet?
Ans: As part of this license change, Puppet Labs has approached every existing contributor to the project and asked them to sign a Contributor License Agreement or CLA.
Signing this CLA for yourself or your company provides both you and Puppet Labs with additional legal protections and confirms:
a. That you own and are entitled to the code you are contributing to Puppet
b. That you are willing to have it used in distributions
This gives assurance that the origins and ownership of the code cannot be disputed in the event of any legal challenge.
28. What if I haven’t signed a CLA?
Ans:If you haven’t signed a CLA, then we can’t yet accept your code contribution into Puppet or Factor. Signing a CLA is very easy: simply log into your GitHub account and go to our CLA page to sign the agreement.
We’ve worked hard to try to find to everyone who has contributed code to Puppet, but if you have questions or concerns about a previous contribution you’ve made to Puppet and you don’t believe you’ve signed a CLA, please sign a CLA or contact us for further information.
29. Does signing a CLA change who owns Puppet?
Ans: The change in license and the requirement for a CLA doesn’t change who owns the code. This is a pure license agreement and NOT a Copyright assignment. If you sign a CLA, you maintain full copyright to your code and are merely providing a license to Puppet Labs to use your code.
All other code remains the copyright of Puppet Labs.
30. Which versions of Ruby does Puppet support?
Ans: Puppet requires an MRI Ruby interpreter. Certain versions of Ruby are tested more thoroughly with Puppet than others, and some versions are not tested at all. Run ruby –version to check the version of Ruby on your system.
Starting with Puppet 4, puppet-agent packages do not rely on the OS’s Ruby version, as it bundles its own Ruby environment. You can install puppet-agent alongside any version of Ruby or on systems without Ruby installed. Likewise, Puppet Enterprise does not rely on the OS’s Ruby version, as it bundles its own Ruby environment. You can install PE alongside any version of Ruby or on systems without Ruby installed. The Windows installers provided by Puppet Labs don’t rely on the OS’s Ruby version and can be installed alongside any version of Ruby or on systems without Ruby installed.
31.Where Puppet Master Stores Certificates?
32. What is Facter?
Ans.Sometime you need to write manifests on conditional experession based on agent specific data which is available through Facter. Facter provides information like Kernel version,Dist release, IP Address, CPU info and etc.You can defined your facter also.
33. What is the use of etckeeper-commit-post and etckeeper-commit-pre on PUPPET AGENT?
Ans. Below are its uses:-
a)etckeeper-commit-post: In this configuration file you can define command and scripts which executes after pushing configuration on Agent
b)Etckeeper-commit-pre: In this configuration file you can define command and scripts which executes before pushing configuration on Agent
34. What are Temporary test environments in Puppet?
Ans.In a temporary test environment, you can test a single change or group of changes by checking the changes out of version control into the $codedir/environments directory, where it will be detected as a new environment. A temporary test environment can either have a descriptive name or use the commit ID from the version that it is based on.
35. What is Divided infrastructure in Puppet?
Ans.If parts of your infrastructure are managed by different teams that don’t need to coordinate their code, you can split them into environments.
36. What are modules in Puppet?
Ans.Modules are self-contained bundles of code and data. These reusable, shareable units of Puppet code are a basic building block for Puppet.
Nearly all Puppet manifests belong in modules. The sole exception is the main site.pp manifest, which contains site-wide and node-specific code.
37. What is Module layout in Puppet?
Ans. On disk, a module is a directory tree with a specific, predictable structure:
<MODULE NAME> manifests
38. What are the Types of plug-ins in modules of Puppet?
Ans.Puppet supports several kinds of plug-ins:
a)Custom facts (written in Ruby).External facts (executable scripts or static data).
b)Custom resource types and providers (written in Ruby).Custom functions written in Ruby.Custom functions written in the Puppet language.Custom Augeas lenses.Miscellaneous utility Ruby code used by other plug-ins.
39. What is puppet module command?
Ans.The puppet module command provides an interface for managing modules from the Puppet Forge. Its interface is similar to several common package managers (such as gem, apt-get, or yum). You can use the puppet module command to search for, install, and manage modules.
40. Explain the process of installing modules from the command line in Puppet?
Ans.The puppet module install command installs a module and all of its dependencies.
By default, it installs into the first directory in Puppet’s modulepath, which defaults to $codedir/environments/production/modules.
For example, to install the puppetlabs-apache module, run:
puppet module install puppetlabs-apache
41.Explain the process of Installing modules from the Puppet Forge?
Ans.To install a module from the Puppet Forge, use the puppet module install command with the full name of the module you want.
The full name of a Forge module is formatted as username-modulename. For example, to install puppetlabs-apache:
puppet module install puppetlabs-apache
42.How to check the installed modules in Puppet?
Ans.Use the puppet module list command to see which modules you have installed and which directory they’re installed in.
43.What is Hiera?
Ans. Hiera is a key/value lookup used for separating data from Puppet code. Hiera is Puppet’s built-in key-value configuration data lookup system.
Puppet’s strength is in reusable code. Code that serves many needs must be configurable: put site-specific information in external configuration data files, rather than in the code itself.
44.Why Puppet uses Hiera?
Ans.Puppet uses Hiera to do two things:
Store the configuration data in key-value pairsLook up what data a particular module needs for a given node during catalog compilation.This is done via:
Automatic Parameter Lookup for classes included in the catalog
Explicit lookup calls
45.What is PSON in Puppet?
Ans. PSON is a variant of JSON that puppet uses for serializing data to transmit across the network or store on disk. Whereas JSON requires that the serialized form is valid unicode (usually UTF-8), PSON is 8-bit ASCII, which allows it to represent arbitrary byte sequences in strings.
Puppet uses the MIME types “pson” and “text/pson” to refer to PSON.
46.How PSON is different from JSON?
Ans. PSON does not differ from JSON in its representation of objects, arrays, numbers, booleans, and null values. PSON does serialize strings differently from JSON.A PSON string is a sequence of 8-bit ASCII encoded data. It must start and end with “ (ASCII 0x22) characters.
47.What is Puppet resource?
Ans.Puppet resource lets you interactively inspect and manipulate resources on a system. It can work with any resource type Puppet knows about.
48.What is Puppet config?
Ans.Puppet config lets you view and change Puppet’s settings.
49.How to display a list of available inbuilt puppet resource types?
Ans.Below is the command to display a list of available inbuilt puppet resource types:-
puppet resource –types
50.What is Puppet apply?
Ans.Puppet apply manages systems without needing to contact a Puppet master server. It compiles its own configuration catalog, using Puppet modules and various other data sources, then immediately applies the catalog.
Also Read: How to install Ansible on Ubuntu
Reference: Puppet Documentation