{"id":411,"date":"2024-09-11T17:18:19","date_gmt":"2024-09-11T17:18:19","guid":{"rendered":"https:\/\/questy.org\/?p=411"},"modified":"2024-10-31T16:12:57","modified_gmt":"2024-10-31T16:12:57","slug":"puppet-primer","status":"publish","type":"post","link":"https:\/\/questy.org\/index.php\/2024\/09\/11\/puppet-primer\/","title":{"rendered":"Puppet Primer I &#8211; What is Puppet?"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full is-style-rounded\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"675\" src=\"https:\/\/i0.wp.com\/questy.org\/wp-content\/uploads\/2024\/09\/create-a-puppet-on-strings-maybe-with-a-technology-based.png?resize=900%2C675&#038;ssl=1\" alt=\"\" class=\"wp-image-432\" style=\"aspect-ratio:16\/9;object-fit:cover\" srcset=\"https:\/\/i0.wp.com\/questy.org\/wp-content\/uploads\/2024\/09\/create-a-puppet-on-strings-maybe-with-a-technology-based.png?w=1024&amp;ssl=1 1024w, https:\/\/i0.wp.com\/questy.org\/wp-content\/uploads\/2024\/09\/create-a-puppet-on-strings-maybe-with-a-technology-based.png?resize=300%2C225&amp;ssl=1 300w, https:\/\/i0.wp.com\/questy.org\/wp-content\/uploads\/2024\/09\/create-a-puppet-on-strings-maybe-with-a-technology-based.png?resize=768%2C576&amp;ssl=1 768w\" sizes=\"auto, (max-width: 900px) 100vw, 900px\" \/><\/figure>\n\n\n\n<p><br>One of the perennial problems with a platform like Puppet is not the lack of documentation in and of itself, but moreso the lack of various levels of documentation at all levels of documentation<em> consumer.<\/em> What I mean by this is, we may have a lot of documentation available (take the veritable encyclopedia of data at https:\/\/puppet.com\/docs), but we may not actually have access to beginner-level <strong><em>accessible<\/em><\/strong> data.<\/p>\n\n\n\n<p>What do I mean by &#8220;accessible&#8221;?<\/p>\n\n\n\n<p>Most of the professional documentation I&#8217;ve encountered around the Puppet ecosystem is produced by <strong>brilliant<\/strong> engineers. Oftentimes, though, as we progress forward in our development on <em>any<\/em> platform, we tend to forget from where we came, and the level of knowledge we might have had at our earliest stages of development. As a result, we get <strong>really<\/strong> advanced documentation that is trying to be apprehended by the novice user.<\/p>\n\n\n\n<p>This series will attempt to alleviate some of that.  It should be noted that the majority of the work in this series of documentation will be on Puppet <em>Community.<\/em> Where possible, when documentation features or functions, I will link official documentation, Puppet Git projects, or some other foundation for the assertions and documentation that I am making.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>What is Puppet<\/strong>?<\/p>\n\n\n\n<p>First and foremost, we should answer the question &#8220;What is Puppet&#8221;.  Now, generally, when we come to this question, many have already answered that question, and are likely looking here for advanced information. However, since this is a primer, we will cover that here.<\/p>\n\n\n\n<p>When we talk about Puppet, we&#8217;re not talking about these guys:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/List_of_Muppets\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"199\" height=\"262\" src=\"https:\/\/i0.wp.com\/questy.org\/wp-content\/uploads\/2024\/09\/Muppets_cast.jpg?resize=199%2C262&#038;ssl=1\" alt=\"Muppets Cast\" class=\"wp-image-414\" style=\"width:222px;height:auto\"\/><\/a><\/figure>\n\n\n\n<p><br>What we&#8217;re talking about is an automation platform used by System Administrators and Engineers (primarily) to automate their work at scale. In the past, SysAdmins would keep a list of hosts they managed locally in text files or in SSH session management software like <a href=\"https:\/\/www.putty.org\/\" data-type=\"link\" data-id=\"https:\/\/www.putty.org\/\">PuTTY<\/a>. Through any number of mechanisms tht would allow them to automate procedures across n+1 nodes. In some cases 5-10 at a time, and in other cases hundreds or thousands. However, there were problems&#8230;<\/p>\n\n\n\n<p>With hundreds or thousands of nodes, you could only &#8220;chunk&#8221; your actions into groupings between 20-40 at a time, and many times the commands you would execute would be performed in a serial fashion, taking time during which you would have an environment that was not fully in sync. Therefore, people could conceivably reach resources that have had changes, refresh a browser or a thin client, and get an entirely different experience, feature set, or even data.  This was no good.<\/p>\n\n\n\n<p>Additional problems would be that as your fleet grew or shrunk, the lists of nodes you have may become out of sync, and if you had multiple engineers, your lists may be out of sync with each other, causing coverage issues when trying to make changes to your environment. Maybe some engineers were using one set of scripts or node lists, and another was using different scripts or node lists, and perhaps the functionality between them differed. This made for a lack of predictability in how an environment was configured and\/or was functioning, and would conceal states of &#8220;drift&#8221; from node to node.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><em><strong>Enter Puppet<\/strong><\/em><\/p>\n\n\n\n<p>Puppet&#8217;s creator, Luke Kanies, found this disarray noted above in the System Administration space, and decided to create Puppet. You can learn a bit more about the early days and development of Puppet from an O&#8217;Reilly interview with Luke here:<br><\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"How Puppet came to be and where it goes next: Luke Kanies interviewed at Velocity 2012\" width=\"900\" height=\"506\" src=\"https:\/\/www.youtube.com\/embed\/BTk1v6WLxls?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>Luke&#8217;s main development that sort of revolutionized the configuration paradigm was the development of a &#8220;Resource Abstraction Layer&#8221;, which he describes in the video. For a little more in-depth coverage of the RAL and how it works, check out these articles here:<br><br><a href=\"https:\/\/petersouter.xyz\/the-puppet-resource-abstraction-layer-ral-explained-part-1\/\" data-type=\"link\" data-id=\"https:\/\/petersouter.xyz\/the-puppet-resource-abstraction-layer-ral-explained-part-1\/\">RAL-1<\/a><br><a href=\"https:\/\/petersouter.xyz\/the-puppet-resource-abstraction-layer-ral-explained-part-2\/\" data-type=\"link\" data-id=\"https:\/\/petersouter.xyz\/the-puppet-resource-abstraction-layer-ral-explained-part-2\/\">RAL-2<\/a><\/p>\n\n\n\n<p>In short, the RAL is the &#8220;thing about the thing&#8221;.  In these days of &#8220;meta-everything&#8221;, it seems odd to use such a reference, but the referencing system works. <\/p>\n\n\n\n<p>When approaching a system for system administration purposes, there are files, packages, users, configurations, text, binaries, repositories&#8230; many different things you have to be aware of.  As a result, you build up a skillset consisting of a knowledge of not only what these things are, but how they work, are configured, and interact with other subsystems.  Luke&#8217;s main development here was to build this RAL as a &#8220;modeling system&#8221; to approach a server or series of servers <em>programmatically<\/em>. <\/p>\n\n\n\n<p>As a result, a system was broken down into components known as &#8220;resources&#8221;, which are the fundamental unit for modeling a system configuration in Puppet. <\/p>\n\n\n\n<figure class=\"wp-block-pullquote\"><blockquote><p><em>&#8220;Each resource describes the desired state for some aspect of the system, like a specific service or package. When Puppet applies a catalog to the target system, it manages every resource in the catalog, ensuring the actual state matches the desired state.&#8221;<\/em><\/p><cite><a href=\"https:\/\/www.puppet.com\/docs\/puppet\/8\/lang_resources.html\" data-type=\"link\" data-id=\"https:\/\/www.puppet.com\/docs\/puppet\/8\/lang_resources.html\">Puppet Documentation<\/a><\/cite><\/blockquote><\/figure>\n\n\n\n<p>Puppet has simplified not just the configuration of systems in an IT infrastructure, but made it possible to assert a configuration against many systems <em>at once<\/em> in an infrastructure, but this isn&#8217;t the main power behind Puppet. The main power is to be able to collect various resources into groupings, and to apply those configurations programmatically, allowing you to work with code as your infrastructure rather than individual machine configurations.<\/p>\n\n\n\n<p class=\"has-medium-font-size\"><strong>How Does it Work?<\/strong><\/p>\n\n\n\n<p>When you use Puppet, you define the desired state of the system in code. This code that you use is a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Domain-specific_language\" data-type=\"link\" data-id=\"https:\/\/en.wikipedia.org\/wiki\/Domain-specific_language\">Domain Specific Language<\/a> (the Puppet DSL) which you use against a wide array of operating systems and devices, defining the <em>desired state<\/em> of those systems, not how to get there. Puppet, by utilizing its RAL, a Puppet Server and Agent which interprets the code you&#8217;ve written and configures the destination machine with that code. The organization of that code flow and system configuration looks like so:<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"900\" height=\"511\" src=\"https:\/\/i0.wp.com\/questy.org\/wp-content\/uploads\/2024\/09\/puppet_run_v2.png?resize=900%2C511&#038;ssl=1\" alt=\"Credit:  puppet.com\" class=\"wp-image-421\"\/><\/figure>\n\n\n\n<p class=\"has-small-font-size\">Above image from <a href=\"https:\/\/www.puppet.com\/docs\/puppet\/8\/what_is_puppet\" data-type=\"link\" data-id=\"https:\/\/www.puppet.com\/docs\/puppet\/8\/what_is_puppet\">Puppet.com<\/a><\/p>\n\n\n\n<p>Altogether, this suite of tools, coding, methods, and components makes up the Puppet Platform. In our next installment, we will break apart this platform into its separate components and see what&#8217;s under the hood.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Credit: Wikipedia &#8220;List of Muppets&#8221;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[4],"tags":[],"class_list":["post-411","post","type-post","status-publish","format-standard","hentry","category-puppet-education"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_likes_enabled":true,"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/posts\/411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/comments?post=411"}],"version-history":[{"count":18,"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/posts\/411\/revisions"}],"predecessor-version":[{"id":490,"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/posts\/411\/revisions\/490"}],"wp:attachment":[{"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/media?parent=411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/categories?post=411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/questy.org\/index.php\/wp-json\/wp\/v2\/tags?post=411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}