help-cfengine
[Top][All Lists]
Advanced

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

Re: Overriding predefined variables?


From: Mark . Burgess
Subject: Re: Overriding predefined variables?
Date: Sun, 11 Nov 2001 16:45:48 +0100 (MET)

On 11 Nov, Marlys Nelson wrote:
> I'm trying to setup a server installation method whereby the server is
> initially installed, configured and tested on a restricted area of our
> network.  Then, when everything seems ok, it's moved into production on a
> different ip and hostname.
> 
> My problem is that when cfengine runs (I'm using v1.6.3), it defines various
> classes and variables based on the current hostname and ipaddress.  I'd like
> to substitute the eventual real server hostname, fqdn and ipaddress.  I tried
> defining my own variables with the same name:
> 
> control:
>   host = ( "exec /bin/cat /some/where/the/real/hostname/is/stored" )
>   ipaddress = ( "192.168.1.1" )
> 
> But this didn't work.
> 
> Right now, I'm using the command line --define to set a class for the real
> server hostname but that only gets me part of the way to where I want to be. 
> Is there anyway to override what cfengine determines is the hostname, fqdn,
> ipaddress, etc?
> 
> Also, I tried writing a module that defined the real server hostname as a
> class but this didn't seem to work unless I listed that name as a class when I
> defined the module (ex. actionsequence = ( module:sethost.host1 ...)).  Since
> the number of hostnames that could be defined this way is large, and having to
> edit this just to add another host is a hassle, I'm wondering if there's any
> other way to do this.
> 
> I would guess it's somewhat common practice to setup servers in a
> restricted/secure area.  How do others handle this with cfengine to avoid
> hostname, ipaddress conflicts?
> 

Just quickly...

First of all, class definitions are made in "classes" or "groups" section,
not in "control". 

If you want to prevent cfengine from detecting the envionrment for testing
purposes, use 

cfengine --no-hard-classes

and set them manually, e.g. with -Dclassname or in groups/classes section.

Hope this helps,

Mark

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  Mark.Burgess@iu.hio.no
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





reply via email to

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