-
Notifications
You must be signed in to change notification settings - Fork 0
/
helpers.cf
28 lines (24 loc) · 870 Bytes
/
helpers.cf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
###############################################################################
# Collection of small helper functions
# brought to you by LastOps (http://lastops.com)
###############################################################################
body file control
# @ignore
{
namespace => "lastops";
}
body classes generic_classificator(base_name)
# @brief Sets classes based on `base_name` by adding '_kept', '_repaired' or
# '_failed' to it depending on promise outcome.
# @param base_name string Base name to use for resulting class
{
promise_kept => {'${base_name}_kept', };
promise_repaired => {'${base_name}_repaired', };
repair_failed => {'${base_name}_failed', };
}
bundle common safe_hostname_class
# @brief Sets hostname class in a safe way. See also CFEngine Bug 6870.
{
classes:
'safe_${sys.host}' expression => 'any';
}