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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
body common control
{
bundlesequence => { "packages" };
inputs => { "cfengine_stdlib.cf" }
inputs => { "cfengine_stdlib.cf" };
}

bundle agent packages
Expand Down
1 change: 1 addition & 0 deletions content/examples/tutorials/manage-ntp.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,7 @@ bundle agent ntp
"servers"
slist => getvalues("def.ntp[config][servers]"),
if => isvariable("def.ntp[config][servers]");
}
```

Notice two promises were introduced, one setting `driftfile` to the value of `$(def.ntp[config][driftfile])` if it is defined and one setting servers to the list of values for `def.ntp[config][servers]` if it is defined. [Augments][Augments] allows for variables to be set in the _def_ bundle scope very early before policy is evaluated.
Expand Down
2 changes: 1 addition & 1 deletion content/reference/components/cf-agent.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ body agent control
copyfrom_restrict_keys => {
"SHA=6565a8e647e61e4a7ff2c709e0fe772acce2e45aaa294b2bb713de0ba5a6d8c3",
"SHA=727dd7f6f8b2344c6d69cf1d3ed0446c0f9f095ce1a114481d691bf1cb2b300d",
}
};
}
```

Expand Down
2 changes: 1 addition & 1 deletion content/reference/components/cf-execd.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ body executor control
mailto => "cfengine@example.org";
mailfrom => "cfengine@$(host).example.org";
smtpserver => "localhost";
schedule => { "Min00", "Min30" }
schedule => { "Min00", "Min30" };
}
```

Expand Down
46 changes: 46 additions & 0 deletions content/reference/promise-types/classes.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,52 @@ classes:

**See also:** [`persistence` classes attribute][classes#persistence], [`persist_time` in classes body][Promise types#persist_time]

### timer_policy

**Description:** Determines whether a persistent class restarts its counter
when rediscovered.

When a [`persistence`][classes#persistence] timer is set, `timer_policy`
controls what happens on later runs while the class is still defined (loaded
from the persistent store):

- `reset` re-evaluates the promise and restarts the timer, so the class keeps
persisting for as long as the policy keeps running and the expression stays
true.
- `absolute` preserves the original expiry. While the class is already defined
the promise is skipped, so the class disappears once the original timer
elapses, regardless of how often the policy runs.

This is the counterpart of `timer_policy` in the classes body, which has always
defaulted to `reset`.

**Type:** (menu option)

**Allowed input range:** `absolute|reset`

**Default value:** absolute

**Example:**

```cf3
bundle common setclasses
{
classes:
"cached_class"
expression => "any",
persistence => "120",
timer_policy => "reset";
}
```

**History:**

- Introduced in CFEngine 3.27.2.
- The default is `absolute`, preserving the historical persistent-class
behavior. The default changed to `reset` in 3.28.0.

**See also:** [`persistence` classes attribute][classes#persistence], [`timer_policy` in classes body][Promise types#timer_policy], [`persist_time` in classes body][Promise types#persist_time]

### not

**Description:** Evaluate the negation of string expression in normal form
Expand Down
2 changes: 1 addition & 1 deletion content/reference/promise-types/files/_index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -2063,7 +2063,7 @@ body file_select example
{
leaf_name => { "prog.pid", "prog.log" };
path_name => { "/etc/.*", "/var/run/.*" };
file_result => "leaf_name.path_name"
file_result => "leaf_name.path_name";
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ bundle agent workflow_one
"/usr/local/bin/my_job",
action => if_elapsed("100"),
classes => state_repaired("did_my_job");
}
```

## Fancy distributed encapsulation
Expand Down Expand Up @@ -366,6 +367,7 @@ bundle agent workflow_one
"/usr/local/bin/my_job",
action => if_elapsed("100"),
classes => state_repaired("did_my_job");
}
```

## Self-healing workflows
Expand Down
1 change: 1 addition & 0 deletions content/resources/additional-topics/security.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ bundle agent change_management
),
depends_on => { "grant_hash_tables" },
action => neighbourwatch("File changes observed on $(neighbours)");
}
```

It works by building a list of neighbours for each host. The function peers can
Expand Down
Loading