rameter01 parameter02
>
> I could probably do that with writing the parameter(s) into a file and
> than let cfengine read from that file. But is there something more
> comfortable ?
Why not using classes?
Just define classes on the command line and your cf policy will use
them.
Regard
Daniel Dehennin writes:
> Could this be considered a regression on bug 135[1] or is there a better
> way to do it?
Sorry, my fault, I forgot that classes in "bundle agent" are not
globals.
Here is my new results:
#v+ bin/cf-agent -K -I
R: Bundle agent test evaluated
R: Bu
Daniel Dehennin writes:
> Daniel Dehennin writes:
>
>> Aleksey Tsalolikhin writes:
>>
>>> I moved the classes promise higher, before the vars promise,
>>> (which is how it is evaluated anyway), but I get:
>>>
>>> Can't stat file &q
Daniel Dehennin writes:
> Aleksey Tsalolikhin writes:
>
>> I moved the classes promise higher, before the vars promise,
>> (which is how it is evaluated anyway), but I get:
>>
>> Can't stat file "./@(g.country)" for parsing
>
> I remember some
e
mailing-list[2].
Regards.
Footnotes:
[1] https://cfengine.com/bugtracker/view.php?id=135
[2] https://cfengine.org/pipermail/help-cfengine/2010-May/008577.html
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgpxtuZ89Wa1u.pgp
Daniel Dehennin writes:
> Hello,
>
> I'm trying to create an array with list expansion and wonder why there
> is no coordinated iteration.
>
> Here is my test case:
[...]
More tests:
#v+
body common control
{
bundlesequence => { "test" };
vers
Daniel Dehennin writes:
> Hello,
>
> I'm trying to create an array with list expansion and wonder why there
> is no coordinated iteration.
>
> Here is my test case:
>
[...]
> #v+
> bin/cf-agent -K -I
> !! Redefinition of a constant list "index"
o bundle 'test' in file
'/home/dad/.cfagent/inputs/promises.cf' near line 14
!! Redefinition of a constant list "index"
cf3> -- Was {'cf_null'}cf3> now {'test1'}cf3>
Promise (version 0.0.5) belongs to bundle 'test' in f
Footnotes:
[1] http://www.freesoft.org/CIE/RFC/822/36.htm
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgpL8rYFWjNQ1.pgp
Description: PGP signature
___
Help-cfengine mailing list
Help-cfengine@cfengin
tnotes:
[1] http://www.cfengine.org/manuals/cf3-tutorial.html#List-variables
[2]
http://www.cfengine.org/manuals/cf3-reference.html#List-variable-substitution-and-expansion
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgpDi3XQzJ6IP.pgp
Descript
tnotes:
[1] https://cfengine.org/pipermail/help-cfengine/2010-December/010922.html
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgpJfqzFDJW1s.pgp
Description: PGP signature
___
Help-cfengine mailing
Michael Potter writes:
> I believe you have to pass them as ., e.g.:
>
>edit_line => insert_array_lines("filetest.line")
Yes, I tried as a string but do not fully qualified it, thanks to you
and zzamboni.
Thanks.
--
Daniel Dehennin
Récupérer ma cle
$($(v)[$(idx)])";
}
body edit_defaults empty
{
empty_file_before_editing => "true";
edit_backup => "false";
max_file_size => "30";
}
#v-
Regards.
Footnotes:
[1] like in
http://blog.zzamboni.org/editing-sshd-configuration-files-w
Hello,
Thanks Mark[1], it works.
Footnotes:
[1]
http://source.cfengine.com/browse/core/trunk/src/files_editline.c?view=log&sortby=log&sortdir=down&pathrev=1590
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgp5SKBADc1mi.pgp
Desc
lue";
}
#v-
The only problem I found during my test is that, after the first test, I
had two lines in my /tmp/main.cf, a good one and a bad one.
The 'config_option_space_separated' body do not remove any
misconfigured lines, as the 'regline' matches one of the lines.
With the
t; "Delete missconfigured smtp_host";
insert_lines:
any::
"smtp_host $(smtp)",
classes => if_repaired("SMTPHostAdded"),
comment => "Add smtp_host if none";
}
body replace_with value(
Daniel Dehennin writes:
[...]
> The replace_patterns is always repaired:
[...]
Even a simple one like this:
#v+
cat /tmp/main.cf:
smtp_host smtp.example.net2
#v-
#v+
replace_patterns:
HasSMTPhost::
"^(smtp_host)\s+smtp\.example\.net$" replace_with =>
,
classes => if_repaired("SMTPHostFixed"),
comment => "Add smtp_host if none";
replace_patterns:
HasSMTPhost::
"^(smtp_host)\s+(?!$(smtp)$).*" replace_with => value("$(match.1)
$(smtp)"),
s/^(smtp_host)\s+(?!smtp.example.net$)$/$1 smtp.example.net/'
[4] echo "smtp_host smtp.example.netsmtp.example.net" | perl -pi -e
's/^(smtp_host)\s+(?!smtp.example.net)$/$1 smtp.example.net/'
[5] echo "smtp_host smtp.example.netsmtp.example.net" | perl -pi
he
definition of "NoSMTPHostReplaced" in my example:
#v+
body classes if_ok(notchanged, changed)
{
promise_kept => { "$(notchanged)" };
promise_repaired => { "$(changed)" };
}
#v-
Seems there is something[1] I did not understand.
Regards.
Footnotes:
[1] s
HasSMTPhost::
"^(smtp_host)\s+(?!$(smtp)$).*$" replace_with => value("$(match.1)
$(smtp)"),
classes => if_ok("NoSMTPHostReplaced", "SomeSMTPHostReplaced"),
comment => "Replace missconfigured smtp_
hanks, it looks like the match must be greedy.
With the normal ordering of edit_line, I finish to delete_lines that do
not match and then insert_lines.
Thanks.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgpFbjr5ft6gd.pgp
Description: PGP sign
ot;
cf3 Promise (version 0.0.3) belongs to bundle 'fix_smtp_host' in file
'/home/dad/.cfagent/inputs/promises.cf' near line 31
cf3 Comment: Replace smtp_host if any
#v-
The pattern to replace must not match the replacement string, I think
that if I use delete_lines/insert_l
nfo ;-)
Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgpnweroWlbBA.pgp
Description: PGP signature
___
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine
Hello,
I’m looking at the SVN cf3 repository and found the docs/ dircetory.
The cf3-References.info is not up to date, I wonder where is the online
reference manual source.
Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgplUXq8eNmPo.pgp
to the 'body contain'?
body contain rootshell {
useshell => "true";
umask => "077";
exec_owner => "root";
chdir => "/root";
}
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-
Daniel Dehennin writes:
> Hello,
Hello,
First huge thanks to Michael Potter who helped me open my eyes on this
issue.
> = promises.cf
> body common control
> {
> bundlesequence => { "test" };
> version => "0.0.1";
> }
>
d not happen
at every run.
Hope I can make my use case acceptable, I could put everything in LDAP
or any database, but I like text files, diff and distributed version
control systems ;-)
Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
ee what variables
must I declare to configure this particular service if I don't remenber.
Are my intentions clearer?
Do they look insane?
Regards.
Footnotes:
[1] Like DNS, Nagios, cacti
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
ot; expression => "any";
reports:
ok::
"$($(sys.host)_ip)";
}
=
This results in
= /usr/sbin/cf-agent -K -I
R: $(hati_ip)
=
Thanks.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgpd4jMVW
reports:
ok::
"X1: $(x1)";
"X2: $(x2)";
"X3: $(x3)";
}
=
The output is:
= /usr/sbin/cf-agent -K -I
R: X2: /tmp
R: X2: /var/tmp
R: X2: /usr/tmp
R: X4: bar
=
Regards.
Footnotes:
[1] http://bugs.debian.org/
strange behaviour but it can be a debian
specific one.
Regards.
Footnotes:
[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=585619
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgpbogVWR1UmM.pgp
Description: PGP signature
_
> R: outer: too
> R: inner: this is an array element
> R: inner: $(outer.arr[idx2])
Hello,
Exactly the same with debian 3.0.5.
Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgpPloFE
ines were generated by promiser "/bin/echo key3
$(array[key3])"
I: Made in version '0.0.2' of '/home/dad/.cfagent/inputs/promises.cf' near line
23
--8<---cut here---end--->8---
I found no example, in tutorial, reference m
test"
!! Redefinition of variable "list" (embedded list in RHS) in context "test"
!! Redefinition of variable "list" (embedded list in RHS) in context "test"
Q: ".../bin/echo $(dir": $(dirs)/$(files)
I: Last 1 QUOTEed lines were generated by promiser "/bin/echo $(dirs)/$(files)"
I: Made in version '0.0.2' of '/home/dad/.cfagent/inputs/promises.cf' near line
21
Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgpuaLfihVsnd.pgp
Description: PGP signature
___
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine
*list => {}' construct could be seen as: promise to
have elements listed in '{}' in the list named 'name'.
My point is:
- a list construct define a list variable if it's not already defined
- then add the listed elements if they are not presents
Maybe an 'a
t;0", @(l1), @(l2)},
policy => "ifdefined";
I'll look at this after diner.
Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgpvmC6dbMzIR.pgp
Description: PGP signature
ho @(l1)": @(l1)
Q: ".../bin/echo @(l2)": @(l2)
when "cf-agent -KI -DClass1" gives:
Q: ".../bin/echo 0": 0
Q: ".../bin/echo 1": 1
Q: ".../bin/echo 2": 2
Q: ".../bin/echo @(l2)": @(l2)
Is there a way to discard undefined variab
mega...@gmail.com writes:
> It turns out a simple "grep -v grep" at the end of the shell command
> did the trick:
>
> "myarray[$(mykeys)]" string => execresult("/usr/bin/ps -f | grep
> $(mylist[$(mykeys)]) | grep -v grep","useshell");
Th
ore team, obviously, needs to define something like:
- bundlesequence => {"update", "main", @(services.bundles);
- inputs => {"update.cf", "main.cf", "library.cf", "services/main.cf",
@(services.inputs)};
This works, but seems more
puts" slist => { "test2.cf" };
}
bundle agent test
{
reports:
debian::
"In test";
}
## test2.cf
bundle common test2
{
vars:
any::
"bundles" slist => { "test2" };
}
bundle agent test2
omised.
I'm trying to understand the code to provide a patch to do the same with
inputs but fail for now.
The only difference I see for now is that inputs appears in cf3parse.y and not
bundlesequence...
Any hint to guide me a little?
Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyse
orward to know what, where and how to do it.
Hope this clarify my intentions.
Thanks.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgp4taXpR7D0k.pgp
Description: PGP signature
___
Help-cfengine
promise to load everything under services/ (class
based) and the "sub promises" do what they needs, including adding bundles
to bundlesequence and files to inputs.
I use this with cf2 and its import, maybe this hierarchical management
is the wrong way?
Regards.
--
Daniel Dehennin
Récu
27;m
looking crazy ;-)
Another idea, instead of chaining the bundlesequence and inputs of the
callee in the caller, using common bundles to add some.
bundle common test
{
bundlesequence => { "test" };
inputs => {"test2.cf" };
}
Does it sound crazy (again) that a bundle
2
{
vars:
any::
"bundles" slist => { "test2" };
"inputs" slist => {};
}
bundle agent test2
{
reports:
debian::
"In test2";
}
Is this a bug ?
Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp
find no import in cf3 reference manual.
What's the way to include files based on classes?
Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
pgpabLxyj1uSY.pgp
Description: PGP signature
___
He
ress]" string => "10.2.3.5";
"Zone[vpn][srv3][ipaddress]" string => "10.2.6.7";
"Zone[vpn][srv4][ipaddress]" string => "10.2.6.8";
--8<---cut here---end--->8---
I want to get the IP add
>
> e.g. getindexlist("Hosts","2")
>
> to extract a list of the second index?
vars:
"Zone[dmz][srv1]" string => "10.2.3.4";
"Zone[dmz][srv2]" string => "10.2.3.5";
"Zone[vpn][srv3]" string => &q
replacement[is] string => "222";
"replacement[test] string => "333";
"patterns" slist => getindices("replacement");
}
--8<---cut here---end--->8---
I hope it will help you.
Regards.
--
Daniel Dehennin
R
3.4";
"Hosts[server2][ipaddress]" string => "10.2.3.5";
--8<---cut here---end--->8---
Then doing a getindices("Hosts[server1]").
Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu -
ts and look into the peer-to-peer functionality of features
> like the remotescalar() special function:
>
> http://www.cfengine.org/manuals/cf3-reference.html#Function-remotescalar
Look interesting, I have not finished the reference manual yet.
Regards.
--
Daniel Dehennin
Récupérer ma clef GPG:
webapp::
"IpAddress" string => "10.4.5.6";
webapp.appli::
"UrlPath" string => "/path/to/appli";
}
--8<---cut here---end--->8---
Now I need to edit a file on revproxy and insert the IpAddress
53 matches
Mail list logo