### Global `$facts` Hash
>
> You have to manually enable this (along with the `$trusted` hash) by  on
> your puppet master(s). It'll be on by default in Puppet 4.
>
> In addition to using `$fact_name`, you can now use `$facts[fact_name]` to
> get a fact value. The `$facts` hash is protected and can't be overridden
> locally, so you won't need the `$::` idiom when using this.
>
> Our hope is that this will visibly distinguish facts from normal
> variables, make Puppet code more readable, and eventually clean up the
> global variable namespace. (That'll take a while, though --- we probably
> won't be able to disable `$fact_name` until, like, Puppet 5.)
>
>

Out of curiosity what is the reasoning behind making facts different from
'normal' variables?  What is special about them compared to top-level
variables, hiera data or ENC variables? Whilst I think having facts in
their own protected namespace/hash is a long overdue and very good idea, in
my opinion having it scoped as a top-scope hash and referenced as
$::facts['value'] is not only more familiar to people already using Puppet
but is also a lot easier to understand than making them "special" and
referencing them as if they were locally scoped - to me that makes the code
less readable, rather than more.

Craig

-- 
*Enviatics *| Automation and configuration management
http://www.enviatics.com | @Enviatics
Puppet Training http://www.enviatics.com/training/

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-dev/CACxdKhHL5GjSRA%2BqP1V68%3DK9iEgN-RD46m6cumHeYO6pxz4s8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to