Movatterモバイル変換


[0]ホーム

URL:


CFEngine documentation homepage

How do I integrate custom policy?

Suggest changes
Table of contents

There are many different ways that custom polices can be organized. CFEnginedoes not prescribe any specific organizational layout but generally speakingkeeping custom policy files under as few different paths as possible can easepolicy framework upgrades.

For example, it is common to store custom policy files underservices/SERVICEorORGINIZATION from the root of your policy set.

Here we only describe ways to include and execute custom policies.

Using autorun

Theautorun feature in the Masterfiles Policy Framework automatically addspolicy files found inservices/autorun to inputs and executes bundles taggedwithautorun as methods type promises in lexical order.

See also: [services_autorun in the Masterfiles Policy Framework][Masterfiles Policy Framework#services_autorun]

Using augments

Augments uses theinputs key to definedef.augments_inputs which is includedin inputs of body common control in promises.cf by default.

code
{"inputs":["my_update.cf"]}

Alternatively you can defineaugments_inputs directly.

code
{"vars":{"augments_inputs":["my_policy.cf"]}}

To extend inputs in the update policy defineupdate_inputs.

code
{"vars":{"update_inputs":["my_update.cf"]}}

See also:Augments, [Extend inputs for update policy in the Masterfiles Policy Framework][Masterfiles Policy Framework#Append to inputs used by update policy]

Using body file control

inputs inbody file control can be used to load additional policy files.This can be very useful for loading policy files that are relative to eachother.

NOTES:

  • body file control cannot be used to specify bundles that should be executed.
  • this.promise_* variables cannot be used directly inbody file control.

    code
    bodyfilecontrol{inputs=>{"$(this.policy_dirname)/../stdlib.cf"};}

    Bundle variables can be used to achieve relative inputs.

    code
    bundlecommonexample_file_control{vars:"policy[stdlib]"string=>"$(this.policy_dirname)/../my_other_policy.cf";"inputs"slist=>getvalues(policy);}bodyfilecontrol{inputs=>{"$(example_file_control.inputs)"};}
  • sys.policy_* variablescan be used directly inbody file control.

    code
    bodyfilecontrol{inputs=>{"$(sys.policy_entry_dirname)/lib/stdlib.cf"};}

See also:inputs inbody file control

Using body common control

body common control is the classic way to define the list of policy files thatmake up the policy set (inputs ), and the order of the bundles to be executed(bundlesequence ).

See also:inputs inbody common control,bundlesequence inbody common control

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