Skip to content

Instantly share code, notes, and snippets.

@neilhwatson
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save neilhwatson/68291730393b4d3ca698 to your computer and use it in GitHub Desktop.

Select an option

Save neilhwatson/68291730393b4d3ca698 to your computer and use it in GitHub Desktop.
defaults in cfengine
body common control
{
bundlesequence => { "g", "main", };
}
bundle common g
{
defaults:
"a" string => "default value";
vars:
"b" string => ifelse(
"set", "set value for 'b'",
"default value for 'b'"
);
set::
"a" string => "A 'set' value";
}
bundle agent main
{
reports:
"a is ${g.a}";
"b is ${g.b}";
}
neil@ettin ~/.cfagent/inputs $ cf-agent -Kf ./default.cf
R: a is default value
R: b is default value for 'b'
neil@ettin ~/.cfagent/inputs $ cf-agent -Kf ./default.cf -D set
R: a is A 'set' value
R: b is set value for 'b'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment