1

Using Puppet...

I had a situation with NTP whereby I wanted to install ntpd if NTP was not installed, but only if neither openntp nor ntpd were installed. (I solved this by using the Alexandrian Solution: I got rid of openntp...)

This goes beyond ensure => absent and ensure => present; how would you go about setting this up? What about the dependencies?

Thinking about this, it would mean that NTPd is only installed if OpenNTP is missing. But then this does not mean that (in context) that OpenNTPd must be missing... Would the audit option be appropriate here?

1 Answer 1

2

You can create a fact that returns whether OpenNTP is installed or not, and use that to control the result. Though, to be honest, I'd also just remove one of them -- why keep two versions of the stuff if you can easily choose one? Sometimes there are reasons, but, then, you'd make your rules based on these reasons, not based on the actual presence of the package.

2
  • That's what I decided on doing. The initial thinking was I didn't want to change what was already being used. Creating a new fact seems to be overkill; isn't there some straightforward way to do it in a manifest?
    – Mei
    May 24, 2011 at 15:14
  • @David No, there isn't. If you want information from the host, you need facts. I, too, used to think creating facts was overkill, but they are really very easy to create -- particularly if it's just a matter of running some command and getting its output. May 24, 2011 at 17:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .