Skip to content

Instantly share code, notes, and snippets.

@nickanderson
Created October 3, 2022 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickanderson/2b9bd21eea0dbbb0cf89e5c434678558 to your computer and use it in GitHub Desktop.
Save nickanderson/2b9bd21eea0dbbb0cf89e5c434678558 to your computer and use it in GitHub Desktop.
How to inherit bundle scoped classes
bundle agent main
{
    methods: "guac";
}
bundle agent guac
{
    classes:
      "tomcat" expression => "guacamole";

    methods:
      "Taco"
        usebundle => taco,
        inherit => "true";
}
bundle agent taco
{
    reports:
      tomcat::
        "With tomcat on the side please";
      !tomcat::
        "No tomcat, thanks";
}
# cf-agent --no-lock --log-level info --file /home/nickanderson/org/roam/daily/work/cfengine3-tHYz8J
R: No tomcat, thanks
# cf-agent --define guacamole --no-lock --log-level info --file /home/nickanderson/org/roam/daily/work/cfengine3-is6sCY
R: With tomcat on the side please
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment