Skip to content

Instantly share code, notes, and snippets.

@dcarley
Created May 22, 2012 10:43
Show Gist options
  • Save dcarley/2768256 to your computer and use it in GitHub Desktop.
Save dcarley/2768256 to your computer and use it in GitHub Desktop.
Puppet require meta-param on define()
dan@dan-MacPro ~/projects/vagrant/labs/puppet $ puppet apply
define foo() {
notify { $name: }
}
foo { "baz":
require => Foo['bar'],
}
foo { "bar": }
^D
notice: bar
notice: /Stage[main]//Foo[bar]/Notify[bar]/message: defined 'message' as 'bar'
notice: baz
notice: /Stage[main]//Foo[baz]/Notify[baz]/message: defined 'message' as 'baz'
notice: Finished catalog run in 0.01 seconds
dan@dan-MacPro ~/projects/vagrant/labs/puppet $ puppet apply
define foo() {
notify { $name: }
}
foo { "baz":
require => Foo['bar'],
}
^D
Could not find dependency Foo[bar] for Foo[baz] at line 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment