- Copy the contents of masterfiles into your masterfiles or equivalent repository.
- Include all EFL .cf files in your inputs list in the common control body. Example:
efl_lib.cf
bundle common efl_lib
{
| cat test | |
| $(sys.fqhost) | |
| bundle agent main | |
| { | |
| files: | |
| "/etc/test.tpl" | |
| copy_from => secure_cp("$(g.configfiles)/etc/test", "$(g.host)"), | |
| comment => "We must have a template that we can use to dynamically |
| "=app-backup/rdiff-backup-1.2.8-r1" | |
| package_policy => "add", | |
| package_select => "==", | |
| package_version => "1.2.8-r1", | |
| package_method => generic; |
| bundle agent app_dhcpd | |
| { | |
| classes: | |
| "any" expression => regextract( | |
| "([^\n]+)\.([^\n]+)\.([^\n]+)", | |
| "$(sys.ipv4_3[eth0])", | |
| "ip_addr" | |
| ); |
| infra:~ # cf-agent -KI | |
| !! Duplicate selection of value for variable "missing" in scope dead_hosts | |
| !! Rule from /var/cfengine/inputs/actions/update.cf at/before line 38 | |
| !! Duplicate selection of value for variable "missing" in scope dead_hosts | |
| !! Rule from /var/cfengine/inputs/actions/update.cf at/before line 38 | |
| ------------------- | |
| bundle agent dead_hosts { | |
| vars: | |
| "delay" int => "24"; |
| #!/var/cfengine/bin/cf-agent -f | |
| body common control { | |
| bundlesequence => { "main" }; | |
| } | |
| bundle agent main{ | |
| reports: | |
| cfengine:: | |
| "I can be executed like a shell script"; |