Skip to content

Instantly share code, notes, and snippets.

@tzz
tzz / gist:1b21612738e382444d3d
Created September 24, 2014 12:36
keybase.md
### Keybase proof
I hereby claim:
* I am tzz on github.
* I am tzz (https://keybase.io/tzz) on keybase.
* I have a public key whose fingerprint is 515E 6383 D9FF 31DA 0097 C47B 5280 002A A1CF EE16
To claim this, I am signing this object:
body common control
{
inputs => { "$(sys.libdir)/stdlib.cf" };
bundlesequence => { "run", "write" };
}
bundle agent run
{
vars:
"var_slist" slist => {
CFE policy:
body common control
{
bundlesequence => { holder, test_datastate_mustache };
}
bundle common holder
{
classes:
body common control
{
bundlesequence => { "legacy" };
inputs => { "$(sys.libdir)/stdlib.cf" };
}
bundle agent legacy
{
vars:
"groups" data => parsejson('{
body common control
{
bundlesequence => { holder, test_monit_mustache("ssh") };
}
bundle common holder
{
classes:
"holderclass" expression => "any"; # will be global
bundle agent main
{
methods:
"" usebundle => servers;
"" usebundle => serverp("ubuntu-server");
"" usebundle => serverp("fellini");
}
bundle common servers
{
bundle agent main
{
methods:
"" usebundle => basic_classes_vars;
"" usebundle => basic_classes("ubuntu-server");
# "" usebundle => basic_classes("fellini");
reports:
server::
"The server class is set";
@tzz
tzz / gist:e7829d0ea6e52a2daec9
Last active October 20, 2015 15:26
mapdata() example with CFEngine
bundle agent main
{
methods:
"test";
vars:
"test_state" data => bundlestate(test);
"test_string" string => storejson(test_state);
reports:
@tzz
tzz / test_container_iteration2.cf
Created November 14, 2015 12:05
Test CFEngine container iteration
body common control
{
bundlesequence => { "test" };
}
bundle agent test
{
vars:
"users" data => parsejson('
[
@tzz
tzz / set
Created April 19, 2016 00:15
(defun save-all-buffers ()
"Unconditionally save all modified buffers."
(interactive)
(save-some-buffers 1)
(message "All buffers saved"))
(add-hook 'focus-out-hook 'save-all-buffers)