On 09/20/2012 11:31 AM, Bas van der Vlies wrote:
> Cfengine community: 3.3.2
> OS: debian wheezy
> 
> I have the following bundle:
> 
> bundle agent  sara_template_process(final_destination, owner, mode)
> {
>     vars:
> 
>         any::
>             "template_dir"  string => "/data/cfengine3/templates";
>             "filename" string => lastnode("$(final_destination)","/");
> 
>     files:
> 
>         any::
>             "$(g.node_status)/templates/$(filename)"
>                 comment     => "Copy template file",
>                 perms       => mo("400", "root"),
>                 copy_from   => 
> sara_hash_no_perms_cp("$(template_dir)/$(filename)", "$(g.policyserver)"),
>                 classes   => if_repaired( 
> canonify("template_copied_$(filename)") );
> 
>             "$(final_destination)"
>                 comment => "Expand the template",
>                 create => "true",
>                 edit_template => "$(g.node_status)/templates/$(filename)",
>                 edit_defaults => empty,
>                 perms => mo("$(mode)","$(owner)");
> }
> 
> The problem is the wrong class is set if a file is copied if we call this 
> bundle twice in a row:
> 
> bundle agent test
> {
> methods:
>             "resolv_conf" usebundle => 
> sara_template_process("/etc/resolv.conf", "root", "644");
>             "autofs_conf" usebundle => 
> sara_template_process("/etc/default/autofs", "root", "644");
> }
> 
> Here is the verbose output when autofs file is copied:
> {{{
> cf3>  -> Public key identity of host "192.168.144.50" is 
> "MD5=75df54ce6999a8b7ff35e65df498d383"
> cf3>  -> /etc/node_status/templates/autofs wasn't at destination (copying)
> cf3>  -> Copying from install2:/data/cfengine3/templates/autofs
> cf3>  -> Copy of regular file succeeded /data/cfengine3/templates/autofs to 
> /etc/node_status/templates/autofs.cfnew
> cf3>  -> Object /etc/node_status/templates/autofs had permission 600, changed 
> it to 400
> cf3>  ?> defining promise result class template_copied_resolv_conf
> cf3>  -> Updated file from install2:/data/cfengine3/templates/autofs
> cf3>  ?> defining promise result class template_copied_resolv_conf
> }}}
> 
> Note the class 'template_copied_resolv_conf' is set. It must be 
> 'template_copied_autofs'. Is this a bug or is there something wrong
> in my bundle?
> 
> 

Also tested with:
 cfengine community trunk version
 and newest cfengine_stdlib.cf

same problem



-- 
********************************************************************
*  Bas van der Vlies                    e-mail: b...@sara.nl       *
*  SARA - Academic Computing Services   Amsterdam, The Netherlands *
********************************************************************

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

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

Reply via email to