Hi Nick,

You are missing the files_single_copy attribute:

body agent control

{
# Single copy for all files
files_single_copy => {  ".*" };
}

--Diego


On Apr 16, 2012, at 9:17 PM, Nick Anderson wrote:

> Am I missing something obvious here? It seems like if I try to do a
> hierarchical copy and use digest it wont stop after copying the first file.
> 
> cf-agent -KIf ./test_single_copy_local.cf
> -> Created file /tmp/test/test.1, mode = 600
> -> Edited file /tmp/test/test.1
> -> Created file /tmp/test/test, mode = 600
> -> Edited file /tmp/test/test
> -> Copying from localhost:/tmp/test/test.1
> -> Updated /tmp/testfile from source /tmp/test/test on localhost
> 
> See the last two lines are a copy and update. And a subsequent run gives
> 
> -> Updated /tmp/testfile from source /tmp/test/test.1 on localhost
> -> Updated /tmp/testfile from source /tmp/test/test on localhost
> 
> If I replace local_dcp with local_cp I get results that I expect.
> 
> -> Created file /tmp/test/test.1, mode = 600
> -> Edited file /tmp/test/test.1
> -> Created file /tmp/test/test, mode = 600
> -> Edited file /tmp/test/test
> -> Copying from localhost:/tmp/test/test.1
> 
> Here is the policy I was testing this with.
> 
> body common control {
> 
>    bundlesequence  => {
>                        "init",
>                        "main",
>                        };
> 
>    inputs          => {
>                        "cfengine_stdlib.cf",
>                        };
> }
> 
> bundle agent init{
>    files:
>        "/tmp/test/test.1"
>            edit_line => append_if_no_line("1"),
>            create => "true",
>            edit_defaults => empty,
>            comment       => "Initalize source testfile 1";
> 
>        "/tmp/test/test"
>            edit_line => append_if_no_line("default"),
>            create => "true",
>            edit_defaults => empty,
>            comment       => "Initalize source default";
> }
> 
> bundle agent main {
>    vars:
>        "suffixes" slist => { ".1", "" };
> 
>    files:
>        "/tmp/testfile"
>            copy_from => local_dcp("/tmp/test/test$(suffixes)");
> 
> }
> 
> -- 
> Nick Anderson <n...@cmdln.org>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to