Skip to content

Commit c36cc5b

Browse files
committed
Added documentation for hostswithgroup() policy function
Ticket: ENT-11325 Signed-off-by: Victor Moene <victor.moene@northern.tech>
1 parent 3b914e9 commit c36cc5b

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

reference/functions/hostswithclass.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ hostnames, ip-addresses or public key SHAs of hosts that have a given class.
1818
configuration files for (classes of) hosts. Hosts are selected based on the
1919
classes set during the most recently collected agent run.
2020

21-
[%CFEngine_function_attributes(class, field, hostkey)%]
21+
[%CFEngine_function_attributes(class, field)%]
2222

2323
**Example:**
2424

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
layout: default
3+
title: hostswithgroup
4+
published: true
5+
---
6+
7+
**This function is only available in CFEngine Enterprise.**
8+
9+
[%CFEngine_function_prototype(group_name, field)%]
10+
11+
**Description:** Returns a list from the CFEngine Database with the information `field` of all hosts sharing the group `group_name`.
12+
13+
On CFEngine Enterprise, this hub function can be used to return a list of hostnames, ip-addresses or public key SHAs of hosts that are from the same group. It works very similarly as its twin `hostswithclass()`.
14+
15+
[%CFEngine_function_attributes(group_name, field)%]
16+
17+
**Example:**
18+
19+
```cf3
20+
bundle agent debian_hosts
21+
{
22+
vars:
23+
24+
am_policy_hub::
25+
"host_list" slist => hostswithgroup( "Linux", "name" );
26+
27+
files:
28+
am_policy_hub::
29+
"/tmp/master_config.cfg"
30+
edit_line => insert_lines("host=$(host_list)"),
31+
create => "true";
32+
}
33+
```
34+
35+
**History:** Was introduced in 3.26.0
36+
37+
**See also:** `hostswithclass()`

0 commit comments

Comments
 (0)