Skip to content

Commit acf4afe

Browse files
committed
Is this an improvement or not really?
1 parent 3273c30 commit acf4afe

File tree

1 file changed

+61
-34
lines changed

1 file changed

+61
-34
lines changed

reference/language-concepts/classes.markdown

Lines changed: 61 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -117,33 +117,64 @@ of a week.
117117
class an error will be emitted, for example `error: You cannot cancel a
118118
reserved hard class 'cfengine' in post-condition classes`.
119119

120-
* CFEngine-specific classes
121-
* `any`: this class is always set
122-
* `am_policy_hub`, `policy_server`: set when the file
123-
`$(workdir)/state/am_policy_hub` exists. When a host is [bootstrapped][cf-agent], if
124-
the agent detects that it is bootstrapping to itself the file is created.
125-
* `bootstrap_mode`: set when bootstrapping a host
126-
* `inform_mode`, `verbose_mode`, `debug_mode`: log verbosity levels in order of noisiness
127-
* `opt_dry_run`: set when the `--dry-run` option is given
128-
* `failsafe_fallback`: set when the base policy is invalid and the built-in `failsafe.cf` (see `bootstrap.c`) is invoked
129-
* (`community`, `community_edition`) and (`enterprise`, `enterprise_edition`): the two different CFEngine products, Community and Enterprise, can be distinguished by these mutually exclusive sets of hard classes
130-
* Component Specific Classes (each component has a class that is always considered defined by that component):
131-
* `cf-agent` :: ```agent```
132-
* `cf-serverd` :: ```server```
133-
* `cf-monitord` :: ```monitor```
134-
* `cf-execd` :: ```executor```
135-
* `cf-runagent` :: ```runagent```
136-
* `cf-key` :: ```keygenerator```
137-
* `cf-hub` :: ```hub```
138-
* `cf-promises` :: ```common```
120+
### CFEngine hard classes
121+
122+
Some hard classes are related to aspects of CFEngine itself, like the version and edition of CFEngine that is executing, CFEngine specific roles, options passed to the agent, features that are available.
123+
124+
| Class | Meaning | Example |
125+
| ```any``` | This class is always defined. | `any` |
126+
| ```cfengine``` | This class is always defined. | `cfengine` |
127+
| ```cfengine_<X>``` | This class is always defined where `<X>` represents the major version of CFEngine running. | `cfengine_3` |
128+
| ```cfengine_<X>_<Y>``` | This class is always defined where `<X>` represents the major version of CFEngine running and `<Y>` represents the minor version. | `cfengine_3_7`, `cfengine_3_24` |
129+
| ```cfengine_<X>_<Y>_<Z>``` | This class is always defined where `<X>` represents the major version of CFEngine running, `<Y>` represents the minor version, and `<Z>` represents the patch version. | `cfengine_3_7_1`, `cfengine_3_24.0` |
130+
| ```<X>_edition``` | This class is always defined indicating the edition of CFEngine. `*` | `enterprise_edition`, `community_edition` |
131+
| ```<edition>_<X>``` | This class is always defined when using the Enterprise edition of CFEngine where `<X>` is the major version of CFEngine. | `enterprise_3` |
132+
| ```<edition>_<X>_<Y>``` | This class is always defined when using the Enterprise edition of CFEngine where `<X>` is the major version and `<Y>` is the minor version of CFEngine. | `enterprise_3_7`, `enterprise_3_24`, `community_3_7`, `community_3_24` |
133+
| ```<edition>_<X>_<Y>_<Z>``` | This class is always defined when using the Enterprise edition of CFEngine where `<X>` is the major, `<Y>` is the minor, and `<Z>` is the patch version of CFEngine. | `enterprise_3_7_1`, `enterprise_3_24.0`, `community_3_7_1`, `community_3_24.0` |
134+
| ```agent``` | Defined when executing component is `cf-agent`. | ```agent``` |
135+
| ```server``` | Defined when executing component is `cf-serverd`. | ```server``` |
136+
| ```monitor``` | Defined when executing component is `cf-monitord`. | ```monitor``` |
137+
| ```executor``` | Defined when executing component is `cf-execd`. | ```executor``` |
138+
| ```runagent``` | Defined when executing component is `cf-runagent`. | ```runagent``` |
139+
| ```keygenerator``` | Defined when executing component is `cf-key`. | ```keygenerator``` |
140+
| ```hub``` | Defined when executing component is `cf-hub`. | ```hub``` |
141+
| ```common``` | Defined when executing component is `cf-promises`. | ```common``` |
142+
| ```feature``` | This class is always defined if the agent was compiled with at least one supported feature. | `feature` |
143+
| ```feature_<X>``` | This class is always defined if the agent was compiled with feature `<X>`. | `feature_def_json_preparse`, `feature_copyfrom_restrict_keys`, `feature_host_specific_data_load`, `feature_xml`, `feature_yaml`, `feature_tls` |
144+
| ```feature_tls_<X>``` | This class is always defined if the agent was compiled with support for specific major version (`<X>`) of tls. | `feature_tls_1` |
145+
| ```feature_tls_<X>_<Y>``` | This class is always defined if the agent was compiled with support for specific major (`<X>`) and minor (`<Y>`) of tls. | `feature_tls_1_0`, `feature_tls_1_3` |
146+
| ```am_policy_hub``` | Defined when the file `$(sys.workdir)/state/am_policy_hub** exists. `**` | `am_policy_hub` |
147+
| ```policy_server``` | Defined when the file `$(sys.workdir)/state/am_policy_hub` exists. `**` | `policy_server` |
148+
| ```bootstrap_mode``` | Defined when `cf-agent` is run with the `--bootstrap` option. `***` | `bootstrap_mode` |
149+
| ```inform_mode``` | Defined when `cf-agent` is run with inform logging (e.g. `--log-level info`, `--inform`, `-I**). `***` | `inform_mode` |
150+
| ```verbose_mode``` | Defined when `cf-agent` is run with verbose logging (e.g. `--log-level verbose`, `--verbose`, `-v`). `***` | `verbose_mode` |
151+
| ```debug_mode``` | Defined when `cf-agent` is run with debug logging (e.g. `--log-level debug`, `--debug`, `-d`). `***` | `debug_mode` |
152+
| ```opt_dry_run``` | Defined when `cf-agent` is run with the `--dry-run` option is given. `***` | `opt_dry_run` |
153+
| ```failsafe_fallback``` | Defined when the executing policy is invalid and the built-in `failsafe.cf` (see `bootstrap.c`) is invoked. | `failsafe_fallback` |
154+
155+
* `*` - A class without the `_edition` suffix is also defined.
156+
* `**` - When a host is [bootstrapped][cf-agent], if the agent detects that it is bootstrapping to itself the file `$(sys.workdir)/state/am_policy_hub** is created.
157+
* `***` - Some, but not all options define classes when they are defined.
158+
159+
### Operating system hard classes
139160
* Operating System Classes (note that the presence of these classes doesn't imply platform support)
140161
* Operating System Architecture - `arista`, `big_ip`, `debian`, `eos`, `fedora`, `Mandrake`, `Mandriva`, `oracle`, `redhat`, `slackware`, `smartmachine`, `smartos`, `solarisx86`, `sun4`, `SuSE`, `ubuntu`, `ultrix`, the always-favorite `unknown_ostype`, etc.
141162
* VM or hypervisor specific: `VMware`, `virt_guest_vz`, `virt_host_vz`, `virt_host_vz_vzps`, `xen`, `xen_dom0`, `xen_domu_hv`, `xen_domu_pv`, `oraclevmserver`, etc.
142163
* On Solaris-10 systems, the zone name (in the form `zone_global, zone_foo, zone_baz`).
143164
* Windows-specific: `DomainController`, `Win2000`, `WinServer`, `WinServer2003`, `WinServer2008`, `WinVista`, `WinWorkstation`, `WinXP`
144165
* `have_aptitude`, `powershell`, `systemd`: based on the detected capabilities of the platform or the compiled-in options
145166
* **See also:** `sys.arch`, `sys.class`, `sys.flavor`, `sys.os`, `sys.ostype`.
146-
* Network Classes
167+
168+
- The unqualified name of a particular host (e.g., `www`). If
169+
your system returns a fully qualified domain name for your host
170+
(e.g., `www.iu.hio.no`), CFEngine will also define a hard class for
171+
the fully qualified name, as well as the partially-qualified
172+
component names `iu.hio.no`, `hio.no`, and `no`.
173+
* **See also:** `sys.fqhost`, `sys.uqhost`.
174+
175+
are hostname classes related to os or networking?
176+
177+
### Networking hard classes
147178
* Unqualified Name of Host. CFEngine truncates it at the first dot.
148179
Note: `www.sales.company.com` and `www.research.company.com` have the
149180
same unqualified name - `www`
@@ -154,7 +185,16 @@ of a week.
154185
* User-defined Group of Hosts
155186
* `mac_unknown`: set when the MAC address can't be found
156187
* **See also:** `sys.domain`, `sys.hardware_addresses`, `sys.sys.host`, `sys.interface`, `sys.interfaces`, `sys.interface_flags`, `sys.ipv4`, `sys.ip_addresses`, `sys.fqhost`, `sys.uqhost`.
157-
* Time Classes
188+
189+
- The IP address octets of any active interface (in the form `ipv4_192_0_0_1`,
190+
`ipv4_192_0_0`, `ipv4_192_0`, `ipv4_192`), provided they are not excluded by
191+
a regular expression in the file `WORKDIR/ignore_interfaces.rx` or `WORKDIR/inputs/ignore_interfaces.rx`.
192+
- Note: Support and preference for `WORKDIR/ignore_interfaces.rx` was added
193+
and is present in version `3.23.0` and later and in version `3.21.4` and later.
194+
- The names of the active interfaces (in the form
195+
`net_iface_xl0`, `net_iface_vr0`).
196+
197+
### Time based hard classes
158198
* note ALL of these have a local and a GMT version. The GMT classes are consistent the world over, in case you need global change coordination.
159199
* Day of the Week - `Monday, Tuesday, Wednesday,...GMT_Monday, GMT_Tuesday, GMT_Wednesday,...`
160200
* Hour of the Day in Current Time Zone - `Hr00, Hr01,... Hr23` and `Hr0, Hr1,... Hr23`
@@ -170,23 +210,10 @@ of a week.
170210
* Lifecycle Index - `Lcycle_0, Lcycle_1, Lcycle_2` and `GMT_Lcycle_0, GMT_Lcycle_1, GMT_Lcycle_2` (the year number modulo 3, used in long term resource memory).
171211
* **See also:** `sys.cdate`, `sys.date`.
172212

173-
- The unqualified name of a particular host (e.g., `www`). If
174-
your system returns a fully qualified domain name for your host
175-
(e.g., `www.iu.hio.no`), CFEngine will also define a hard class for
176-
the fully qualified name, as well as the partially-qualified
177-
component names `iu.hio.no`, `hio.no`, and `no`.
178-
* **See also:** `sys.fqhost`, `sys.uqhost`.
179213
- An arbitrary user-defined string (as specified in the `-D`
180214
command line option, or defined in a [`classes` promise][classes] promise or
181215
[`classes` body][Promise types#classes],
182216
`restart_class` in a `processes` promise, etc).
183-
- The IP address octets of any active interface (in the form `ipv4_192_0_0_1`,
184-
`ipv4_192_0_0`, `ipv4_192_0`, `ipv4_192`), provided they are not excluded by
185-
a regular expression in the file `WORKDIR/ignore_interfaces.rx` or `WORKDIR/inputs/ignore_interfaces.rx`.
186-
- Note: Support and preference for `WORKDIR/ignore_interfaces.rx` was added
187-
and is present in version `3.23.0` and later and in version `3.21.4` and later.
188-
- The names of the active interfaces (in the form
189-
`net_iface_xl0`, `net_iface_vr0`).
190217
- System status and entropy information reported by
191218
`cf-monitord`.
192219

0 commit comments

Comments
 (0)