help-cfengine
[Top][All Lists]
Advanced

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

dealing with multiple domains


From: Luke A. Kanies
Subject: dealing with multiple domains
Date: Mon, 10 Feb 2003 14:47:03 -0600 (CST)

Hi all,

How are people dealing with multiple domains in cfengine?  I obviously
can't just set it in the file, since it changes per-host, and I definitely
don't want to have to configure lists in cfengine as to which machine is
in which domain; I've already got that information stored on the machine,
so I want cfengine to discover it.

I didn't realize it, but I have not set the domain names up on all my
systems except in /etc/resolv.conf, so I can't just call /bin/domainname.
I figured I could pretty easily just call 'domainname', see if it's set,
and if not, pull the domain out of /etc/resolv.conf and set everything up
appropriately:

control:

   Access               = ( root )     # Only root should run this

   tmpdomain            = ( ExecResult(/bin/domainname) )

groups:
   domainset            = ( IsDefined(tmpdomain) )

control:
   actionsequence = ( shellcommands.echodomain )
   !domainset::
      actionsequence = ( shellcommands.setdomain )

shellcommands:
   echodomain::
      "/bin/echo [$$] --${tmpdomain}--"
   setdomain::
      "/usr/local/scripts/setdomain"

# okay, everything back to normal...
# all that, just to figure out which domain we're in
control:
   domain               = ( ${tmpdomain} )


Except this doesn't work.  'domainset' always gets defined, no matter what
I do, apparently, and the shellcommand to echo the domain doesn't actually
echo anything; in fact, the line echoed ends after the first two '-'
characters; I should get '----' but I get '--'.

Does anyone else use multiple domains?  How?  I really want cfengine to
just be able to discover which domain my hosts are in, rather than me
having to set it, but it seems to be quite difficult.

Thanks,
Luke

-- 
Automatic door locks are good for...
  a.  security
  b.  convenience
  c.  messing with the heads of people trying to get in




reply via email to

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