Skip to content

Instantly share code, notes, and snippets.

Installation

  1. Copy the contents of masterfiles into your masterfiles or equivalent repository.
  2. Include all EFL .cf files in your inputs list in the common control body. Example:
bundle common efl_lib
{
   vars:
      cfengine_3_6::
@neilhwatson
neilhwatson / gist:baad0e7723156db11d62
Last active August 29, 2015 14:13
Rootwyrm_'s bug
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('
[
@neilhwatson
neilhwatson / gist:37281236b49d1cc9f046
Last active August 29, 2015 14:17
3.6.5 test failure for jimis
./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
@neilhwatson
neilhwatson / gist:68291730393b4d3ca698
Last active August 29, 2015 14:17
defaults in cfengine
body common control
{
bundlesequence => { "g", "main", };
}
bundle common g
{
defaults:
"a" string => "default value";
@neilhwatson
neilhwatson / gist:d49be0831bd48613ff31
Last active August 29, 2015 14:18
CFEngine proc builds
# 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" );
@neilhwatson
neilhwatson / gist:5cb7b47d17349e3a4a52
Last active August 29, 2015 14:19
ntp.conf for McWaffel
# /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
@neilhwatson
neilhwatson / gist:81249ad393800a76a8ad
Last active August 29, 2015 14:21
serverspec files testing multiple hosts at once. How to get a summary report of host failures?
$ cat Rakefile
require 'rake'
require 'rspec/core/rake_task'
hosts = %w(
atlspf01
atlspf02
atlspf03
atlspf04
)