Forum: Cfengine Help
Subject: Re: Seperating copy_from and permission promise
Author: neilhwatson
Link to topic: https://cfengine.com/forum/read.php?3,16834,16910#msg-16910
What command option did you use? I don't see any reports output? I think you
are focusing too much on verbose output and not looking at what is actually
happening.
I see the results I would expect.
$ ../bin/cf-agent -V
This comprises cf-agent core community version 3.0.4 - (C) Cfengine AS 2008-
$ ../bin/cf-agent -IKf ./test.cf
-> Copying from localhost:/home/nwatson/.cfagent/inputs/test.cf
R: promised repaired
R: promise kept
$ ../bin/cf-agent -IKf ./test.cf
R: promise kept
$ ../bin/cf-agent -IKf ./test.cf
R: promise kept
$ ~/cfengine/bin/cf-agent -V
This comprises cf-agent core community version 3.0.4p2 - Copyright (C) Cfengine
AS 2008-
$ ~/cfengine/bin/cf-agent -IKf ./test.cf
R: promise kept
$ rm /tmp/test.cf
$ ~/cfengine/bin/cf-agent -IKf ./test.cf
-> Copying from localhost:/home/nwatson/.cfagent/inputs/test.cf
R: promised repaired
R: promise kept
$ ~/cfengine/bin/cf-agent -IKf ./test.cf
R: promise kept
I used this config since yours was not quite stand along.
#########################################################
# isolated copy
body common control
{
bundlesequence => {test};
}
bundle agent test
{
files:
"/tmp/test.cf"
copy_from => cc("/home/nwatson/.cfagent/inputs/test.cf"),
classes => if_else("repaired","notrepaired");
reports:
repaired::
"promised repaired";
notrepaired::
"promise kept";
}
body classes if_else(yes,no)
{
promise_kept => { "$(no)" };
promise_repaired => { "$(yes)" };
repair_failed => { "$(no)" };
repair_denied => { "$(no)" };
repair_timeout => { "$(no)" };
}
body copy_from cc(from)
{
source => "$(from)";
servers => { "localhost" } ;
compare => "digest";
# preserve => "false";
}
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine