Skip to main content

Command Palette

Search for a command to run...

Puppet Install Multiple Packages

Updated
•2 min read•View as Markdown
Puppet Install Multiple Packages
S

DevOps enthusiast sharing real-world insights. 🚀 #Automation #CI/CD #InfrastructureAsCode

Task Requirements :

There are some packages that need to be installed on the (app server 1) in the datacenter. We want to install these packages using puppet only.

Create a puppet programming file blog.pp under /etc/puppetlabs/code/environments/production/manifests on master node and perform below mentioned tasks using the same.

  • Define a class multi_package_node for agent node 1 (App Server 1).

  • Install net-tools and unzip packages on the agent node 1.

  • Make sure to run puppet agent test to apply/test the changes manually.

  • Also, make sure to verify puppet server and puppet agent services are up and running on the respective servers.

SOLUTION :

  • Navigate to the Puppet manifests directory.

cd /etc/puppetlabs/code/environments/production/manifests

  • Create a new Puppet programming file called blog.pp, in the blog.pp file, define the class and specify the packages to be installed.

sudo vi blog.pp

sudo vi site.pp

  • In the "site.pp" file, assign the multi_package_node class to the agent node (App Server 1) by adding the following code:

node 'agent_node1.example.com' { include multi_package_node }

  • Replace 'agent_node1.example.com' with the actual hostname of your agent node (App Server 1).

  • Save and exit the file.

  • Trigger a Puppet run on the agent node (App Server 1) to apply the configuration changes.

    sudo puppet agent -t

More from this blog

DevOps Task Diaries

19 posts

Welcome to my DevOps documentation blog! I'm Samson Oladipo, and I'm passionate about sharing real-world DevOps scenarios, experiences, and best practices with the global tech community.

Join me on this DevOps journey as we explore the fascinating world of IT operations and software development, one task at a time. Whether you're a seasoned pro or just beginning your DevOps adventure, you'll find valuable insights and practical guidance to help you succeed in your own DevOps endeavors.