Skip to content

Instantly share code, notes, and snippets.

@neilhwatson
Last active August 29, 2015 13:57
Show Gist options
  • Save neilhwatson/9762620 to your computer and use it in GitHub Desktop.
Save neilhwatson/9762620 to your computer and use it in GitHub Desktop.
Defaults from other bundles.
body common control
{
bundlesequence =>
{ "main", };
}
bundle agent g
{
vars:
foo::
"masterfiles" string => "${sys.workdir}/repos/custom/masterfiles";
}
bundle agent c
{
defaults:
"masterfiles"
if_match_regex => "\$\{g\.masterfiles\}",
string => "${sys.workdir}/masterfiles";
vars:
"masterfiles" string => "${g.masterfiles}";
}
bundle agent main
{
meta:
"purpose" string => "Test defaults";
methods:
"vars" usebundle => g;
"config" usebundle => c;
"go" usebundle => test;
}
bundle agent test
{
reports:
"masterfiles => ${c.masterfiles}";
}
$ cf-agent -Kf ./defaults.cf
2014-03-25T10:08:47-0400 notice: R: masterfiles => /home/newatson/.cfagent/masterfiles
$ cf-agent -Kf ./defaults.cf -D foo
2014-03-25T10:08:50-0400 notice: R: masterfiles => /home/newatson/.cfagent/repos/custom/masterfiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment