- 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:
bundle common efl_lib
{
vars:
cfengine_3_6::
| body common control | |
| { | |
| bundlesequence => { "init", "work", "check" }; | |
| } | |
| bundle agent init | |
| { | |
| vars: | |
| "contents" slist => { | |
| "root neil", |
| body common control | |
| { | |
| bundlesequence => { "log", "test" }; | |
| } | |
| bundle agent log | |
| { | |
| vars: | |
| "x" data => parsejson(' | |
| [ |
| ./testall --agent=/usr/bin/cf-agent 01_vars/02_functions/network/selectservers.cf | |
| ====================================================================== | |
| Testsuite started at 2015-03-13 10:21:45 | |
| ---------------------------------------------------------------------- | |
| Total tests: 1 | |
| CRASHING_TESTS: enabled | |
| NETWORK_TESTS: enabled | |
| STAGING_TESTS: disabled | |
| UNSAFE_TESTS: disabled |
| body common control | |
| { | |
| bundlesequence => { "g", "main", }; | |
| } | |
| bundle common g | |
| { | |
| defaults: | |
| "a" string => "default value"; |
| # lsof -p 32741 | |
| COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | |
| cf-agent 32741 root cwd DIR 253,0 4096 352257 /root | |
| cf-agent 32741 root rtd DIR 253,0 4096 2 / | |
| cf-agent 32741 root txt REG 253,1 414225 2395737 /var/cfengine/bin/cf-agent | |
| cf-agent 32741 root mem REG 253,1 57344 2392212 /var/cfengine/state/cf_lock.lmdb | |
| cf-agent 32741 root mem REG 253,0 383504 466954 /lib64/libfreebl3.so | |
| cf-agent 32741 root mem REG 253,0 65928 467323 /lib64/libnss_files-2.12.so | |
| cf-agent 32741 root mem REG 253,0 113432 467319 /lib64/libnsl-2.12.so | |
| cf-agent 32741 root mem REG 253,0 40400 466973 /lib64/libcrypt-2.12.so |
| body common control | |
| { | |
| bundlesequence => { "main", }; | |
| } | |
| bundle agent main | |
| { | |
| vars: | |
| "ls" string => execresult( "/bin/ls -laZ /usr/bin/vim", "noshell" ); |
| # /etc/ntp.conf, configuration for ntpd | |
| driftfile /var/lib/ntp/ntp.drift | |
| statsdir /var/log/ntpstats/ | |
| statistics loopstats peerstats clockstats | |
| filegen loopstats file loopstats type day enable | |
| filegen peerstats file peerstats type day enable | |
| filegen clockstats file clockstats type day enable |
| Begin Parsing file './Innek.cf' | |
| End Parsing file './Innek.cf' | |
| Running full policy integrity checks | |
| ------------------------------------------------------------------------ | |
| PREFIX LEGEND: | |
| V: variable or parameter new definition in scope | |
| C: class/context new definition | |
| B: bundle start/end execution marker | |
| P: promise execution output | |
| A: accounting output |
| $ cat Rakefile | |
| require 'rake' | |
| require 'rspec/core/rake_task' | |
| hosts = %w( | |
| atlspf01 | |
| atlspf02 | |
| atlspf03 | |
| atlspf04 | |
| ) |