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 17 in Puppet by Edureka
• 120 points
89 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 by Sirajul
• 54,260 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
410 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
• 54,260 points
95 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
• 54,260 points
96 views
0 votes
1 answer

Puppet: How to install a module from a release tarball?

To install a module from a release ...READ MORE

answered Aug 26, 2019 in Puppet by anonymous
182 views
+5 votes
2 answers

How To Deploy Windows Server Using Puppet?

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

answered Mar 26, 2018 in Puppet by shubham
• 6,910 points
549 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,280 points
739 views
+3 votes
4 answers

Chef vs puppet

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

answered Aug 13, 2018 in Chef by Sahil
321 views
0 votes
0 answers