help-cfengine
[Top][All Lists]
Advanced

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

Re: Cfagent 'module-mode' suggestion


From: Mark Burgess
Subject: Re: Cfagent 'module-mode' suggestion
Date: Tue, 11 Oct 2005 09:57:47 +0200

Cfengine does write a summary of its classes to a file at every
iteration.

/var/cfengine/state/alclasses

M

On Tue, 2005-10-11 at 11:43 +1000, Tim Nelson wrote:
> On Mon, 10 Oct 2005, Martin, Jason H wrote:
> 
> > I was thinking that it would be handy of cfengine had a 'module-mode'
> > whereby it would emit all of the true classes and macro definitions in
> > the same manner as a module. Particularly, it could be called as a
> > sub-feature of --parse.
> >
> > The idea would be that I have some other scripts that could query
> > cfengine for information about the host so as to not have to reimplement
> > the same checks, or to gather system information that has been encoded
> > as cfengine class definitions.
> >
> > It would also be nice if this output could optionally be directed to a
> > file.
> 
>       I've been thinking something similar, and I came up with a 
> solution which I haven't implemented yet.
> 
> 1.    Every time you run cfengine, have it run a script that's something
>       like the (untested) following, and pass in the all classes
>       variable on the command line
> --------------------
> #!/usr/bin/perl
> 
> ($_) = @ARGV;
> 
> s/^CFALLCLASSES=\:*(.*?)\:*$/$1/;
> 
> @classes = sort split /:/;
> 
> putfile "/etc/cfengineclasses", join("\n", @classes);
> --------------------
>       (yes, you'll need to write putfile, but it's easy).
> 
> 2.    You can now run cfengine in classes mode.  You invoke it from the
>       command line thusly:
>       cat /etc/cfengineclasses
> 
>       :)
> 
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://lists.gnu.org/mailman/listinfo/help-cfengine





reply via email to

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