5 releases since 2017-01-01
Version | Date |
---|---|
3.7.5 | 2017-03-30 |
3.10.1 | 2017-03-30 |
3.10.2 | 2017-08-11 |
3.11.0 | 2017-08-11 |
3.7.6 | 2017-09-12 |
Core | MPF | Docs | |
Commits | 256 | 163 | 207 |
Contributors | 24 | 14 | 17 |
New Contributors | 9 | 4 | 6 |
bundle agent main
{
vars:
"todo" slist => { "a 1", "b 2", "c 3" };
# Here, `with` is the canonified version of $(todo), letting us avoid an
# intermediate canonification array.
"$(with)" string => "$(todo)", with => canonify($(todo));
"complex" data => '
{
"x": 200,
"y": [ 1, 2, null, true, false ]
}
';
reports:
"For iterable '$(todo)' we created variable '$(with)' and its value is '$(todo)'"
with => canonify($(todo));
"We can print a data container compactly without creating a temporary variable: $(with)"
with => format("%S", complex);
"We can print a data container fully without creating a temporary variable: $(with)"
with => storejson(complex);
}
R: For iterable 'a 1' we created variable 'a_1' and its value is 'a 1'
R: For iterable 'b 2' we created variable 'b_2' and its value is 'b 2'
R: For iterable 'c 3' we created variable 'c_3' and its value is 'c 3'
R: We can print a data container compactly without creating a temporary variable: {"x":200,"y":[1,2,null,true,false]}
R: We can print a data container fully without creating a temporary variable: {
"x": 200,
"y": [
1,
2,
null,
true,
false
]
}
bundle agent main
{
vars:
"d" data => '{ "hello": "world", "feature": [ "render", "inline", "mustache" ] }';
files:
"/tmp/example.txt"
create => "true",
template_method => "inline_mustache",
edit_template_string => "{{%-top-}}",
template_data => @(d);
}
Results in /tmp/example.txt
having this content.
{
"feature": [
"render",
"inline",
"mustache"
],
"hello": "world"
}
NOTE: Current implementation discussion in progress in CFE-2741. Please consider participating.
{
"vars":{
"my_var": "defined in def.json",
"my_other_var": "Defined ONLY in def.json"
},
"augments": [
"/tmp/$(sys.flavor).json"
]
}
{
"vars": {
"my_var": "Overridden in centos_6.json",
"centos_6_var": "Defined ONLY in centos_6.json"
}
}
[root@hub tmp]# cf-agent -KIf ./example.cf
R: def.my_var == Overridden in centos_6.json
R: def.my_other_var == Defined ONLY in def.json
R: def.centos_6_var == Defined ONLY in centos_6.json
-
control_common_bundlesequence_end
-
control_common_update_bundlesequence_end
{ "vars":{ "control_common_bundlesequence_end": [ "mybundle1", "mybundle2" ], "control_common_update_bundlesequence_end": [ "my_updatebundle1", "mybundle2" ] } }
-
Order of bundle actuation not guaranteed.
-
Agent errors if named bundle is missing.
-
mpf_log_files_max_size
: Max file size before rotation -
mpf_log_file_retention
: Number of file rotations to keep -
mpf_log_dir_retention
: Number of file rotations to keep inoutputs
,reports
, and the Enterprise application log directory.{ "vars": { "mpf_log_file_retention": "5", "mpf_log_file_max_size": "10M", "mpf_log_dir_retention": "7" } }
-
control_executor_schedule
: Classes that trigger execution ofcf-agent
.{ "vars": { "control_executor_schedule": [ "Min00", "Min30" ] } }
-
control_executor_splaytime
: Maximum number of minutesexec_commad
should wait before executing.{ "vars": { "control_executor_splaytime": "3" } }
-
control_server_allowlegacyconnects
: List of subnets allowed to connect using legacy protocol (versions prior to 3.7.0).{ "vars": { "control_server_allowlegacyconnects": [ "0.0.0.0/0" ] } }
-
control_serverd_maxconnections
: Maximum number of connections allowed bycf-serverd
.{ "vars":{ "control_serverd_maxconnections": "1000" } }
-
control_hub_exclude_hosts
: List of subnets to exclude from hub initiated report collection. -
client_initiated_reporting_enabled
: List of classes that if defined should initiate reporting to an enterprise hub. -
control_server_call_collect_interval
: Number of minutes between client initiated reporting.{ "vars": { "control_server_call_collect_interval": "1", "control_hub_exclude_hosts": [ "0.0.0.0/0" ] },
"classes" { "client_initiated_reporting_enabled": [ "any" ] }
}
-
control_agent_files_single_copy
: List of regular expressions matching files that should not be copied more than once.{ "vars":{ "control_agent_files_single_copy": [ ".*" ] }
}
-
mpf_control_agent_default_repository
: List of classes class will cause these backups to be placed in$(sys.workdir)/backups
. -
control_agent_default_backup
: Directory where backups should be placed (defaults to$(sys.workdir/backups
).{ "classes": { "mpf_control_agent_default_repository": [ "any" ] },
"vars": { "control_agent_default_repository": "/var/cfengine/edit_backups" } }
-
dir_templates
: Path to common template directory. Shortcut provided bycf-serverd
astemplates/
.{ "vars": { "dir_templates": "/var/cfengine/mytemplates" } }
bundle agent example { files:
"$(def.dir_templates)/mytemplate.mustache" -> { "myservice" } copy_from => remote_dcp( "templates/mytemplate.mustache", $(sys.policy_server) ), comment => "mytemplate is necessary in order to render myservice configuration file.";
}
-
mpf_augments_control_enabled
: List of classes that automatic component restart on related data change should be enabled for.{ "classes":{ "mpf_augments_control_enabled": [ "any" ] } }
cf-agent -KIb host_info_report
### Inventory
#### Variables tagged for inventory
{
"default:cfe_autorun_inventory_disk.free": "5.00",
"default:cfe_autorun_inventory_listening_ports.ports": [
"22",
"25",
"53",
],
"default:cfe_autorun_inventory_memory.total": "32050.27",
"default:sys.arch": "x86_64",
"default:sys.cf_version": "3.11.0",
"default:sys.class": "linux",
"default:sys.cpus": "4",
"default:sys.flavor": "ubuntu_17",
"default:sys.hardware_addresses": [
"5c:e0:c5:9f:f3:8f",
"52:54:00:6b:62:06",
"02:42:79:79:f6:02",
"0a:00:27:00:00:00"
],
"default:sys.inet": {
"default_gateway": "192.168.42.1",
- Testing with 50,000 host data sets
- Easily find hosts by name, ip or identity
- Exported reports can now be sent as attachments in emails
- Policy Release Id
- AIX OS Level
curl --user admin -X POST \
-H 'content-type: application/json' \
https://hub/api/inventory -d '{ "select":[ "Host name", "OS type"]}'
{
"data": [
{
"header": [
{
"columnName": "Host name",
"columnType": "STRING"
},
{
"columnName": "OS type",
"columnType": "STRING"
}
],
"queryTimeMs": 11,
"rowCount": 2,
"rows": [
[
"host001",
"linux"
],
[
"hub",
"linux"
]
]
}
],
"meta": {
"count": 1,
"page": 1,
"timestamp": 1515607751,
"total": 1
}
}