Most Commonly Asked Puppet Interview Questions And Answers:
Detailed Puppet Interview Questions And Answers are as follows-
1) What is Puppet?
Puppet is an open-source software configuration management tool. It runs on many Unix-like systems as well as on Microsoft Windows, and includes its own declarative language to describe system configuration
2) What is chef and puppet used for?
Puppet and Chef are the major configuration management systems on Linux, along with CFEngine, Ansible. More than a configuration management tool, Chef, along with Puppet and Ansible, is one of the industry’s most notable Infrastructure as Code (IAC) tools.
3) How Puppet works?
It works like this. Puppet agent is a daemon that runs on all the client servers(the servers where you require some configuration, or the servers which are going to be managed using puppet.) All the clients which are to be managed will have puppet agent installed on them, and are called nodes in puppet.
4) What are Resources in Puppet?
Resources are the fundamental unit for modeling system configurations. Each resource describes some aspect of a system, like a specific service or package.
A resource declaration is an expression that describes the desired state for a resource and tells Puppet to add it to the catalog. When Puppet applies that catalog to a target system, it manages every resource it contains, ensuring that the actual state matches the desired state.
5) What are Resource types in Puppet?
Every resource is associated with a resource type, which determines the kind of configuration it manages.
Puppet has many built-in resource types, like files, cron jobs, services, etc. See the resource type reference for information about the built-in resource types.
6) How can you add new resource types to Puppet?
Yes we can also add new resource types to Puppet:
Defined types are lightweight resource types written in the Puppet language.
Custom resource types are written in Ruby, and have access to the same capabilities as Puppet’s built-in types.
7) What is a Class in Puppet?
Classes are named blocks of Puppet code that are stored in modules for later use and are not applied until they are invoked by name. They can be added to a node’s catalog by either declaring them in your manifests or assigning them from an ENC.
Classes generally configure large or medium-sized chunks of functionality, such as all of the packages, config files, and services needed to run an application.
8) What is Node definition in Puppet?
A node definition or node statement is a block of Puppet code that will only be included in matching nodes’ catalogs. This feature allows you to assign specific configurations to specific nodes.
9) What are facts in Puppet?
Before requesting a catalog (or compiling one with puppet apply), Puppet will collect system information with Facter. Puppet receives this information as facts, which are pre-set variables you can use anywhere in your manifests.
10) Puppet can access which facts?
Puppet can access the following facts:
Facter’s built-in core facts. Any custom facts or external facts present in your modules.
11) What are functions in Puppet?
You can write your own functions in the Puppet language to transform data and construct values. A function can optionally take one or more parameters as arguments. A function returns a calculated value from its final expression.
Function Syntax in Puppet:
function <MODULE NAME>::<NAME>(<PARAMETER LIST>) >> <RETURN TYPE> { … body of function … final expression, which will be the returned value of the function}
11) What is a class in Puppet, explain with example?
Classes are named blocks of Puppet code that are stored in modules for later use and are not applied until they are invoked by name. They can be added to a node’s catalog by either declaring them in your manifests or assigning them from an ENC.
Classes generally configure large or medium-sized chunks of functionality, such as all of the packages, config files, and services needed to run an application.
12) Defining classes in Puppet:
Defining a class makes it available for later use. It doesn’t yet add any resources to the catalog; to do that, you must declare it or assign it from an ENC.
13) How can you configure systems with Puppet?
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.
14) What are Catalogs in Puppet?
A catalog is a document that describes the desired system state for one specific computer. It lists all of the resources that need to be managed, as well as any dependencies between those resources.
Puppet configures systems in two stages:
Compile a catalog. Apply the catalog.
15) Explain the agent/master architecture in Puppet?
When set up as an agent/master architecture, a Puppet master server controls the configuration information, and each managed agent node requests its own configuration catalog from the master.
In this architecture, managed nodes run the Puppet agent application, usually as a background service. One or more servers run the Puppet master application, Puppet Server.
16) How can Puppet agent nodes and Puppet masters communicate with each other?
Puppet agent nodes and Puppet masters communicate by HTTPS with client verification.
The Puppet master provides an HTTP interface, with various endpoints available. When requesting or submitting anything to the master, the agent makes an HTTPS request to one of those endpoints.
Client-verified HTTPS means each master or agent must have an identifying SSL certificate. They each examine their counterpart’s certificate to decide whether to allow an exchange of information.
Puppet includes a built-in certificate authority for managing certificates.
Agents can automatically request certificates through the master’s HTTP API. You can use the puppet cert command to inspect requests and sign new certificates. And agents can then download the signed certificates.
17) Can you explain stand-alone architecture in Puppet?
Puppet can run in a stand-alone architecture, where each managed node has its own complete copy of your configuration info and compiles its own catalog.
In this architecture, managed nodes run the Puppet apply application, usually as a scheduled task or cron job. You can also run it on demand for initial configuration of a server or for smaller configuration tasks.
Like the Puppet master application, Puppet apply needs access to several sources of configuration data, which it uses to compile a catalog for the node it is managing.
18) What is Puppet codedir?
Puppet’s codedir is the main directory for Puppet code and data. It contains environments (which contain your manifests and modules), a global modules directory for all environments, and your Hiera data.
19) Where do you find codedir in Puppet?
Puppet’s codedir can be found at one of the following locations:
*nix Systems: /etc/puppetlabs/codeWindows: %PROGRAMDATA%\PuppetLabs\code (usually C:\ProgramData\PuppetLabs\code)non-root users: ~/.puppetlabs/etc/code
20) In Puppet where codedir is configured?
The location of the codedir can be configured in puppet.conf with the codedir setting, but note that Puppet Server doesn’t use that setting; it has its own jruby-puppet.master-code-dir setting in puppetserver.conf. If you’re using a non-default codedir, you must change both settings.
21) What is a main manifest or site manifest in Puppet?
Puppet always starts compiling with either a single manifest file or a directory of manifests that get treated like a single file. This main starting point is called the main manifest or site manifest.
22) What is Puppet apply?
The puppet apply command requires a manifest as an argument on the command line. (For example: puppet apply /etc/puppetlabs/code/environments/production/manifests/site.pp.) It can be a single file or a directory of files.
The puppet apply command does not automatically use an environment’s manifest. Instead, it always uses the manifest you pass to it.
23) What is modulepath in Puppet?
The Puppet master service and the puppet apply command both load most of their content from modules. (See the page on module structure and behavior for more details.)
Puppet automatically loads modules from one or more directories. The list of directories Puppet will find modules in is called the modulepath.
24) What is base modulepath?
The base modulepath is a list of global module directories for use with all environments. It can be configured with the basemodulepath setting, but its default value is probably suitable for you unless you’re doing something unusual.
The default value of the basemodulepath setting is $codedir/modules:/opt/puppetlabs/puppet/modules
25) What is SSLdir?
Puppet stores its certificate infrastructure in the ssldir directory. This directory has a similar structure on all Puppet nodes, whether they are agent nodes, Puppet master servers, or the certificate authority (CA) master.
26) What the ssldir directory contains in Puppet?
The ssldir directory contains Puppet certificates, private keys, certificate signing requests (CSRs), and other cryptographic documents.
The ssldir directory on Agent nodes and Puppet masters contain a private key (private_keys/<certname>.pem), a public key (public_keys/<certname.pem>), a signed certificate (certs/<certname>.pem), a copy of the CA certificate (certs/ca.pem), and a copy of the certificate revocation list (CRL) (crl.pem).
They usually also retain a copy of their CSR after submitting it (certificate_requests/<certname>.pem). If these files don’t exist, they are either generated locally or requested from the CA Puppet master.
27) What is cache directory (vardir) in Puppet?
Puppet’s cache directory, sometimes called vardir, contains dynamic or growing data that Puppet creates in the course of its normal operations. Some of this data can be mined for interesting analysis, or to integrate other tools with Puppet. Other parts are just infrastructure and can be ignored.
28) Where the vardir can be stored in Puppet?
Location of the vardir directory Puppet Server’s cache directory defaults to /opt/puppetlabs/server/data/puppetserver.
The cache directory for Puppet agent and Puppet apply can be found at one of the following locations:
*nix Systems: /var/opt/puppetlabs/puppet/cachenon-root users: ~/.puppetlabs/opt/puppet/cacheWindows: %PROGRAMDATA%\PuppetLabs\puppet\cache (usually C:\Program Data\PuppetLabs\puppet\cache)
29) What are Environments in Puppet?
Environments are isolated groups of Puppet agent nodes.
A Puppet master serves each environment with its own main manifest and module path. This lets you use different versions of the same modules for different groups of nodes, which is useful for testing changes to your Puppet code before implementing them on production machines.
30) What are the types of environemts?
The main uses for environments fall into three categories: permanent test environments, temporary test environments, and divided infrastructure.
31) What are Permanent test environments in Puppet?
In a permanent test environment, there is a stable group of test nodes where all changes must succeed before they can be merged into the production code. The test nodes are a smaller version of the whole production infrastructure.
32) What are Temporary test environments in Puppet?
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.
33) What is Divided infrastructure in Puppet?
If parts of your infrastructure are managed by different teams that don’t need to coordinate their code, you can split them into environments.
34) What are modules in Puppet?
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.
35) What is Module layout in Puppet?
On disk, a module is a directory tree with a specific, predictable structure:
<MODULE NAME> manifests
files
templates
lib
facts
examples
spec
functions
types
36) What are the Types of plug-ins in modules of Puppet?
Puppet supports several kinds of plug-ins:
Custom facts (written in Ruby).External facts (executable scripts or static data).
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.
37) What is puppet module command?
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.
38) How to check the installed modules in Puppet?
Use the puppet module list command to see which modules you have installed and which directory they’re installed in.
39) What are the core commands of Puppet?
Core commands of Puppet are:
Pupper Agent
Pupper Server
Puppet Apply
Puppet Cert
Puppet Module
Puppet Resource
Puppet Config
Puppet Parser
Puppet Help
Puppet Man
40) What is Puppet agent?
Puppet agent manages systems, with the help of a Puppet master. It requests a configuration catalog from a Puppet master server, then ensures that all resources in that catalog are in their desired state.
41) What is Puppet Server?
Puppet Server compiles configurations for any number of Puppet agents, using Puppet code and various other data sources. It provides the same services as the classic Puppet master application, and more.
42) What is Puppet apply?
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.
43) What is Puppet cert?
Puppet cert helps manage Puppet’s built-in certificate authority (CA). It runs on the same server as the Puppet master application. You can use it to sign and revoke agent certificates.
44) What is Puppet module?
Puppet module is a multi-purpose tool for working with Puppet modules. It can install and upgrade new modules from the Puppet Forge, help generate new modules, and package modules for public release.
45) What is Puppet resource?
Puppet resource lets you interactively inspect and manipulate resources on a system. It can work with any resource type Puppet knows about.
46) What is Puppet config?
Puppet config lets you view and change Puppet’s settings.
47) What is Puppet parser?
Puppet parser lets you validate Puppet code to make sure it contains no syntax errors. It can be a useful part of your continuous integration toolchain.
48) What are Puppet help and Puppet man?
Puppet help and Puppet man can display online help for Puppet’s other subcommands.
49) What are the sub commands in Puppet?
Puppet’s command line tools consist of a single puppet binary with many subcommands. The following subcommands are available in this version of Puppet:
Core Tools: These subcommands form the core of Puppet’s tool set, and every user should understand what they do.
puppet agent
puppet apply
puppet cert
puppet master
puppet module
puppet resource
puppet lookup
50) What is Hiera?
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.
51) Why Puppet uses Hiera?
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
52) What is PSON in Puppet?
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.
53) How PSON is different from JSON?
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.
54) Name the two versions of the puppet? Define.
Open source puppet – It manages the configuration of Unix like the Microsoft windows system. It is a free version to modify and customize.
Puppet enterprise – Ability to manage all the IT applications, infrastructure and provide a robust based solution for automating anything.
55) Name the problem while using puppets?
Puppet distortion issue
Blink issue
Wrap issue
Movement issue
Face issue
Walking issue
56) What are the two components of the puppet?
Puppet language and Puppet platform
57) Where and why we use etckeepercommitpost and etckeepercommitpre?
It is used on a puppet agent.
etckeepercommitpost is used to define scripts and command after pushing configuration in the configuration file.
etckeepercommitpre is used to define scripts and command before pushing configuration in the configuration file.
58) What are the advantages of a puppet?
Develops imagination power, verbal expression, voice modulation, confidence, teamwork, dramatic expression, listening skills.
59) What puppet for automating configuration management?
Python.
60) What reduces the time to automation to get started with DevOps?
Puppet Bolt.
61) Mention the disadvantages of Puppet?
It is difficult to explain Ruby.
You have to use Ruby for expanding Puppet.
Quick delivering and development.
Puppet is not worth for small industries.
The features of global communicating are not in the puppet.
The global report is not viewed on agreement transferred out by the puppet.
62) What is Puppet Lint?
Puppet code is tested by puppet-lint. It is approved Contrary to the puppet language style guide. The code style is proved by puppet-lint. But the syntax is not proved. The command of puppet “puppet parser validate” is used for evaluating syntax.
63) What are puppet internals?
Puppet internals tells the way of interaction between the master and representative by the host confirmed HTTP.
Interaction of master and representative HTTP – The manager and representative connects each other commonly validates HTTP for the proof of the clients.
Collection of a catalog – The file is used by the representative at the time of constructing a node is known as the catalog. Catalog defines every asset condition and in the management as well as identifies the ordered details.
64) Name the benefits of puppet DevOps tools?
For describing, the framework as a code is permitted by the puppet. ICA is necessary for DevOps applications like managing version, companion evaluation, automatic testing and deployment, and ongoing transportation.
With the help of the deployment, the puppet gives a remarkable saving of time.
It describes the layout for the host.
Related Posts:
- Chef Interview Questions And Answers
- Ruby Interview Questions And Answers
- DevOps Interview Questions And Answers
- Latest Kubernetes Interview Questions and Answers
- Latest Docker Interview Question And Answer
- Microserverices Interview Questions And Answers
- Nagios Interview Questions And Answers
- Openshift Interview Question And Answers
- Splunk Interview Questions And Answers
- TOP 200+ JAVA Interview Questions And Answers
For more Interview Questions And Answers click here