The puppet was first founded by Luke Kanies in 2005. A puppet is an open-source tool that is used for configuration management and can be run on both UNIX and Windows platforms. Puppet declares its own declarative language that can be compiled into a catalog and distributed to the system via client-server or it can be applied directly to the system. Tekslate has collected the most frequently asked Puppet Interview Questions which are often asked in multiple interviews.
Puppet Interview Questions
Q1) What is Puppet?
Ans: Puppet is a tool utilized for configuration management on both UNIX based and Microsoft windows working frameworks. Its principal objective is to make the administration of countless machines less complex, progressively solid, and with more automation. Puppet utilizes its own definitive language to depict the arrangement of a framework or system of frameworks. It is likewise generally used to automate system administration tasks.
Q2) What is store configs?
Ans: Storeconfigs is a puppetmaster option that stores the hub's genuine design to a database. It does this by contrasting the aftereffect of the last aggregation against what is in the database, asset per asset, then parameter per parameter, etc.
Q3) How can you use store configs?
Ans: The quick utilization of store configs is exported assets. Exported assets are assets that are prefixed by @@. Those assets are checked extraordinarily so they can be gathered on a few different hubs. Some example use cases are:
- Share/disseminate open keys (ssh or OpenSSL or different sorts)
- Build rundown of hosts running a few administrations (for checking)
- Build arrangement documents that require numerous hosts (for example/and so on/resolve.conf can be the link of records sent out by your DNS cache hosts
Q4) What do you mean by facter and explain some use cases for the same?
Ans: At some point, you have to compose shows on contingent articulation dependent on conditional expression based data which is accessible through Facter. Facter gives data like Kernel adaptation, Distribution discharge, IP Address, CPU information, and so forth. You can characterize your own custom realities. Facter can be utilized autonomously from Puppet to accumulate data about a framework. Regardless of whether it's parsing the/proc/xen index on Linux or running prtdiag order on Solaris, the tool works superbly abstracting the particular working framework orders used to decide the collection of facts. At the point when utilized related to Puppet, realities assembled through the framework permits the manikin ace to settle on savvy choices during show gathering.
Inside your manikin show, you can reference any key worth sets given by facter by prefixing the hash key with "$". If the default set of realities are not adequate, there are two different ways to stretch out Facter to give extra truth. One route is to utilize Ruby, the other path is by utilizing condition factors prefixed with FACTER_. S. This permits one to set for every node data and use it in our shows.
Q5) What are Manifests?
Ans: In Puppet, the files in which client configuration is specified are known as Manifests.
Q6) What is MCollective?
Ans: MCollective is a powerful orchestration framework. Run actions on thousands of servers simultaneously, using existing plugins or writing your own.
Q7) What are classes?
Ans: Classes are named squares of Puppet code that are put away in modules for some time in the future and are not applied until they are invoked by name. They can be added to a node’s list by either announcing them in your shows or allocating them from an ENC. Classes for the most part arrange huge or medium-sized lumps of usefulness, for example, the entirety of the bundles, config records, and administrations expected to run an application.
Q8) How can you test manifest files?
Ans: Clarify how you will initially run linguistic structure checks with manikin parser approval order. In the event that you are utilizing VIM, you can utilize modules like Syntastic to confirm code (or else) utilize a full-fledged IDE like Geppetto. Additionally use puppet build-up to confirm notwithstanding puppet parser. You can add RSpec/cucumber tests to your application. (Be Careful: RUBY aptitudes are required) and use Cucumber in independent mode to test your manifests.
Q9) Why should you use MCollective over plain vanilla Puppet?
Ans: The Marionette Collective, otherwise called MCollective, is a structure for building server coordination or equal occupation execution frameworks. Most clients automatically execute authoritative assignments on groups of servers. MCollective has some special qualities for working with huge quantities of servers:
Rather than depending on a static rundown of hosts to order, it utilizes metadata-based revelation and sifting. It can utilize a rich information source like PuppetDB or can perform constant disclosure over the system.
Rather than legitimately associating with each host (which can be asset serious and moderate), it utilizes distribute/buy-in middleware to impart in corresponding with numerous hosts on the double.
Q10) What data source types are supported in HIERA?
Ans: JSON and YAML
Inclined to build a profession as Puppet Developer? Then here is the blog post on, explore Puppet Training
Q11) What is the LDAP node classifier?
Ans: LDAP can be used to store information about nodes and servers. The LDAP Node Classifier is used to query LDAP for node information instead of an ENC.
Q12) Explain the use of etckeeper-commit-post and etckeeper-commit-pre-on Puppet Agent.
Ans: etckeeper-commit-post: In this configuration file, you can define command and scripts which executes after pushing configuration on Agent Etckeeper-commit-pre: In this configuration file you can define command and scripts which executes before pushing configuration on Agent
Q13) Explain Puppet Kick.
Ans: By default, Puppet Agent requests a Puppet Master after a periodic time which is known as “run interval”. Puppet Kick is a utility that allows you to trigger the Puppet Agent from Puppet Master.
Q14) Differentiate between class definition and class declaration.
Ans: Defining a class makes it accessible for later use. It doesn't yet add any assets to the index; to do that, you should declare it or assign it from an ENC.
Q15) Explain ordering and relationship.
Ans: As a matter of course, Puppet applies assets in the request they're proclaimed in their show. Be that as it may, if a gathering of assets should consistently be overseen in a particular request, you should unequivocally declare such relationships with relationship meta parameters, chaining arrows, and the required function. Puppet utilizes four meta parameters to set up connections, and you can set every one of them as a trait in any asset. The estimation of any relationship meta parameter should be an asset reference (or array of references) highlighting at least one objective asset.
before - Applies an asset before the objective asset
requires - Applies an asset after the objective asset
notifies - Applies an asset before the objective asset. The objective asset revives if the advising asset changes.
subscribe - Applies an asset after the objective asset. The subscribing resource refreshes if the objective asset changes.
If the two assets need to occur altogether, you can either place a preceding characteristic in the earlier one or a required property in the resulting one; either approach makes a similar relationship. The equivalent is valid for notify and subscribe.
Puppet Interview Questions And Answers For Experienced
Q16) Explain the design patterns you have used in your Puppet code.
Ans: Here is a tip to answer this question: Be exceptionally clear on this as this tests your development knowledge rather than sysadmin aptitudes. In any event, you will be tested profoundly on job/profile designs – this is the best and most complex way to deal with looking after code. Notice Anchor patterns and clarify why you are utilizing it. You should just utilize this example before Puppet 3.4 or PE 3.2.
Q17) Share some best practices for Puppet.
Ans: Some accepted procedures are recorded beneath:
Use Modules and Role/Profile design however much as could reasonably be expected.
Keep all code in form control with distributed modules/manifests being sourced from formally tested/released branches.
Utilize environments - Each environment is attached to a particular branch in the version control system.
Utilize Dry runs – use puppet agent - verbose -noop - test.
Manage Puppet module dependencies utilizing librarian Puppet. Version control and manage your Puppetfile
Keep data and code separate. Explicitly keep delicate data inside Hiera YAML documents (which are additionally form controlled).
The trick to doing the above is to utilize JSON records for classified information and YAML for non-confidential data and guarantee physical security to the JSON Folder where nobody aside from the root/puppet client can get to.
Q18) Explain r10k.
Ans: R10k gives a universally useful toolset to conveying Puppet conditions and modules. It executes the Puppetfile design and gives a local usage of Puppet dynamic situations. R10k has two essential jobs: introducing Puppet modules utilizing an independent Puppetfile, and overseeing Git and SVN based unique conditions
Q19) What common workflow is used for r10k?
Ans: A great part of the basic work process relies upon the standard git-flow to create highlight branches and rolling out all improvements in include branches, conveying the earth in test mode, and on the confirmation, converging to a branch before tidying up the highlighted branch. On the off chance that you are not utilizing the standard git-flow, receive likewise.
Q20) Can Puppet run on unique servers?
Ans: Puppet can run on servers that are interesting. Despite the fact that there may be exceptionally fewer odds of servers being special since inside an association there are a ton of likenesses that exist like the working framework that they are running on, etc.
Q21) Explain the architecture of Puppet.
Ans: Puppet is Open Source programming. It depends on the Client-server design. It is a Model-Driven framework. The customer is likewise called Agent. What's more, the server is known as the Master. It has the accompanying building parts:
Configuration Language: Puppet gives a language that is utilized to design Resources. We need to indicate what Action must be applied to which Resource. The Action has three things for every Resource: type, title, and rundown of characteristics of an asset. Puppet code is written in Manifests documents.
Resource Abstraction: We can make Resource Abstraction in Puppet with the goal that we can design assets on various stages. The puppet operator utilizes a Factor for passing the data of a domain to the Puppet server. In Fact, we have data about IP, hostname, OS, and so on of the earth.
Transaction: In Puppet, Agent sends Factor to the Master server. Ace sends back the inventory to the Client. The specialist applies any arrangement changes to the framework. When all progressions are applied, the outcome is sent to the Server.
Q22) 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.
Q23) What size of organizations utilize Puppet?
Ans: There is no base or most extreme organization size that can profit by Puppet, however, there are sizes that are bound to profit. Organizations with just a bunch of servers are probably not going to consider keeping up those servers to be a genuine issue, while those that have more need to consider cautiously how they dispense with manual management tasks.
Q24) What characters are permitted in a class name? In a module name or in other identifiers?
Ans: Class names can contain lowercase letters, numbers, and underscores, and should begin with a lowercase letter. It 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.
Q25) How can I manage passwords on Red Hat Enterprise Linux, CentOS, and Fedora Core?
Ans: 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.
Puppet Technical Interview Questions
Q26) What if I am using Puppet 2.6x or earlier?
Ans: There will be no change. Puppet 2.6.x remains licensed as GPLv2. The license change is not retroactive.
Q27) Explain the 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:
Q28) What commands are used 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)
Q29) What does it mean if I or my company wants to contribute to Puppet?
Ans: As a major aspect of this permit change, Puppet Labs has moved toward each current supporter of the undertaking and requested that they consent to a Contributor License Arrangement or CLA. Marking this CLA for yourself or your organization furnishes both you and Puppet Labs with extra lawful insurances and affirms:
That you own and are qualified for the code you are adding to Puppet
That you are eager to have it utilized in circulations
This gives confirmation that the causes and responsibility for code can't be questioned in case of any lawful test.
Q30) Explain some facts related to Puppet.
Ans: Puppet uses a system called Facter to collect system information. This information is related to as “Facts”, and they can automatically be used as variables within your Puppet manifest files. Factor provides data in your manifest files like Kernel version, CPU info, IP Address of the machine, dist release number, and more.
Q31) What is PSON?
Ans: If you perceive JSON, you would perceive PSON for its similarities. Puppet utilizes PSON so as to serialize information that would then be able to be sent over a system or put away on the nearby document framework. JSON necessitates that the type of the serialized information is UTF-8, Unicode encoded, PSON is a progressively nonexclusive 8-piece ASCII. As a result of its one of a kind encoding, PSON can speak to any succession of bytes as a string. While indicating the PSON MIME type, the best possible sort is "text/pson".
Q32) What is a Puppet server?
Ans: Puppet Server offers indistinguishable processes and highlights from the exemplary Puppet master program; in any case, Puppet Server runs on the JVM (Java Virtual Machine), doing as such by running the Puppet master codebase inside JRuby interpreters. A few pieces of the exemplary Puppet ace program are reimplemented in Closure in Puppet server.
Q33) Explain the potential that could be created by automating a process through Puppet.
Ans: In robotizing the setup and sending of different machines in your organization using Puppet, you could abbreviate the procedure from being weeks long to under 30 minutes. In the wake of building up an automation infrastructure configuration and deployment, the procedure you made can be broken into modules and depicted completely in a README, which is then looked into form control like git or svn. This permits future Dev Ops groups to refresh the Puppet modules, change the framework arrangements, and access history or even move back to previous versions of the configured infrastructure.
Q34) Explain Puppet Resource.
Ans: Puppet assets are the littlest unit of a framework setup. An asset gives a depiction to some part of the framework, for instance, a bundle that must be introduced for help with which the machine must convey. Puppet Catalogs contain arrangements of assets, which together in a Catalog depict the objective condition of the framework and deal with the entirety of the assets introduced on the framework.
Q35) Explain Resource type.
Ans: A Resource type portrays the sort of configurations managed by a given asset. Puppet comes out of the box with a few resource types, for instance, CRON jobs, service connections, files, and more. Resource types can likewise be extended.
Q36) Explain Puppet parser and what’s it uses?
Ans: Puppet parser glances through your manifest files to ensure the code inside them contains the right syntax. Puppet parser is particularly valuable as a component of a persistent mix pipeline, since it very well may be utilized as an automated check that forestalls invalid Puppet code from making it into your production environment and damaging infrastructure configurations.
Q37) 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.
Q38) Explain module layout in Puppet.
Ans: On disk, a module is a directory tree with a specific, predictable structure:
<MODULE NAME> manifests
Q39) Explain 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.
Q40) What is Hiera and what is its use in Puppet?
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. 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 call
Above is a good set of chef and puppet interview questions that are useful in puppet automation interview questions. These chef puppet interview questions or interview questions on puppet are useful when you want to crack DevOps interviews.