Hi,

The variable I want to access is not defined in a module/class. It's the
globally defined $::environment. Since facts are also exposed as global
variables, the server-defined $::environment gets overridden when
there's a fact with the same name.

So any ideas on how to avoid that? As it is, it looks like a module
can't reliably detect environment, because a (potentially malicious)
client can send an 'environment' fact with arbitrary value.

Thanks,
Boyan

On 9.5.2014, 18:52, José Luis Ledesma wrote:
> you can use the Full qualified variable name like
> 
> ::class_name::variable
> 
> Regards,
> 
> El 09/05/2014 13:15, "Boyan Tabakov" <[email protected]
> <mailto:[email protected]>> escribió:
> 
>     Hi,
> 
>     The puppet master sets several global variables, including $environment,
>     $serverip, etc
>     
> (http://docs.puppetlabs.com/puppet/latest/reference/lang_facts_and_builtin_vars.html).
>     However, looks like client facts with the same names can mask out these
>     variables. How can one determine reliably the current environment inside
>     a manifest/module?
> 
>     I'd consider this an issue, for example, because with puppet 3+ the
>     environment set by ENC is authoritative and may differ from the
>     client-set environment and/or client fact with name 'environment'.
> 
>     Thanks!
> 
>     BR,
>     Boyan
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CAF_B3dceUO64PTQ0_tcVP2Vg9QDMHy1kqkRHjqfuoGP_DLR4tw%40mail.gmail.com
> <https://groups.google.com/d/msgid/puppet-users/CAF_B3dceUO64PTQ0_tcVP2Vg9QDMHy1kqkRHjqfuoGP_DLR4tw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to