How do I set variable if a specific package version is installed in CFEngine

0 votes
A script needs to support two servers, Fedora and Centos, with different versions of httpd (Apache). CFEngine is used to create the configuration file and it needs to put different sections to the file depending on which httpd version is installed in the system. How can I set a variable to true/false depending on which version is installed so that I can then generate the file appropriately?

All the examples I could find only deal with installing, upgrading or removing packages.

Can anyone help me with this?

Thanks.
Jul 12, 2018 in Other DevOps Questions by Damon Salvatore
• 5,980 points
1,180 views

1 answer to this question.

0 votes

Here is what you can do.Just use packagesmatching to get the version of httpd that's currently installed. You might combine it with ifelsestrcmpregcmp so that you can set different variables and classes which you might use in your template.

I hope the above information will be helpful for you.

answered Jul 12, 2018 by Atul
• 10,240 points

Related Questions In Other DevOps Questions

0 votes
1 answer

How do I share Build Definitions across Projects in Visual Studio Online?

VSTS does not support sharing build definitions ...READ MORE

answered Jul 5, 2018 in Other DevOps Questions by DareDev
• 6,890 points
531 views
0 votes
1 answer

how do i make apache2 site point outside the folder in ubuntu?

in apche2 configuration file u have to ...READ MORE

answered Jul 6, 2018 in Other DevOps Questions by Kalgi
• 52,350 points
794 views
0 votes
1 answer
0 votes
2 answers
0 votes
1 answer
0 votes
1 answer

How do I preserve local ivy repository in Bluemix BUILD & DEPLOY?

You're right--the pipeline spins up a new ...READ MORE

answered Jul 17, 2018 in Other DevOps Questions by Atul
• 10,240 points
608 views
0 votes
1 answer

How do I manage stranded resources in Chef?

Try the follow the follow this procedure. ...READ MORE

answered Jul 24, 2018 in Other DevOps Questions by Atul
• 10,240 points
857 views
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