help-cfengine
[Top][All Lists]
Advanced

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

using editfiles in update and main contexts on same file


From: andy bezella
Subject: using editfiles in update and main contexts on same file
Date: Thu, 16 Dec 2004 12:19:14 -0600

hello -

i have been deploying cfengine 2.1.11 on a test group of solaris 8
servers, and have run into an issue that is stymying me.  in my
update.conf i have the following section to immediately add a line for
cfengine into /etc/inet/services:
editfiles:
  solaris::
     { /etc/inet/services
       AppendIfNoSuchLine "cfengine$(tab)5308/tcp"
     }

then in a file called from cfagent.conf i attempt to make another edit
of /etc/inet/services on a specific host:
editfiles:
  testhost1::
    { /etc/inet/services
      AppendIfNoSuchLine "DB2_db2iadm$(tab)60000/tcp"
      AppendIfNoSuchLine "DB2_db2iadm_1$(tab)60001/tcp"
      AppendIfNoSuchLine "DB2_db2iadm_2$(tab)60002/tcp"
      AppendIfNoSuchLine "DB2_db2iadm_END$(tab)60003/tcp"
      AppendIfNoSuchLine "db2cdb2inst1$(tab)50000/tcp"
    }

this modification of testhost1:/etc/inet/services does not take place.
running with --debug i see the following:
EDITFILE  /etc/inet/services (y)(r=0)
 Context scope: update
 IfElapsed=1, ExpireAfter=120
 AppendIfNoSuchLine [cfengine   5308/tcp] if (solaris)
 AppendIfNoSuchLine [DB2_db2iadm        60000/tcp] if (testhost1)
 AppendIfNoSuchLine [DB2_db2iadm_1      60001/tcp] if (testhost1)
 AppendIfNoSuchLine [DB2_db2iadm_2      60002/tcp] if (testhost1)
 AppendIfNoSuchLine [DB2_db2iadm_END    60003/tcp] if (testhost1)
 AppendIfNoSuchLine [db2cdb2inst1       50000/tcp] if (testhost1)

from my understanding of this it appears that since the context scope
for this edit is set to "update" it does not run once the context state
has changed to main.  is that working as designed?  should it be
possible to use editfiles on the same file in both contexts?  i suppose
there is no compelling reason to perform the update.conf edit, so i
could simply eliminate that if there are no other options available.

thanks in advance.

        andy





reply via email to

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