[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Cfagent 'module-mode' suggestion
From: |
Tim Nelson |
Subject: |
Re: Cfagent 'module-mode' suggestion |
Date: |
Tue, 11 Oct 2005 11:43:51 +1000 (EST) |
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
:)
--
Kind Regards,
Tim Nelson
Server Administrator
P: 03 9934 0888
F: 03 9934 0899
E: tim.nelson@webalive.biz
W: www.webalive.biz
WebAlive Technologies
Level 1, Innovation Building
Digital Harbour
1010 La Trobe Street
Docklands Melbourne VIC 3008
This email (including all attachments) is intended solely for the named
addressee. It is confidential and may contain legally privileged information. If
you receive it in error, please let us know by reply email, delete it from your
system and destroy any copies. This email is also subject to copyright. No
part of it should be reproduced, adapted or transmitted without the written
consent of the copyright owner.
Emails may be interfered with, may contain computer viruses or other defects
and may not be successfully replicated on other systems. We give no
warranties in relation to these matters. If you have any doubts about the
authenticity of an email purportedly sent by us, please contact us immediately.