help-cfengine
[Top][All Lists]
Advanced

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

Re: strange BeginGroupIfNoLineMatching/InsertFile behaviour


From: Atom Powers
Subject: Re: strange BeginGroupIfNoLineMatching/InsertFile behaviour
Date: Fri, 3 Mar 2006 08:21:00 -0800

I had a possibly similar problem where it wouldn't let me use
"InsertFile" and the simple "Append" actions in the same block.

But these work for me:
--
        { #make.conf
        /etc/make.conf
        AutoCreate
        EmptyEntireFilePlease
        InsertFile "${FileSource}/common/templates/make.conf"
        AppendIfNoSuchLine "PERL_VER=${PerlVer}"
        AppendIfNoSuchLine "PERL_VERSION=${PerlVer}"
        }

        { # SNMP config
        /usr/local/etc/snmp/snmpd.conf
        AutoCreate
        EmptyEntireFilePlease
        InsertFile "${FileSource}/common/templates/snmpd.conf"
        BeginGroupIfNoLineContaining "syscontact ${sysadm}"
                DeleteLinesContaining "syscontact"
                Append "syscontact ${sysadm}"
        EndGroup
        DefineClasses "newsnmpd"
        }


On 2/28/06, John van Zantvoort <snl.jydawg@gmail.com> wrote:
> Hi guys,
>
>  I've got a configfile that has some dynamic parameters which I edit through
> cfengine, the file involves
>  monitorring parameters that can differ per system, patch level, management
> dispostion, etc.:
>    e.g. not all directories are mounted on the same disk and not all
> directories are mountpoints.
>  Our approach is to keep the parameters as generic as possible and changing
> the input on the
>  system side.
>
>  My question:
>
>  Why does this work:
>      { /etc/nagios/nrpe.cfg
>        AutoCreate
>
>        BeginGroupIfNoLineMatching "##### BEGIN $(EditHeader) $(CVSRev) ####"
>          Append "##### BEGIN $(EditHeader) $(CVSRev) ####"
>          ForEachLineIn
> '/path/to/diskmonitoring/parameters/created/by/a/module'
>            AppendIfNoLineMatching "ThisLine"
>          EndLoop
>
>          Append "# HTTPD"
>          Append
> "command[check_proc_httpd_root]=/usr/lib/nagios/plugins/check_procs
> -C httpd -u root -w 1:1 -c 1:1"
>          Append
> "command[check_proc_httpd_child]=/usr/lib/nagios/plugins/check_procs
> -C httpd -u apache -w 8:50 -c 5:150"
>          # ... more "neat" parameters ....
>
>          Append "##### END $(EditHeader) $(CVSRev)"
>        EndGroup
>      }
>
> And this doesn't:
>      { /etc/nagios/nrpe.cfg
>        AutoCreate
>
>        BeginGroupIfNoLineMatching "##### BEGIN $(EditHeader) $(CVSRev) ####"
>          Append "##### BEGIN $(EditHeader) $(CVSRev) ####"
>          InserFile
> '/path/to/diskmonitoring/parameters/created/by/a/module'
>
>          Append "# HTTPD"
>          Append
> "command[check_proc_httpd_root]=/usr/lib/nagios/plugins/check_procs
> -C httpd -u root -w 1:1 -c 1:1"
>          Append
> "command[check_proc_httpd_child]=/usr/lib/nagios/plugins/check_procs
> -C httpd -u apache -w 8:50 -c 5:150"
>          # ... more "neat" parameters ....
>
>          Append "##### END $(EditHeader) $(CVSRev)"
>        EndGroup
>      }
>
> --
> Met vriendelijke groeten/with kind regards
>
>         John van Zantvoort
>
> ---
>
> Paranoia is simply an optimistic outlook on life.
>
> GCM d- s+:+ a- C+ UL+++ P+++ L++ E--- W++ N+ o K-
> w-- O- M- V- PS+ PE- Y+ PGP+ t+ 5 X- R- tv b+ DI++
> D+ G e h- r++ y+
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-cfengine
>
>
>


--
--
Perfection is just a word I use occasionally with mustard.
--Atom Powers--




reply via email to

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