diff --git a/reference/common-attributes-include.markdown b/reference/common-attributes-include.markdown index 712a72f79..309623820 100644 --- a/reference/common-attributes-include.markdown +++ b/reference/common-attributes-include.markdown @@ -16,6 +16,8 @@ the [Promise types] page. The common attributes are as follows: #### [if][Promise types#if] +#### [unless][Promise types#unless] + #### [meta][Promise types#meta] #### [with][Promise types#with] diff --git a/reference/promise-types/access.markdown b/reference/promise-types/access.markdown index 72b97f2e9..8da7615bc 100644 --- a/reference/promise-types/access.markdown +++ b/reference/promise-types/access.markdown @@ -115,6 +115,7 @@ promises will override less specific ones. ## Attributes +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} ### admit_hostnames diff --git a/reference/promise-types/classes.markdown b/reference/promise-types/classes.markdown index 57b1233d9..4e161d68b 100644 --- a/reference/promise-types/classes.markdown +++ b/reference/promise-types/classes.markdown @@ -75,6 +75,8 @@ bundle agent example ## Attributes +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} + ### and **Description:** Combine class sources with AND diff --git a/reference/promise-types/defaults.markdown b/reference/promise-types/defaults.markdown index 17a2916de..402863f21 100644 --- a/reference/promise-types/defaults.markdown +++ b/reference/promise-types/defaults.markdown @@ -89,6 +89,8 @@ reports: ## Attributes +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} + ### if_match_regex **Description:** If this [anchored][anchored] regular expression matches the diff --git a/reference/promise-types/measurements.markdown b/reference/promise-types/measurements.markdown index 8a6d2cbb6..9a103d477 100644 --- a/reference/promise-types/measurements.markdown +++ b/reference/promise-types/measurements.markdown @@ -153,6 +153,8 @@ may be used in other promises in the form `$(mon.handle)`. ## Attributes +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} + ### stream_type **Description:** The datatype being collected. diff --git a/reference/promise-types/meta.markdown b/reference/promise-types/meta.markdown index 09e639164..48dabae08 100644 --- a/reference/promise-types/meta.markdown +++ b/reference/promise-types/meta.markdown @@ -27,3 +27,90 @@ reports: ``` The value of meta data can be of the types `string` or `slist` or `data`. + +## Attributes + +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} + +### data + +**Description:** A data container structure + +**Type:** `data` + +**Allowed input range:** (arbitrary string) + +**Example:** + +```cf3 +vars: + + "loaded1" data => readjson("/tmp/myfile.json", 40000); + "loaded2" data => parsejson('{"key":"value"}'); + "loaded3" data => readyaml("/tmp/myfile.yaml", 40000); + "loaded4" data => parseyaml('- key2: value2'); + "merged1" data => mergedata(loaded1, loaded2, loaded3, loaded4); + + # JSON or YAML can be inlined since CFEngine 3.7 + "inline1" data => '{"key":"value"}'; # JSON + "inline2" data => '---$(const.n)- key2: value2'; # YAML requires "---$(const.n)" header +``` + +### slist + +**Description:** A list of scalar strings + +**Type:** `slist` + +**Allowed input range:** (arbitrary string) + +**Example:** + +```cf3 +vars: + + "xxx" slist => { "literal1", "literal2" }; + "xxx1" slist => { "1", @(xxx) }; # interpolated in order + "yyy" slist => { + readstringlist( + "/home/mark/tmp/testlist", + "#[a-zA-Z0-9 ]*", + "[^a-zA-Z0-9]", + 15, + 4000 + ) + }; + + "zzz" slist => { readstringlist( + "/home/mark/tmp/testlist2", + "#[^\n]*", + ",", + 5, + 4000) + }; +``` + +**Notes:** + +Some [functions][Functions] return `slist`s, and an `slist` +may contain the values copied from another `slist`, `rlist`, or `ilist`. See +[`policy`](#policy). + + +### string + +**Description:** A scalar string + +**Type:** `string` + +**Allowed input range:** (arbitrary string) + +**Example:** + +```cf3 +vars: + + "xxx" string => "Some literal string..."; + "yyy" string => readfile( "/home/mark/tmp/testfile" , "33" ); +``` + diff --git a/reference/promise-types/roles.markdown b/reference/promise-types/roles.markdown index cb15b489d..3f1f190cc 100644 --- a/reference/promise-types/roles.markdown +++ b/reference/promise-types/roles.markdown @@ -38,6 +38,8 @@ classes matching the regular expression `Myclass_.*` hen using the ## Attributes +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} + ### authorize **Description:** List of public-key user names that are allowed to activate diff --git a/reference/promise-types/vars.markdown b/reference/promise-types/vars.markdown index 312813ee8..e08411ed1 100644 --- a/reference/promise-types/vars.markdown +++ b/reference/promise-types/vars.markdown @@ -303,6 +303,8 @@ vars: ## Attributes +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} + ### policy **Description:** The policy for (dis)allowing (re)definition of variables