diff --git a/content/reference/common-attributes.include.markdown b/content/reference/common-attributes.include.markdown index 712a72f79..309623820 100644 --- a/content/reference/common-attributes.include.markdown +++ b/content/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/content/reference/promise-types/access.markdown b/content/reference/promise-types/access.markdown index 22f583dd0..95690e8f7 100644 --- a/content/reference/promise-types/access.markdown +++ b/content/reference/promise-types/access.markdown @@ -111,6 +111,8 @@ promises will override less specific ones. ## Attributes +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} + ### admit_hostnames **Description:** A list of hostnames or domains that should have access to the object. diff --git a/content/reference/promise-types/classes.markdown b/content/reference/promise-types/classes.markdown index aeed83ee2..380209c9e 100644 --- a/content/reference/promise-types/classes.markdown +++ b/content/reference/promise-types/classes.markdown @@ -71,6 +71,8 @@ bundle agent example ## Attributes +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} + ### and **Description:** Combine class sources with AND diff --git a/content/reference/promise-types/defaults.markdown b/content/reference/promise-types/defaults.markdown index 883aa056c..865f7f7d0 100644 --- a/content/reference/promise-types/defaults.markdown +++ b/content/reference/promise-types/defaults.markdown @@ -88,6 +88,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/content/reference/promise-types/measurements.markdown b/content/reference/promise-types/measurements.markdown index f0ce5bcd4..ac5b5f85c 100644 --- a/content/reference/promise-types/measurements.markdown +++ b/content/reference/promise-types/measurements.markdown @@ -150,6 +150,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/content/reference/promise-types/meta.markdown b/content/reference/promise-types/meta.markdown index 311e7b7fe..e2f672f5f 100644 --- a/content/reference/promise-types/meta.markdown +++ b/content/reference/promise-types/meta.markdown @@ -26,3 +26,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/content/reference/promise-types/roles.markdown b/content/reference/promise-types/roles.markdown index c8ec639cd..3274860eb 100644 --- a/content/reference/promise-types/roles.markdown +++ b/content/reference/promise-types/roles.markdown @@ -37,6 +37,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/content/reference/promise-types/vars.markdown b/content/reference/promise-types/vars.markdown index c93fdc4af..2da3dacfb 100644 --- a/content/reference/promise-types/vars.markdown +++ b/content/reference/promise-types/vars.markdown @@ -302,6 +302,8 @@ vars: ## Attributes +{{< CFEngine_include_markdown(common-attributes.include.markdown) >}} + ### policy **Description:** The policy for (dis)allowing (re)definition of variables