Movatterモバイル変換


[0]ホーム

URL:


CFEngine documentation homepage

hostswithclass

Suggest changes
Table of contents

This function is only available in CFEngine Enterprise.

Prototype:hostswithclass(class, field)

Return type:slist

Description: Returns a list from the CFEngine Database with the informationfield of hosts on whichclasss is set.

On CFEngine Enterprise, this function can be used to return a list ofhostnames or ip-addresses of hosts that have a given class.

Note: This function only works locally on the hub, but allows the hub to construct customconfiguration files for (classes of) hosts. Hosts are selected based on theclasses set during the most recently collected agent run.

Arguments:

  • class:string - Class name to look for - in the range:[a-zA-Z0-9_]+
  • field: - Type of return value desired - one of
    • name
    • address

Example:

code
bundleagentdebian_hosts{vars:am_policy_hub::"host_list"slist=>hostswithclass("debian","name");files:am_policy_hub::"/tmp/master_config.cfg"edit_line=>insert_lines("host=$(host_list)"),create=>"true";}

History: Was introduced in 3.3.0, Nova 2.2.0 (2012)

See also:hubknowledge(),remotescalar(),remoteclassesmatching()

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