如何在 cfengine3 中使用命令的输出

aws*_*siv 8 configuration-management cfengine

我想列出目录内容并在其他地方使用结果:

bundle agent test
{

   commands:
      "ls /tmp/test/";

    reports:
    ubuntu::
       "print output here for example";  
# or add it to a variable which is how I really want to use it.
 }
Run Code Online (Sandbox Code Playgroud)

fak*_*ker 12

bundle agent test
{

    vars:
        "my_result" string => execresult("/bin/ls /tmp/test/","noshell");

    reports:
        ubuntu::
            "Output is : $(my_result)";  
}
Run Code Online (Sandbox Code Playgroud)

https://cfengine.com/manuals/cf3-solutions#Execresult-example