Skip to content

Instantly share code, notes, and snippets.

@acobaugh
Created February 9, 2017 20:08
Show Gist options
  • Select an option

  • Save acobaugh/69b3c9e37070f757e5d67c1ca991ab92 to your computer and use it in GitHub Desktop.

Select an option

Save acobaugh/69b3c9e37070f757e5d67c1ca991ab92 to your computer and use it in GitHub Desktop.

Revisions

  1. Andy Cobaugh created this gist Feb 9, 2017.
    55 changes: 55 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,55 @@
    body common control {
    bundlesequence => { "main" };
    }

    bundle agent main {
    vars:
    "notempty" string => "foo";
    "notempty2" string => "bar";
    "data_string" string => string_mustache("not empty = {{vars.main.notempty}} ; empty = {{^vars.main.empty}}default{{/vars.main.empty}} ; not empty with default = {{^vars.main.notempty2}}default{{/vars.main.notempty2}}");
    reports:
    any::
    "$(data_string)";

    }

    $ cf-agent -K -f `pwd`/test.cf
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    R: $(data_string)
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.
    warning: Mustache sections can only take a boolean or a container (array or map) value, but section 'vars.main.notempty2' isn't getting one of those.



    body common control {
    bundlesequence => { "main" };
    }

    bundle agent main {
    vars:
    "notempty" string => "foo";
    "data_string" string => string_mustache("not empty = {{vars.main.notempty}} ; empty = {{^vars.main.empty}}default{{/vars.main.empty}}");
    reports:
    any::
    "$(data_string)";

    }

    $ cf-agent -K -f `pwd`/test.cf
    R: not empty = foo ; empty = default