Skip to content

Commit

Permalink
Merge pull request #2538 from nickanderson/ENT-7572_Rename-components…
Browse files Browse the repository at this point in the history
…-and-common-control-to-components/3.15

ENT-7572: Renamed Components and Common Control to Components (3.15)
  • Loading branch information
nickanderson committed Sep 27, 2021
2 parents c2be628 + 2e52b1c commit f2d0aa1
Show file tree
Hide file tree
Showing 25 changed files with 85 additions and 47 deletions.
4 changes: 2 additions & 2 deletions examples.markdown
Expand Up @@ -109,7 +109,7 @@ Thus, CFEngine can function even if everything else fails
### Make the Example Stand Alone ###

Instead of specifying the bundle sequence on the command line (as it was above), a [body common
control][Components and Common Control#Common Control] section can be added to
control][Components#Common Control] section can be added to
the policy file. The **body common control** refers to those promises that are hard-coded into
all CFEngine components and therefore affect the behavior of all components. Note that only
one `body common control` is allowed per agent activation.
Expand Down Expand Up @@ -252,7 +252,7 @@ from the example.
};
```

4. Insert the policy file name in the [`inputs`][Components and Common Control#inputs] section of the main policy file
4. Insert the policy file name in the [`inputs`][Components#inputs] section of the main policy file
`/var/cfengine/masterfiles/promises.cf`:

```cf3
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorials/custom_inventory.markdown
Expand Up @@ -82,7 +82,7 @@ Git repository. If it is, please add the policy to your repository and ensure
it gets to its final destination as needed.

This policy will not be activated until it has been included in
[inputs][Components and Common Control#inputs]. For simplicity we will be
[inputs][Components#inputs]. For simplicity we will be
adding it via [Augments][Augments] (`def.json`).

Create `/var/cfengine/masterfiles/def.json` and populate it with the following content:
Expand Down
Expand Up @@ -162,12 +162,12 @@ is involved in patch distribution, they can view that bundle for specifics.
## Integrate the policy

Now that all the pieces of the policy are in place, they must be integrated
into the policy so they can be activated. Add each policy file to the [`inputs`][Components and Common Control#inputs]
into the policy so they can be activated. Add each policy file to the [`inputs`][Components#inputs]
section which is found under `body common control`. Once the policy file is included in
inputs, the bundle can be activated. Bundles can be activated by adding them to either the
`bundlesequence` or they can be called as a `methods` type promise.

Add the following entries to `promises.cf` under `body common control` -> [`inputs`][Components and Common Control#inputs]:
Add the following entries to `promises.cf` under `body common control` -> [`inputs`][Components#inputs]:

"lib/custom/files.cf",
"services/patching.cf",
Expand Down
2 changes: 1 addition & 1 deletion guide/faq/fix-undefined-body-error.markdown
Expand Up @@ -16,7 +16,7 @@ When running policy you see `error: Undefined body`. For example:

The above errors indicate that the `tidy` and `recurse` bodies are not found in
inputs. Bodies and bundles must either be defined within the same policy file or
included from [body common control inputs][Components and Common Control#inputs]
included from [body common control inputs][Components#inputs]
or [body file control inputs][file control#inputs].

# Example: Add stdlib via body common control
Expand Down
2 changes: 1 addition & 1 deletion guide/faq/integrate-custom-policy.markdown
Expand Up @@ -110,5 +110,5 @@ other.
make up the policy set ( *inputs* ), and the order of the bundles to be executed
( *bundlesequence* ).

**See Also:** [`inputs` in `body common control`][Components and Common Control#inputs], [`bundlesequence` in `body common control`][Components and Common Control#bundlesequence]
**See also:** [`inputs` in `body common control`][Components#inputs], [`bundlesequence` in `body common control`][Components#bundlesequence]

2 changes: 1 addition & 1 deletion guide/faq/manual-execution.markdown
Expand Up @@ -101,5 +101,5 @@ This command will run `cf-agent` with the additional class `patch_and_reboot` on
classes it is using must be resolvable during pre-evaluation as the full
evaluation is only allowed when the classes are found to be defined.

**See Also:** [How is "recently seen" determined][Components and Common Control#lastseenexpireafter], [`cf-runagent`][cf-runagent], [pre-evaluation][Normal Ordering#agent pre-evaluation step]
**See also:** [How is "recently seen" determined][Components#lastseenexpireafter], [`cf-runagent`][cf-runagent], [pre-evaluation][Normal Ordering#agent pre-evaluation step]

Expand Up @@ -62,7 +62,7 @@ The bootstrap command must then be run on any client attaching itself to this se

## Post-Installation Configuration ##

CFEngine itself is configured through policy as well (see [Components and Common Control][] and
CFEngine itself is configured through policy as well (see [Components][] and
[Masterfiles Policy Framework][] for details). The following basic changes to the default policy will configure
`cf-serverd` and `cf-execd` for your environment.

Expand Down
Expand Up @@ -57,7 +57,7 @@ wish to bootstrap. And install it using `cf-key`.
[root@host001]# cf-key --trust-key /path/to/hubs/key.pub
```

**Note:** If you are using [protocol_version `1` or `classic`][Components and Common Control#protocol_version]
**Note:** If you are using [protocol_version `1` or `classic`][Components#protocol_version]
you need to supply an IP address before the path to the key.

For example:
Expand Down
8 changes: 4 additions & 4 deletions guide/introduction/networking.markdown
Expand Up @@ -122,7 +122,7 @@ On the client side, i.e. `cf-runagent` and `cf-agent`, there are three issues:
1. Choosing which server to connect to.
2. Trusting the key of any previously unknown servers
3. Choosing whether data transfers should be encrypted (with
[`encrypt`][files#encrypt]) - not applicable if you are using new [`protocol_version`][Components and Common Control#protocol_version].
[`encrypt`][files#encrypt]) - not applicable if you are using new [`protocol_version`][Components#protocol_version].

There are two ways of managing trust of server keys by a client. One is an
automated option, setting the option [`trustkey`][files#trustkey] in a `copy_from` files promise, e.g.
Expand Down Expand Up @@ -220,7 +220,7 @@ that cf-serverd requires to be encrypted can be logged by setting the
### Protocol 2

3.6 introduced a new protocol option for communication with
cf-serverd. [Protocol 2][Components and Common Control#protocol_version]
cf-serverd. [Protocol 2][Components#protocol_version]
is the default in 3.7+ and uses a TLS session for encryption.

**Note:** When protocol 2 is in use legacy encryption attributes are **noop**.
Expand All @@ -239,14 +239,14 @@ setting the
[body server control `allowciphers` attribute][cf-serverd#allowciphers]. Controlling
which ciphers are allowed to be used in **outgoing** connections is
done by setting
[body common control `tls_ciphers`][Components and Common Control#tls_ciphers].
[body common control `tls_ciphers`][Components#tls_ciphers].

Additionally the minimum version of TLS required for **incoming**
connections can be set in
[body server control `allowtlsversion`][cf-serverd#allowtlsversion]
and the minimum version of TLS required for **outgoing** connections
can be set in
[body common control `tls_min_version`][Components and Common Control#tls_min_version].
[body common control `tls_min_version`][Components#tls_min_version].

There are debug and verbose level logs produced by cf-agent to
indicate when TLS is in use.
Expand Down
2 changes: 1 addition & 1 deletion index.markdown
Expand Up @@ -32,7 +32,7 @@ frequently asked questions (and answers :)

*Shortcuts:*

## [Components][Components and Common Control]
## [Components][Components]
Cf-agent, cf-serverd, cf-execd, cf-promises, etc.

## [Language concepts][Language Concepts]
Expand Down
2 changes: 1 addition & 1 deletion reference.markdown
Expand Up @@ -10,7 +10,7 @@ components, bodies, functions, variables, classes and attributes in detail.
Language elements that belong together are typically documented on the same
page.

* [Components and Common Control][Components and Common Control]
* [Components][Components]
* [Promise Types][Promise Types]
* [Functions][Functions]
* [Language Concepts][Language Concepts]
Expand Down
8 changes: 4 additions & 4 deletions reference/components.markdown
@@ -1,6 +1,6 @@
---
layout: default
title: Components and Common Control
title: Components
published: true
sorting: 10
tags: [Reference, Components]
Expand Down Expand Up @@ -443,7 +443,7 @@ body common control
using the [`body copy_from protocol_version`][files#protocol_version]
attribute.

**See also:** [`body copy_from protocol_version`][files#protocol_version], `allowlegacyconnects`, [`allowtlsversion`][cf-serverd#allowtlsversion], [`allowciphers`][cf-serverd#allowciphers], [`tls_min_version`][Components and Common Control#tls_min_version], [`tls_ciphers`][Components and Common Control#tls_ciphers], [`encrypt`][files#encrypt], [`logencryptedtransfers`][cf-serverd#logencryptedtransfers], [`ifencrypted`][access#ifencrypted]
**See also:** [`body copy_from protocol_version`][files#protocol_version], `allowlegacyconnects`, [`allowtlsversion`][cf-serverd#allowtlsversion], [`allowciphers`][cf-serverd#allowciphers], [`tls_min_version`][Components#tls_min_version], [`tls_ciphers`][Components#tls_ciphers], [`encrypt`][files#encrypt], [`logencryptedtransfers`][cf-serverd#logencryptedtransfers], [`ifencrypted`][access#ifencrypted]

**History:** Introduced in CFEngine 3.6.0

Expand Down Expand Up @@ -572,7 +572,7 @@ body common control
}
```

**See also:** [`protocol_version`][Components and Common Control#protocol_version], [`allowciphers`][cf-serverd#allowciphers], [`tls_min_version`][Components and Common Control#tls_min_version], [`allowtlsversion`][cf-serverd#allowtlsversion], [`encrypt`][files#encrypt], [`logencryptedtransfers`][cf-serverd#logencryptedtransfers], [`ifencrypted`][access#ifencrypted]
**See also:** [`protocol_version`][Components#protocol_version], [`allowciphers`][cf-serverd#allowciphers], [`tls_min_version`][Components#tls_min_version], [`allowtlsversion`][cf-serverd#allowtlsversion], [`encrypt`][files#encrypt], [`logencryptedtransfers`][cf-serverd#logencryptedtransfers], [`ifencrypted`][access#ifencrypted]

**History:** Introduced in CFEngine 3.7.0

Expand All @@ -590,7 +590,7 @@ body common control
}
```

**See also:** [`protocol_version`][Components and Common Control#protocol_version], [`allowciphers`][cf-serverd#allowciphers], [`tls_ciphers`][Components and Common Control#tls_ciphers], [`allowtlsversion`][cf-serverd#allowtlsversion], [`encrypt`][files#encrypt], [`ifencrypted`][access#ifencrypted], [`logencryptedtransfers`][cf-serverd#logencryptedtransfers]
**See also:** [`protocol_version`][Components#protocol_version], [`allowciphers`][cf-serverd#allowciphers], [`tls_ciphers`][Components#tls_ciphers], [`allowtlsversion`][cf-serverd#allowtlsversion], [`encrypt`][files#encrypt], [`ifencrypted`][access#ifencrypted], [`logencryptedtransfers`][cf-serverd#logencryptedtransfers]

**History:** Introduced in CFEngine 3.7.0

Expand Down
2 changes: 1 addition & 1 deletion reference/components/cf-agent.markdown
Expand Up @@ -9,7 +9,7 @@ keywords: [agent]

`cf-agent` evaluates policy code and makes changes to the system. Policy
bundles are evaluated in the order of the provided `bundlesequence` (this is normally specified in the
[`common control body`][Components and Common Control#Common Control]). For
[`common control body`][Components#Common Control]). For
each bundle, `cf-agent` groups promise statements according to their type.
Promise types are then evaluated in a preset order to ensure fast system
convergence to policy.
Expand Down
20 changes: 10 additions & 10 deletions reference/components/cf-serverd.markdown
Expand Up @@ -134,7 +134,7 @@ specify a list of hosts allowed to use the legacy protocol.

[%CFEngine_promise_attribute()%]

**See also:** [`protocol_version`][Components and Common Control#protocol_version]
**See also:** [`protocol_version`][Components#protocol_version]


### allowciphers
Expand All @@ -155,13 +155,13 @@ body server control
```

**Note:** When used with
[`protocol_version`][Components and Common Control#protocol_version] 1 (classic protocol),
[`protocol_version`][Components#protocol_version] 1 (classic protocol),
this does not do anything as the classic protocol does not support TLS ciphers.

**See also:**
[`protocol_version`][Components and Common Control#protocol_version],
[`tls_ciphers`][Components and Common Control#tls_ciphers],
[`tls_min_version`][Components and Common Control#tls_min_version],
[`protocol_version`][Components#protocol_version],
[`tls_ciphers`][Components#tls_ciphers],
[`tls_min_version`][Components#tls_min_version],
[`allowtlsversion`][cf-serverd#allowtlsversion],
[`encrypt`][files#encrypt],
[`logencryptedtransfers`][cf-serverd#logencryptedtransfers],
Expand All @@ -187,13 +187,13 @@ body server control
```

**Note:** When used with
[`protocol_version`][Components and Common Control#protocol_version] 1 (classic protocol),
[`protocol_version`][Components#protocol_version] 1 (classic protocol),
this attribute does not do anything.

**See also:**
[`protocol_version`][Components and Common Control#protocol_version],
[`tls_ciphers`][Components and Common Control#tls_ciphers],
[`tls_min_version`][Components and Common Control#tls_min_version],
[`protocol_version`][Components#protocol_version],
[`tls_ciphers`][Components#tls_ciphers],
[`tls_min_version`][Components#tls_min_version],
[`allowciphers`][cf-serverd#allowciphers],
[`encrypt`][files#encrypt],
[`logencryptedtransfers`][cf-serverd#logencryptedtransfers],
Expand Down Expand Up @@ -489,7 +489,7 @@ to syslog. These files are deemed to be particularly sensitive.
}
```

**See also:** [`ifencrypted`][access#ifencrypted], [`encrypt`][files#encrypt], [`tls_ciphers`][Components and Common Control#tls_ciphers], [`tls_min_version`][Components and Common Control#tls_min_version], [`allowciphers`][cf-serverd#allowciphers], [`allowtlsversion`][cf-serverd#allowtlsversion], [`protocol_version`][Components and Common Control#protocol_version]
**See also:** [`ifencrypted`][access#ifencrypted], [`encrypt`][files#encrypt], [`tls_ciphers`][Components#tls_ciphers], [`tls_min_version`][Components#tls_min_version], [`allowciphers`][cf-serverd#allowciphers], [`allowtlsversion`][cf-serverd#allowtlsversion], [`protocol_version`][Components#protocol_version]


### maxconnections
Expand Down
42 changes: 40 additions & 2 deletions reference/components/file_control_promises.markdown
Expand Up @@ -37,8 +37,46 @@ Use `sys.libdir` (absolute library path), `sys.local_libdir` (library path relat
current masterfiles), and `this.promise_dirname` (the directory of the currently processed
file) to avoid hard-coding paths.

**See also:** [`inputs`][Components and Common Control#inputs] in
[`body common control`][Components and Common Control]
Note that in `this.` variables are not available in `body file control` or `body common control`
but this can be worked around with a `bundle common` vars promise as follows:

```cf3
# one.cf
bundle common one
{
vars:
"inputs" slist => { "$(this.promise_dirname)/two.cf" };
}
body file control
{
inputs => { "@(one.inputs)" };
}
bundle agent main
{
methods:
"two";
}
```

```cf3
# two.cf
bundle agent two
{
reports:
"hello, from $(this.promise_filename)";
}
```

```sh
$ cf-agent -KIf ./one.cf
R: hello, from /home/agent/./two.cf
```


**See also:** [`inputs`][Components#inputs] in
[`body common control`][Components]

**History:** Was introduced in CFEngine 3.6.0

Expand Down
2 changes: 1 addition & 1 deletion reference/functions/hostsseen.markdown
Expand Up @@ -31,4 +31,4 @@ reports:
}
```

**See Also:** [lastseenexpireafter in body common control][Components and Common Control#lastseenexpireafter]
**See also:** [lastseenexpireafter in body common control][Components#lastseenexpireafter]
2 changes: 1 addition & 1 deletion reference/functions/packagesmatching.markdown
Expand Up @@ -40,7 +40,7 @@ this:
The following code extracts just the package names, then looks for
some desired packages, and finally reports if they are installed.

**IMPORTANT:** Please note that you need to provide `package_inventory` attribute in `body common control` in order to be able to use this function. Also depending on the value(s) of `package_inventory` only packages from selected package modules will be returned. For more information about `package_inventory` please read [`package_inventory`][Components and Common Control#package_inventory] section.
**IMPORTANT:** Please note that you need to provide `package_inventory` attribute in `body common control` in order to be able to use this function. Also depending on the value(s) of `package_inventory` only packages from selected package modules will be returned. For more information about `package_inventory` please read [`package_inventory`][Components#package_inventory] section.

[%CFEngine_include_example(packagesmatching.cf)%]

Expand Down
2 changes: 1 addition & 1 deletion reference/functions/packageupdatesmatching.markdown
Expand Up @@ -36,7 +36,7 @@ this:
* `arch_regex` - Regular expression matching package architecutre
* `method_regex` - Regular expression matching package method (apt-get, rpm, etc ...)

**IMPORTANT:** Please note that you need to provide `package_inventory` attribute in `body common control` in order to be able to use this function. Also depending on the value(s) of `package_inventory` only packages from selected package modules will be returned. For more information about `package_inventory` please read [`package_inventory`][Components and Common Control#package_inventory] section.
**IMPORTANT:** Please note that you need to provide `package_inventory` attribute in `body common control` in order to be able to use this function. Also depending on the value(s) of `package_inventory` only packages from selected package modules will be returned. For more information about `package_inventory` please read [`package_inventory`][Components#package_inventory] section.


**Example:**
Expand Down
4 changes: 2 additions & 2 deletions reference/language-concepts/augments.markdown
Expand Up @@ -88,7 +88,7 @@ results in the variable `def.phone` with value `22-333-4444` being defined, and
happens before policy is parsed or evaluated.

You can see the list of variables thus defined in the output of `cf-promises
--show-vars` (see [Components and Common Control][]). They will be tagged with
--show-vars` (see [Components][]). They will be tagged with
the tag `source=augments_file`. For instance, the above two variables (assuming
you placed the data in `$(sys.inputdir)/def.json`) result in

Expand Down Expand Up @@ -182,7 +182,7 @@ results in
agents and `MISSING` is not defined.

You can see the list of classes thus defined through `def.json` in the output
of `cf-promises --show-classes` (see [Components and Common Control][]). They
of `cf-promises --show-classes` (see [Components][]). They
will be tagged with the tags `source=augments_file,hardclass`. For instance:

```console
Expand Down
2 changes: 1 addition & 1 deletion reference/language-concepts/bodies.markdown
Expand Up @@ -171,7 +171,7 @@ This promise bodies configures the `bundlesequence` to execute on a cf-agent.

This promise body defines the clients allowed to connect to a cf-serverd.
For more information, see the reference documentation about the [CFEngine
Agents][Components and Common Control]
Agents][Components]

#### Default bodies

Expand Down
2 changes: 1 addition & 1 deletion reference/promise-types.markdown
Expand Up @@ -314,7 +314,7 @@ log message.

* `udp_syslog`

Log messages to [syslog_host][Components and Common Control#syslog_host] as
Log messages to [syslog_host][Components#syslog_host] as
defined in body common control over UDP. Please note
[UDP is unreliable](http://en.wikipedia.org/wiki/Syslog#Limitations).

Expand Down
4 changes: 2 additions & 2 deletions reference/promise-types/access.markdown
Expand Up @@ -399,10 +399,10 @@ access:
```

**Note:** This attribute is a noop when used with
[`protocol_version`][Components and Common Control#protocol_version] 2 or
[`protocol_version`][Components#protocol_version] 2 or
greater.

**See also:** [`protocol_version`][Components and Common Control#protocol_version], [`allowtlsversion`][cf-serverd#allowtlsversion], [`allowciphers`][cf-serverd#allowciphers], [`tls_min_version`][Components and Common Control#tls_min_version], [`tls_ciphers`][Components and Common Control#tls_ciphers], [`encrypt`][files#encrypt], [`logencryptedtransfers`][cf-serverd#logencryptedtransfers], [`ifencrypted`][access#ifencrypted]
**See also:** [`protocol_version`][Components#protocol_version], [`allowtlsversion`][cf-serverd#allowtlsversion], [`allowciphers`][cf-serverd#allowciphers], [`tls_min_version`][Components#tls_min_version], [`tls_ciphers`][Components#tls_ciphers], [`encrypt`][files#encrypt], [`logencryptedtransfers`][cf-serverd#logencryptedtransfers], [`ifencrypted`][access#ifencrypted]

### report_data_select

Expand Down

0 comments on commit f2d0aa1

Please sign in to comment.