How to install a package if it is not installed using puppet conditions

0 votes
I need to install java in a pupper agent, where i need to use conditions if java is already installed or not in that server. If it is not installed, that has to be installed. Can you please help in this
Mar 18, 2020 in Puppet by Edureka
• 120 points
1,742 views

1 answer to this question.

+1 vote
You will need to write a puppet manifest that will check for these custom facts that you require ( whether java is installed or not). If java is installed, you need to specify it to install java on the agent depending on the underlying OS that you are using.

When you run puppet agent -t the agent node will pull these custom facts that are required and then depending on whether java is installed or not it will do the further required things.
answered Mar 18, 2020 by Sirajul
• 59,230 points
Hi,

Thanks for your response. Can you pls give me an example, since i am a beginner.

Hey, since you are a beginner, I suggest you to have a look at this blog https://www.edureka.co/blog/puppet-modules-automation/ 

This will help you to write your own custom code snippet,

Related Questions In Puppet

0 votes
1 answer

Is it possible to install puppet agent in a docker container on linux?

Hey @Janice, this is pretty simple. Create ...READ MORE

answered Mar 12, 2019 in Puppet by Jason
1,328 views
0 votes
1 answer

How to install a package in the slave node with Puppet ?

Hi@akhtar, You need to add your node definition ...READ MORE

answered Dec 31, 2020 in Puppet by MD
• 95,440 points
1,046 views
0 votes
1 answer

Puppet+Docker: How do i configure a swarm if i am using windows server 2016.

There are a few considerations to be ...READ MORE

answered Aug 16, 2019 in Puppet by Sirajul
• 59,230 points
590 views
0 votes
1 answer

Puppet+Kubernetes: Is there a way to create resources in Kubernetes using Puppet?

Yes, it is quite possible to create ...READ MORE

answered Aug 23, 2019 in Puppet by Sirajul
• 59,230 points
690 views
+5 votes
2 answers

How To Deploy Windows Server Using Puppet?

Deploying windows server through Puppet is similar ...READ MORE

answered Mar 27, 2018 in Puppet by shubham
• 7,340 points
1,556 views
0 votes
1 answer

Puppet not recieving hiera data

Puppet does not consider the variables defined ...READ MORE

answered May 7, 2018 in Other DevOps Questions by ajs3033
• 7,300 points
2,085 views
0 votes
1 answer
+3 votes
4 answers

Chef vs puppet

Both chef and puppet have their own ...READ MORE

answered Aug 14, 2018 in Chef by Sahil
998 views
0 votes
0 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP