Movatterモバイル変換


[0]ホーム

URL:


CFEngine documentation homepage

read_module_protocol

Suggest changes
Table of contents

Prototype:read_module_protocol(file_path)

Return type:boolean

Description: Interpretsfile_path as module protocol output.

This function is useful for reducing overhead by caching and then reading module protocol results from a file.

Arguments:

  • file_path:string - File name to read and parse from - in the range:"?(/.*)

Example:

code
bundleagentcache_maintenance{vars:"file"string=>"$(this.promise_dirname)/cached_module";classes:"cache_refresh"if=>not(fileexists("$(file)"));Min30_35::"cache_refresh";files:cache_refresh::"$(file)"create=>"true",edit_template_string=>"=my_variable=$(sys.date)",template_data=>"{}",template_method=>"inline_mustache";}bundleagentdemo{classes:"cache_was_read"if=>read_module_protocol("$(cache_maintenance.file)");reports:cache_was_read::"Module cache was read!";"cached_module.my_variable =$(cached_module.my_variable)";}bundleagent__main__{methods:"cache_maintenance"handle=>"cache_maintenance_done";"demo"depends_on=>{"cache_maintenance_done"};}

This policy can be found in/var/cfengine/share/doc/examples/read_module_protocol.cfand downloaded directly fromgithub.

See also:usemodule(),Module Protocol

History:

  • Introduced in 3.15.0

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