help-cfengine
[Top][All Lists]
Advanced

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

Confusion with Variables and Groups


From: Erik Williamson
Subject: Confusion with Variables and Groups
Date: Fri, 09 Jul 2004 11:14:46 -0600
User-agent: Mozilla Thunderbird 0.7 (X11/20040615)

Hi All,

I've got two classes defined: Com1ConsoleServers & Com2ConsoleServers, with ConsoleServers being an amalgamation of the two.

In my editfiles section, I currently have a section for each, even though there's very few differences between the two. I'd like to tidy this up; Is there a way to define variables based on which of the above classes a machine is in? This way, instead of this:

editfiles:
  Com1ConsoleServers::
    <do stuff>

  Com2ConsoleServers::
    <do remarkably similar stuff>

I could do this:

editfiles:
  Com1ConsoleServers::
    <do stuff with $(ComPort) >
    <do more stuff with $(ComPort) >

So, as a test case, I tried this (only the important stuff shown):
control:
  TestClassTest::
    BigTestVariable = ( "Wooooo" )

groups:
   TestClassTest = ( testhost )

shellcommands:
  TestClassTest::
    "/bin/echo $(BigTestVariable)"

I didn't expect this to work, and it didn't (got a ) - alas, is there a way to accomplish this?

Thanks!
Erik.

--
e r i k   w i l l i a m s o n                     erik@cpsc.ucalgary.ca
 system admin . department of computer science . university of calgary





reply via email to

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