Example: Recipe with parameters
If you pass the supported parameters in a recipe, their values are dynamically fetched and replaced.
Example recipe template (the
{{{general.clusterName}}}
is included as a
template):#!/bin/bash -e
function setupDefaultClusterFolder() {
mkdir -p /var/log/{{{general.clusterName}}}
}
main() {
setupDefaultClusterFolder
}
[[ "$0" == "$BASH_SOURCE" ]] && main "$@"
Example recipe after
{{{general.clusterName}}}
is set to
my-super-cluster
based on the actual cluster
name:#!/bin/bash -e
function setupDefaultClusterFolder() {
mkdir -p /var/log/my-super-cluster
}
main() {
setupDefaultClusterFolder
}
[[ "$0" == "$BASH_SOURCE" ]] && main "$@"