Skip to content

Instantly share code, notes, and snippets.

@nickanderson
Created November 23, 2022 01:18
Show Gist options
  • Save nickanderson/e2bab253c2d4062086819ecf8126a9cc to your computer and use it in GitHub Desktop.
Save nickanderson/e2bab253c2d4062086819ecf8126a9cc to your computer and use it in GitHub Desktop.
Example for michael2 using variables to minimize other promises

using variables to minimize other promises

bundle agent __main__
{
    vars:
      "package"
        string => ifelse( "redhat", "httpd",
                          "debian", "apache2"
                          "UNKNOWN" ),
        if => not( isvariable( "package" ) ); # Allow the variable to be pre-defined, via augments

    packages:
       "$(package)"
         policy = "present",
         unless => strcmp( "$(package)", "UNKNOWN" );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment