Question : Some new changes need to be made on some of the app servers in Stratos Datacenter. There are some packages that need to be installed on the app server 1. We want to install these packages using puppet only.
Puppet master is already installed on Jump Server.
Create a puppet programming file ecommerce.pp under /etc/puppetlabs/code/environments/production/manifests on master node i.e on Jump Server and perform below mentioned tasks using the same.
Define a class multi_package_node for agent node 1 i.e app server 1. Install net-tools and unzip packages on the agent node 1.
Notes: :- Please make sure to run the puppet agent test using sudo on agent nodes, otherwise you can face certificate issues. In that case you will have to clean the certificates first and then you will be able to run the puppet agent test.
:- Before clicking on the Check button please make sure to verify puppet server and puppet agent services are up and running on the respective servers, also please make sure to run puppet agent test to apply/test the changes manually first.
:- Please note that once lab is loaded, the puppet server service should start automatically on the puppet master server, however it can take upto 2-3 minutes to start.
Please Note:- Perform the below commands based on your question server, user name & other details that might differ. So please read the task carefully before executing it.
All the Best 👍
root@jump_host /# cd /etc/puppetlabs/code/environments/production/manifests/ root@jump_host /etc/puppetlabs/code/environments/production/manifests# ll total 0 root@jump_host /etc/puppetlabs/code/environments/production/manifests# vi ecommerce.pp root@jump_host /etc/puppetlabs/code/environments/production/manifests# cat ecommerce.pp class
multi_package_node { $multi_package
= [ 'net-tools', 'unzip'] package { $multi_package: ensure =>
'installed' } }
node
'stapp01.stratos.xfusioncorp.com' { include multi_package_node
root@jump_host /etc/puppetlabs/code/environments/production/manifests# |
2. Login on all App server (stapp01, ) & switch to root user
root@jump_host /# ssh tony@stapp01 The authenticity of host 'stapp01 (172.16.238.10)' can't be established. ECDSA key fingerprint is SHA256:w9cDRojDoclOxdu1W23Ns2HPyANPrDzhk9VfqtTDoJQ. ECDSA key fingerprint is MD5:a8:3b:55:35:c2:5c:56:76:c8:d0:78:13:7a:4d:8b:e1. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'stapp01,172.16.238.10' (ECDSA) to the list of known hosts. tony@stapp01's password: [tony@stapp01 ~]$ 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 tony: [root@stapp01 ~]# |
3. Run Puppet agent to pull the configuration from puppet server
[root@stapp01 ~]# puppet agen -tv Info: Using configured environment 'production' Info: Retrieving pluginfacts Info: Retrieving plugin Info: Retrieving locales Info: Caching catalog for stapp01.stratos.xfusioncorp.com Info: Notice: Notice: /Stage[main]/Multi_package_node/Package[unzip]/ensure: created Notice: Applied catalog in 12.56 seconds [root@stapp01 ~]# |
4. Validate the task by running
[root@stapp01 ~]# rpm -qa |grep -e net-tools -e unzip unzip-6.0-22.el7_9.x86_64 net-tools-2.0-0.25.20131004git.el7.x86_64 [root@stapp01 ~]# |
Happy Learning!!!!
0 Comments