[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
method to check for package installation
From: |
Graham Allan |
Subject: |
method to check for package installation |
Date: |
Tue, 27 Apr 2004 19:38:05 -0500 |
User-agent: |
Mutt/1.4.2.1i |
I'm trying to write a method file to check if a particular RPM package
is installed, and if not, install it.
So far I've completely failed to make cfengine check whether a package
is installed, when the package name is held in a variable.
Attempts 1 and 2 were to define a class.
classes:
package_installed = ( '/bin/rpm -q ${packagename}' )
and...
classes:
package_installed = ( ReturnsZero(/bin/rpm -q ${packagename}) )
Attempt 3 was use use the "packages" action.
packages:
any::
$(packagename) pkgmgr=rpm define=package_installed
In every case, the cfengine output shows that rpm is being called to
check for a literal "${packagename}" package - the variable is not
getting substituted. The same commands work fine when they contain the
literal package name.
Is there any way I've missed that might make this work?
G.
--
-------------------------------------------------------------------------
Graham Allan
School of Physics and Astronomy - University of Minnesota
-------------------------------------------------------------------------
- method to check for package installation,
Graham Allan <=
Re: method to check for package installation, Mark . Burgess, 2004/04/28
Re: method to check for package installation, Christian Pearce, 2004/04/28