help-cfengine
[Top][All Lists]
Advanced

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

Setting variables based on classes in an imported file


From: Josh Smith
Subject: Setting variables based on classes in an imported file
Date: Thu, 16 Mar 2006 18:21:01 -0500

I'm trying to split my class definitions into a cfgroups.conf file, so
that my update.conf, cfagent.conf, and cfservd.conf files can all use the
same class definitions (by importing cfgroups.conf). Here are the
stripped-down essentials of what I have (and what's not working). 
update.conf has:

  import:
    any::
      cfgroups.conf

  control:
    any::
      AddInstallable = ( corp prod )
    corp::
      site = ( "needham" )
    prod::
      site = ( "watertown" )

  copy:
    any::
      /var/cfengine/mf/$(site)
        dest=/etc/site

cfgroups.conf has:

  groups:

    corp = ( machine1 )

    prod = ( machine1
             machine2
             machine3 )

When I try this configuration, cfagent throws an error:

  +$ sudo cfagent -q
  cf:cfengine::/var/cfengine/inputs/update.conf:106: faculty/site undefined 
variable 
  cf:cfengine::/var/cfengine/inputs/update.conf:106: faculty/site undefined 
variable 
  cfengine::/var/cfengine/inputs/cfgroups.conf:Execution terminated after 
parsing due to errors in program

I'm not sure what the "faculty" business is about, as that doesn't appear
anywhere in any of my config files, but my interpretation is that cfagent
isn't parsing the variable definitions because the classes aren't defined,
despite my use of AddInstallable.

Is this in fact the right explanation? If so, is it the expected behavior? 
If so, is there any way to do what I'm trying to do here? My fallback is
to give up on importing cfgroups.conf, put the class definitions in
cfagent.conf, and make cfservd.conf and update.conf not use any
class-based logic.

                                      -Josh (josh@upromise.com)




reply via email to

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