Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions reference/common-attributes-include.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions reference/promise-types/access.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ promises will override less specific ones.

## Attributes

{{< CFEngine_include_markdown(common-attributes.include.markdown) >}}

### admit_hostnames

Expand Down
2 changes: 2 additions & 0 deletions reference/promise-types/classes.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ bundle agent example

## Attributes

{{< CFEngine_include_markdown(common-attributes.include.markdown) >}}

### and

**Description:** Combine class sources with AND
Expand Down
2 changes: 2 additions & 0 deletions reference/promise-types/defaults.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions reference/promise-types/measurements.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
87 changes: 87 additions & 0 deletions reference/promise-types/meta.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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" );
```

2 changes: 2 additions & 0 deletions reference/promise-types/roles.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions reference/promise-types/vars.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,8 @@ vars:

## Attributes

{{< CFEngine_include_markdown(common-attributes.include.markdown) >}}

### policy

**Description:** The policy for (dis)allowing (re)definition of variables
Expand Down