On 17 Sep 2010, at 10:35 am, Davide Brini wrote: > I'm already doing that to determine if the package needs to be installed and > the package manager invoked. > > But I also have other things that depend upon the successful installation > (copying a custom config file, basically). Currently, the config file is > copied even if the package installation was unsuccessful, because it relies > on > a class being set only if the package manager was successful, but instead > it's > always set. > > I can however somewhat work around that using the same method: > > classes: > "ntpd_installed" expression => fileexists("/usr/sbin/ntpd"); > > packages: > !ntpd_installed:: > "ntpd" > package_method => yum, > package_policy => "add"; > > files: > ntpd_installed:: > "/etc/ntd.conf" > # copy the custom config file > > > However my understanding is that this would require two agent invocations to > get the intended configuration, the first would install the package, the > second would copy the config file.
Why have the config file depend on whether the package is installed? If the ntp.conf file is installed but the package is not, that's not a real problem, and it's still a convergence towards the desired state. In fact it's better - it's arguable you want the ntp.conf to be present *before* the package is installed, otherwise the first time the ntpd starts, it will be using the default config file supplied by the distro, which may not be what you want. Regards. Tim -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE. _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine