Skip to content

Instantly share code, notes, and snippets.

[
{
host : "server1",
a : 1,
b : 2
},
{
host : "server2",
c : 3,
d : 4
newatson@ltipc682:~/.cfagent/inputs$ cat rootw.cf
body common control
{
bundlesequence => { "main", };
}
bundle common main
{
vars:
"cf_version" string => "1.2.3";
@neilhwatson
neilhwatson / gist:1d41c696102c01bbb87a
Last active August 29, 2015 14:21
rspec, new version after some help
$ cat Rakefile
require 'rake'
require 'rspec/core/rake_task'
hosts = %w(
atlspf01
atlspf02
atlspf03
atlspf04
)
@neilhwatson
neilhwatson / efl_command.json
Created May 22, 2015 14:11
efl_command.json
[
{
"module" : "no",
"useshell" : "no",
"class" : "start_shorewall6",
"promisee" : "shorewall6",
"ifelapsed" : "1",
"command" : "/sbin/shorewall6 start"
},
{
@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
)
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: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
body common control
{
bundlesequence => { "main", };
}
bundle agent main
{
vars:
"ls" string => execresult( "/bin/ls -laZ /usr/bin/vim", "noshell" );
@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
@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";