help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem using packages: or NOT operator?


From: Phil D'Amore
Subject: Re: Problem using packages: or NOT operator?
Date: Thu, 29 Apr 2004 19:30:45 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030314

Villalovos, John L wrote:

John Villalovos wrote:
I started trying to use the packages command.  So I did the following:

Does NOT work.  Using the Logical NOT operator and define=:
----------------------------- packages:
   redhat::
       vim-enhanced define=hasVimEnhanced

shellcommands:
# Install vim-enhanced if it is not already installed. !hasVimEnhanced:: "/usr/sbin/up2date vim-enhanced"



But this did work using elsedefine= and not using the logical NOT
operator: -----------------------------------
packages:
   redhat::
       vim-enhanced elsedefine=needVimEnhanced

shellcommands:
# Install vim-enhanced if it is not already installed. needVimEnhanced:: "/usr/sbin/up2date vim-enhanced"

Well after playing with it some more it seems likes packages: is not
working for me :(

I changed the one that was working to be the package "vim-enhanced2"
(which does NOT exist).  It still ran and did not define the
needVimEnhanced class.

These two functions NEVER get called.  I would think they should get
called but they don't.

CheckPackages()
RPMPackageCheck()

You are likely not setting a package manager. packages: requires a package manager to be set, even though the only one that works right now is rpm. you can either do this:

vim-enhanced  pkgmgr=rpm elsedefine=vimEnhanced

or

control:
   DefaultPkgMgr = ( rpm )

which will set it for all of your checks. Cfengine does not error out if this is not specified but it should print a message to warn you if you run with -d 1. Sorry if this was unintuitive, it seemed like the Right Thing (tm) to do at the time.

--
Phil D'Amore                             "Sometimes there is a fine line
Senior System Administrator               between criminally abusive
Red Hat, Inc                              behavior and fun."
Office: 919.754.3700 x44395                 -- Ted the Generic Guy
Pager: 877.383.8795                            (Dilbert 4/19/2003)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]