Forum: Cfengine Help
Subject: Re: need a working example of how to use "transformer" without 
$(this.promiser)
Author: mark
Link to topic: https://cfengine.com/forum/read.php?3,21955,21958#msg-21958

Gents, you misunderstand the intention of the transformer. 

The contents of your "cat passwd" command will not end up in the file -- they 
are dumped as the output of any script is not considered interesting.

Printing a file is not a transformation, but an unrelated command.

Commands that are transformations are things like gzip $(this.promiser),  
/bin/cp file1 file2, etc. Cfengine does not support use of a shell in these 
commands either, as this is potentially dangerous securitywise.

If you want to run arbitrary shell commands, use commands promises? Try this...

bundle agent example 
{
files:
  "/tmp/aleksey.txt"

    create => "true", # Must have this!

transformer => "/bin/cp /etc/passwd /tmp/out";
}

It works, but it is not really what transformer was intended for (gzip etc).  I 
suspect the tar example did not work due to an error executing (run in 
verbose). Perms?

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

Reply via email to