Regarding the reference manual, it said "Current promise types that define $(this.promiser) are: files, processes, commands." so I tried to create promises to use that variable. It turned out that it didn't work as expected.
Here is my test policy.
body common control
host_licenses_paid => "25";
bundle agent test
copy_from => local_cp("/tmp$(this.promiser)");
"cf-monitord" restart_class => canonify("restart_$(this.promiser)");
args => "Nakarin $(this.promiser)";
args => "--> Restart a service", ifvarclass => "restart_cf_monitord";
- /var/cfengine/bin/cf-promises -V
@ @@@ @ CFEngine Core 3.4.0b3.4b24c8aac3612ae4ecf0dc2b2b540d3f3bccbeae
@ @@@ @ CFEngine Nova 3.0.0a1.366236c3e429c549d3e3245621ff7299b1558f8d
@ @@@ @
Copyright (C) CFEngine AS 2008-2012
See Licensing at http://cfengine.com/3rdpartylicenses
Out put on screen.
- /var/cfengine/bin/cf-agent -f /tmp/xxx.cf -IK
!! No commercial license file found - falling back on internal expiry
Can't stat /tmp$(this.promiser) in files.copyfrom promise
-> Executing '/bin/echo Nakarin $(this.promiser)' ... (no timeout)
Q: ".../bin/echo Nakar": Nakarin $(this.promiser)
I: Last 1 quoted lines were generated by promiser "/bin/echo Nakarin $(this.promiser)"
-> Completed execution of /bin/echo Nakarin $(this.promiser)
Nothing worked for me.