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.
CFEngine - set variable if a specific package version is installed
210 Views Asked by Greg At
2
You could use
packagesmatching
to get the version of httpd that's currently installed. You might combine it withifelse
,strcmp
,regcmp
so that you can set different variables and classes which you might use in your template.