Skip to content

Instantly share code, notes, and snippets.

@jeffmccune
Created November 20, 2012 18:27
Show Gist options
  • Save jeffmccune/4119876 to your computer and use it in GitHub Desktop.
Save jeffmccune/4119876 to your computer and use it in GitHub Desktop.
Variable resolution

Top scope

$ puppet apply -e '$foo = "foovar"
class foo { $var = "in the class" }
include foo
notice "foo is ${::foo}"'
Scope(Class[main]): foo is foovar

Node Scope

This appears to be broken, even in master (3.0.1-271-g5ca331f)

$ puppet apply -e '
class foo { $var = "in the class" }
node default {
  $foo = "foovar"
  include foo
  notice "foo is ${::foo}"
}'
Scope(Node[default]): foo is
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment