Movatterモバイル変換


[0]ホーム

URL:


CFEngine documentation homepage

file control

Suggest changes
Table of contents
code
bodyfilecontrol{namespace=>"name1";}bundleagentprivate{....}

History: Was introduced in 3.4.0, Enterprise 3.0.0 (2012)

This directive can be given multiple times within any file,outside of body and bundle definitions.

Onlysoft classes from common bundles canbe used in class decisions insidefile control bodies.

inputs

Description: Theinputs slist contains additional filenames to parse for promises.

The filenames specified are all assumed to be relative to the directoryof the file which references them. Use an absolute file name if you need an absolute path.Usesys.libdir (absolute library path),sys.local_libdir (library path relative to thecurrent masterfiles), andthis.promise_dirname (the directory of the currently processedfile) to avoid hard-coding paths.

Note that inthis. variables are not available inbody file control orbody common controlbut this can be worked around with abundle common vars promise as follows:

code
# one.cfbundlecommonone{vars:"inputs"slist=>{"$(this.promise_dirname)/two.cf"};}bodyfilecontrol{inputs=>{"@(one.inputs)"};}bundleagentmain{methods:"two";}
code
# two.cfbundleagenttwo{reports:"hello, from$(this.promise_filename)";}
code
$ cf-agent -KIf ./one.cfR: hello, from /home/agent/./two.cf

See also:inputs inbody common control

History: Was introduced in CFEngine 3.6.0

namespace

Description: The namespace string identifies a private namespaceto switch to in order to protect the current file from duplicate definitions.

Type:string

Allowed input range:[a-zA-Z0-9_$(){}\[\].:]+

Example:

code
bodyfilecontrol{namespace=>"name1";}

Notes:

History: Was introduced in 3.4.0, Enterprise 3.0.0 (2012)

This directive can be given within any file, outside of body and bundledefinitions, to change thenamespace of subsequent bundlesand bodies. A namespace applies until the next namespace declaration in afile, or until the end of a file. This is similar to how class expressionsapply until the next class expression or end of bundle.

See also:namespaces

Still need help?

Chat Ask a question on Github Mailing list
Version 
master3.24 (LTS)3.21 (LTS)view all versions

[8]ページ先頭

©2009-2025 Movatter.jp