It would be very useful to have a variable that contained the path to the directory so that other variables in policy do not rely on specific fully qualified paths and can instead be relative to our policy root.
We have sys.inputdir and this.promise_dirname but they do not quite cover the use case.
sys.inputdir is either /var/cfengine/inputs or $HOME/.cfagent/inputs depending on the executing user. The path can be overridden with the use of --workdir but that is less friendly than automatically populating a variable.
this.promise_dirname dosn't quite cover the use because you have to add new policy and that new policy must know its relative position to the entry file.
I suggest sys.policy_entry_dirname.
for example:
cd /tmp cf-promises -cf ./mypolicy.cf
sys.policy_entry_dirname = /tmp
cf-promises -cf /tmp/mypolicy.cf
sys.policy_entry_dirname = /tmp
# cf-promises -c
sys.policy_entry_dirname = /var/cfengine/inputs/
- duplicates
-
CFE-54 sys variable to policy path
-
- Rejected
-
- relates to
-
CFE-2648 As a policy writer I would like to be able to directly use variables containing information about paths for the current policy run in body file control so that I can reduce the amount of boilerplate policy.
-
- Open
-
-
CFE-1026 this.promise_dirname should work in "body file control"
-
- Need more Info
-