On 05/02/2016 11:10 AM, Christian Linden wrote:
> In the below example:
> the body perms system is defined in the MySpace namespace and hence should
> be found within it w/o default:system but just perms => system, right?
I mis-read initially. I thought you were trying to include =body perms
system=
from the default namespace. You have defined =body perms system= after the
namespace declaration in that file, so you need to specify the "MySpace"
namespace for the body.
#+begin_src cfengine3 :tangle /tmp/
using_namespaced_body.cf
body file control
{
inputs => {
"$(sys.libdir)/
stdlib.cf",
};
}
bundle agent main
{
methods:
"" usebundle => MySpace:stuff;
}
body file control
{
namespace => "MySpace";
}
bundle agent stuff
{
files:
"/tmp/$(sys.fqhost).substatus"
perms => MySpace:system,
create => "true";
}
body perms system
{
mode => "0640";
}
#+end_src
#+BEGIN_SRC sh :results raw :exports both
cf-agent -KIf /tmp/
using_namespaced_body.cf
#+END_SRC
#+RESULTS:
info: Created file '/tmp/nickanderson-thinkpad-w550s.substatus',
mode 0640