{"id":3616,"date":"2022-11-29T12:25:23","date_gmt":"2022-11-29T12:25:23","guid":{"rendered":"https:\/\/www.checkmateq.com\/blog\/?p=3616"},"modified":"2024-10-19T17:33:16","modified_gmt":"2024-10-19T17:33:16","slug":"puppet-master","status":"publish","type":"post","link":"https:\/\/www.checkmateq.com\/blog\/puppet-master","title":{"rendered":"Puppet master and agent installation on RHEL 8"},"content":{"rendered":"<p><strong>Puppet<\/strong> is a configuration management tool that is used for <strong>automating configuration management, <\/strong>automating daily repeated tasks for IT operation management\u00a0and <strong>deployments<\/strong>.\u00a0 When using Puppet, you specify the ideal condition for the infrastructure systems that you want to manage. Writing <a href=\"https:\/\/www.checkmateq.com\/aws-cloud\">infrastructure as a code<\/a> in Puppet&#8217;s <strong>Domain-Specific Language<\/strong> (DSL) which works with a wide range of hardware and operating systems, is how you accomplish this.<strong> Puppet code is declarative<\/strong>, so you define the final state you want your systems to be in rather than the actions necessary to get there. After then, Puppet automates the procedure for putting these systems in that state and maintaining them in that state. With the use of SSL,<strong> Puppet&#8217;s Master-Slave architecture<\/strong> allows the Master and Slave to communicate over a private, encrypted channel. Puppet can be used to manage cloud operations tasks such as operating system configuration file management, server (web\/database\/application) management, monitoring file configuration, operating system post\/pre reboot sanitary checks, package deployment, etc. A configuration management tool can save <a href=\"https:\/\/www.checkmateq.com\/devops-engineering\">DevOps engineers<\/a> time by automating numerous other production operations.<\/p>\n<p>In this blog, we will see how to install puppet on master and client nodes. We will use one master and one client node as mentioned follow.<\/p>\n<h3>Step 1: Set up hostnames for the master and client-server.<\/h3>\n<ul>\n<li>First, we will set the hostname for the master server.<\/li>\n<\/ul>\n<pre>sudo hostnamectl set-hostname puppetmaster.chkmt.com\r\n<\/pre>\n<ul>\n<li>Now login to the client-server and set the hostname.<\/li>\n<\/ul>\n<pre>sudo hostnamectl set-hostname puppetclient.chkmt.com\r\n<\/pre>\n<ul>\n<li>Now open the \/etc\/hosts file in both the master and client machine and copy the following there.<\/li>\n<\/ul>\n<pre>[master-server IP] puppetmaster.chkmt.com puppetmaster\r\n[client-server IP] puppetclient.chkmt.com\r\n<\/pre>\n<h3>Step 2: Install puppet master<\/h3>\n<ul>\n<li>Now we will install puppet master on the master node. First, add and enable the yum repository. For adding a repository for other Linux distributions visit this<a href=\"http:\/\/yum.puppet.com\/?_ga=2.88357470.413689068.1669722122-632034589.1668081270\"> link<\/a>.<\/li>\n<\/ul>\n<pre>sudo rpm -Uvh https:\/\/yum.puppet.com\/puppet6-release-el-8.noarch.rpm\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-3795\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-Cloud-DevOps-Services-300x26.png\" alt=\"puppet\" width=\"715\" height=\"62\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-Cloud-DevOps-Services-300x26.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-Cloud-DevOps-Services-1024x89.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-Cloud-DevOps-Services-768x67.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-Cloud-DevOps-Services-1536x134.png 1536w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-Cloud-DevOps-Services-1200x104.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-Cloud-DevOps-Services.png 1563w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Check that the repository is added.<\/li>\n<\/ul>\n<pre>sudo yum repolist all\r\n<\/pre>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-3666\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-blockchain-development-services-300x66.png\" alt=\"puppet\" width=\"709\" height=\"156\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-blockchain-development-services-300x66.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-blockchain-development-services-1024x225.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-blockchain-development-services-768x169.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-blockchain-development-services-1536x337.png 1536w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-blockchain-development-services-1200x263.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-blockchain-development-services.png 1905w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Now install the puppet master.<\/li>\n<\/ul>\n<pre>sudo yum install puppetserver\r\n<\/pre>\n<ul>\n<li>Now configure the jvm memory allocation. By default, it is set to 2GB. Change it according to your system resources.<\/li>\n<\/ul>\n<pre>sudo vi \/etc\/sysconfig\/puppetserver\r\n<\/pre>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-3667\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Hire-software-developer-300x41.png\" alt=\"\" width=\"702\" height=\"96\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Hire-software-developer-300x41.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Hire-software-developer-1024x140.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Hire-software-developer-768x105.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Hire-software-developer-1200x164.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Hire-software-developer.png 1404w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Now modify the configuration file.<\/li>\n<\/ul>\n<pre>sudo vi \/etc\/puppetlabs\/puppet\/puppet.conf\r\n<\/pre>\n<ul>\n<li>Add the following lines to the file.<\/li>\n<\/ul>\n<pre><code>\r\n[master]\r\ndns_alt_names = puppetmaster,puppetmaster.chkmt.com\r\n\r\n[main]\r\ncertname = puppetmaster.chkmt.com\r\nserver = puppetmaster.chkmt.com\r\nruninterval = 30m\r\n<\/code><\/pre>\n<ul>\n<li>Generate CA for puppet master.<\/li>\n<\/ul>\n<pre>source \/etc\/profile.d\/puppet-agent.sh\r\npuppetserver ca setup\r\n<\/pre>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-3812\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-DevOps-support-300x20.png\" alt=\"\" width=\"690\" height=\"46\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-DevOps-support-300x20.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-DevOps-support-1024x67.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-DevOps-support-768x51.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-DevOps-support-1536x101.png 1536w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-DevOps-support-1200x79.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-DevOps-support.png 1746w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Allow traffic from port 8140 in the security group.<\/li>\n<li>If firewall service is enabled, add a rule for allowing traffic from port 8140.<\/li>\n<\/ul>\n<pre>firewall-cmd --permanent --add-port=8140\/tcp\r\nfirewall-cmd --reload\r\n<\/pre>\n<ul>\n<li>Start and enable the puppet server<\/li>\n<\/ul>\n<pre>sudo systemctl start puppetserver\r\nsudo systemctl enable puppetserver\r\n<\/pre>\n<h3>Step3: Install puppet agent<\/h3>\n<ul>\n<li>Login to client-server and install puppet agent.<\/li>\n<\/ul>\n<pre class=\"wp-block-code\"><code>sudo rpm -Uvh https:\/\/yum.puppet.com\/puppet6-release-el-8.noarch.rpm\r\nsudo yum install puppet-agent<\/code><\/pre>\n<ul>\n<li>\u00a0Open the puppet configuration file and paste the following code there.<\/li>\n<\/ul>\n<pre>sudo vi \/etc\/puppetlabs\/puppet\/puppet.conf\r\n<\/pre>\n<pre>[main]\r\nserver = puppetmaster.chkmt.com\r\ncertname = puppetclient.chkmt.com\r\nruninterval = 30m\r\n<\/pre>\n<ul>\n<li>Start the puppet agent with the following command. Run the command as a root user.<\/li>\n<\/ul>\n<pre>source \/etc\/profile.d\/puppet-agent.sh\r\npuppet resource service puppet ensure=running enable=true\r\n<\/pre>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-3844\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-it-support-services-300x36.png\" alt=\"puppet\" width=\"708\" height=\"85\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-it-support-services-300x36.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-it-support-services-1024x121.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-it-support-services-768x91.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-it-support-services-1200x142.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-it-support-services.png 1369w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<h3>Step 4: Create CA certificate and sign certificate request<\/h3>\n<ul>\n<li>First, run the following command from the client-server to initiate a connection.<\/li>\n<\/ul>\n<pre>puppet agent -t\r\n<\/pre>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-3846\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/hire-php-developers-300x30.png\" alt=\"puppet\" width=\"740\" height=\"74\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/hire-php-developers-300x30.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/hire-php-developers-1024x102.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/hire-php-developers-768x76.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/hire-php-developers-1536x153.png 1536w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/hire-php-developers-1200x119.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/hire-php-developers.png 1843w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Now run the following command in the master server to sign the certificate request.<\/li>\n<\/ul>\n<pre>puppetserver ca sign --certname puppetclient.chkmt.com\r\n<\/pre>\n<ul>\n<li>Run the following command to list the certificates.<\/li>\n<\/ul>\n<pre>puppetserver ca list --all\r\n<\/pre>\n<p><img loading=\"lazy\" class=\"alignnone wp-image-3847\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-mobile-app-development-company-300x30.png\" alt=\"puppet\" width=\"700\" height=\"70\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-mobile-app-development-company-300x30.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-mobile-app-development-company-1024x101.png 1024w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-mobile-app-development-company-768x76.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-mobile-app-development-company-1536x152.png 1536w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-mobile-app-development-company-1200x119.png 1200w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-mobile-app-development-company.png 1858w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<ul>\n<li>Now run the following command on the client-server to test the connection.<\/li>\n<\/ul>\n<pre class=\"wp-block-code\"><code>puppet agent --test<\/code><\/pre>\n<p>class=&#8221;wp-block-code&#8221;&gt;<img loading=\"lazy\" class=\"alignnone wp-image-3848\" src=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-google-cloud-services-300x59.png\" alt=\"puppet\" width=\"722\" height=\"142\" srcset=\"https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-google-cloud-services-300x59.png 300w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-google-cloud-services-768x152.png 768w, https:\/\/www.checkmateq.com\/blog\/wp-content\/uploads\/2022\/11\/Checkmate-google-cloud-services.png 916w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/p>\n<p><strong>Author Details:<\/strong><\/p>\n<p>This blog is written by Amit Kumar, <a href=\"https:\/\/www.checkmateq.com\/virtual-cto-services\">Virtual CTO in India<\/a> at Checkmate Management Consulting, Please contact with him to ensure Cloud infrastructure stability, optimal usages of <a href=\"https:\/\/www.checkmateq.com\/cloud\">cloud services<\/a>, <a href=\"https:\/\/www.checkmateq.com\/cloud\">remote cloud support<\/a>, cloud security posture assessment and infuse CICD pipeline best practices for faster go to market and <a href=\"https:\/\/www.checkmateq.com\/hire-developer\">IT Staffing Services in India<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Puppet is a configuration management tool that is used for automating configuration management, automating daily repeated tasks for IT operation management\u00a0and deployments.\u00a0 When using Puppet, you specify the ideal condition for the infrastructure systems that you want to manage. Writing infrastructure as a code in Puppet&#8217;s Domain-Specific Language (DSL) which works with a wide range &hellip; <a href=\"https:\/\/www.checkmateq.com\/blog\/puppet-master\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Puppet master and agent installation on RHEL 8&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":3852,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[53,2,70,7,59,11,16,14],"_links":{"self":[{"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/posts\/3616"}],"collection":[{"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/comments?post=3616"}],"version-history":[{"count":20,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/posts\/3616\/revisions"}],"predecessor-version":[{"id":4627,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/posts\/3616\/revisions\/4627"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/media\/3852"}],"wp:attachment":[{"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/media?parent=3616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/categories?post=3616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.checkmateq.com\/blog\/wp-json\/wp\/v2\/tags?post=3616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}