Install Puppet Agent KodeKloud Engineer Devops Task Success

Ticker

6/recent/ticker-posts

Install Puppet Agent KodeKloud Engineer Devops Task Success

Question: The Nautilus DevOps team to would like to set up a Puppet agent mode to manage their infrastructure in Stratos DC. For testing they are trying to install and set up Puppet agent package on App Server 2. Please find below more details about the task to proceed further.

Install puppet agent on App Server 2 also start its service.

Please Note:-  Perform the below commands based on your question server,  user name & other details that might differ as per the task.


Solution : 

1. At first login to the app server as per the task & Switch to the root user

thor@jump_host ~$ ssh steve@stapp02

The authenticity of host 'stapp02 (172.16.238.11)' can't be established.

ECDSA key fingerprint is SHA256:vhT1YSt8eCiEdPiX35C5Qb9qhs7zCUMlbx1x5tLrsiI.

ECDSA key fingerprint is MD5:89:a3:c0:79:11:78:aa:a5:e3:e8:a3:01:ee:ca:a2:ff.

Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added 'stapp02,172.16.238.11' (ECDSA) to the list of known hosts.

steve@stapp02's password:

[steve@stapp02 ~]$ sudo su -

We trust you have received the usual lecture from the local System

Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.

    #2) Think before you type.

    #3) With great power comes great responsibility.

[sudo] password for steve:

[root@stapp02 ~]#


2. 
For puppet agent, 1st we need to install puppet repo

[root@stapp02 ~]# yum install https://yum.puppetlabs.com/puppet-release-el-7.noarch.rpm

Loaded plugins: fastestmirror, ovl

puppet-release-el-7.noarch.rpm                                                                 | 9.7 kB  00:00:00    

Examining /var/tmp/yum-root-sKJNu4/puppet-release-el-7.noarch.rpm: puppet-release-1.0.0-14.el7.noarch

Marking /var/tmp/yum-root-sKJNu4/puppet-release-el-7.noarch.rpm to be installed

Resolving Dependencies

--> Running transaction check

---> Package puppet-release.noarch 0:1.0.0-14.el7 will be installed

--> Finished Dependency Resolution

 Dependencies Resolved

 ======================================================================================================================

 Package                    Arch               Version                  Repository                               Size

======================================================================================================================

Installing:

 puppet-release             noarch             1.0.0-14.el7             /puppet-release-el-7.noarch             5.1 k

 Transaction Summary

======================================================================================================================

Install  1 Package

 Total size: 5.1 k

Installed size: 5.1 k

Is this ok [y/d/N]: y

Downloading packages:

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : puppet-release-1.0.0-14.el7.noarch                                                                 1/1

  Verifying  : puppet-release-1.0.0-14.el7.noarch                                                                 1/1

 Installed:

  puppet-release.noarch 0:1.0.0-14.el7                                                                               

 Complete!

[root@stapp02 ~]#


3. Install puppet agent 

[root@stapp02 ~]#  yum install puppet-agent

Loaded plugins: fastestmirror, ovl

Determining fastest mirrors

 * base: mirror.mobap.edu

 * extras: mirrors.gigenet.com

 * updates: linux-mirrors.fnal.gov

base                                                                                           | 3.6 kB  00:00:00    

extras                                                                                         | 2.9 kB  00:00:00    

puppet                                                                                         | 2.5 kB  00:00:00    

updates                                                                                        | 2.9 kB  00:00:00    

(1/5): extras/7/x86_64/primary_db                                                              | 242 kB  00:00:00    

(2/5): puppet/x86_64/primary_db                                                                |  90 kB  00:00:00    

(3/5): base/7/x86_64/group_gz                                                                  | 153 kB  00:00:00    

(4/5): base/7/x86_64/primary_db                                                                | 6.1 MB  00:00:01    

(5/5): updates/7/x86_64/primary_db                                                             | 9.5 MB  00:00:01    

Resolving Dependencies

--> Running transaction check

---> Package puppet-agent.x86_64 0:7.9.0-1.el7 will be installed

--> Finished Dependency Resolution

 Dependencies Resolved

 ======================================================================================================================

 Package                        Arch                     Version                       Repository                Size

======================================================================================================================

Installing:

 puppet-agent                   x86_64                   7.9.0-1.el7                   puppet                    25 M

 

Transaction Summary

======================================================================================================================

Install  1 Package

 Total download size: 25 M

Installed size: 115 M

Is this ok [y/d/N]: y

Downloading packages:

warning: /var/cache/yum/x86_64/7/puppet/packages/puppet-agent-7.9.0-1.el7.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 9e61ef26: NOKEY

Public key for puppet-agent-7.9.0-1.el7.x86_64.rpm is not installed

puppet-agent-7.9.0-1.el7.x86_64.rpm                                                            |  25 MB  00:00:01    

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puppet-release

Importing GPG key 0xEF8D349F:

 Userid     : "Puppet, Inc. Release Key (Puppet, Inc. Release Key) <release@puppet.com>"

 Fingerprint: 6f6b 1550 9cf8 e59e 6e46 9f32 7f43 8280 ef8d 349f

 Package    : puppet-release-1.0.0-14.el7.noarch (installed)

 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-puppet-release

Is this ok [y/N]: y

Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-2025-04-06-puppet-release

Importing GPG key 0x9E61EF26:

 Userid     : "Puppet, Inc. Release Key (Puppet, Inc. Release Key) <release@puppet.com>"

 Fingerprint: d681 1ed3 adee b844 1af5 aa8f 4528 b6cd 9e61 ef26

 Package    : puppet-release-1.0.0-14.el7.noarch (installed)

 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-2025-04-06-puppet-release

Is this ok [y/N]: y

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : puppet-agent-7.9.0-1.el7.x86_64                                                                    1/1

  Verifying  : puppet-agent-7.9.0-1.el7.x86_64                                                                    1/1

 Installed:

  puppet-agent.x86_64 0:7.9.0-1.el7                                                                                  

 Complete!

[root@stapp02 ~]#


4. Start puppet service  ( Please refer to your task, also watch the video below)

[root@stapp02 ~]# /opt/puppetlabs/bin/puppet resource service puppet ensure=running enable=true

Notice: /Service[puppet]/ensure: ensure changed 'stopped' to 'running'

service { 'puppet':

  ensure   => 'running',

  enable   => 'true',

  provider => 'systemd',

}

[root@stapp02 ~]#


5. Validate the task 

[root@stapp02 ~]# rpm -qa |grep puppet

puppet-release-1.0.0-14.el7.noarch

puppet-agent-7.9.0-1.el7.x86_64

[root@stapp02 ~]#

[[root@stapp02 ~]# ps -ef |grep puppet

root      1204     1  0 11:38 ?        00:00:01 /opt/puppetlabs/puppet/bin/ruby /opt/puppetlabs/puppet/bin/puppet agent --no-daemonize

root      1540   571  0 11:40 pts/0    00:00:00 grep --color=auto puppet

[root@stapp02 ~]#



6.  Click on Finish & Confirm to complete the task successfully

Happy Learning!!!!


Apart from this if you need more clarity,  I have made a  tutorial video on this, please go through and share your comments. Like and share the knowledge



Post a Comment

2 Comments

  1. update puppet code file

    class ntpconfig{

    package{"ntp":
    ensure =>"present",}
    #NTP Service startup

    file{
    "/etc/ntp.conf":
    ensure => "present",
    content=>"server 0.centos.pool.ntp.org ibrust\n",
    }

    }

    node 'stapp01.stratos.xfusioncorp.com' {
    include ntpconfig
    }

    node will create as per task no need to run/restart ntp.
    your solution not working

    ReplyDelete
    Replies
    1. Thank you for commenting with solutions about updated puppet ntp task. Will update in git repo.

      Delete

Latest Posts

KodeKloud Kubernetes Security CKS  Lab Challenge 4 |  Audit-policy | Install & configure falco utility | Inspect the API server audit logs and identify the user