Thomas Hager
2014-Nov-04  15:08 UTC
[Puppet Users] Variable interpolation failing with structured facts
Hi,
While implementing custom facts in our environment I did some 
experimenting with structured
facts in our Puppet manifests. Puppet is 3.7.2, Facter is 2.3.0, Master 
and Agent run on the
same VM, future parser is on and stringify_facts is disabled.
I failed at using one of my custom facts (an array of hashes) in Puppet 
manifests,
so I did some tests with the "os" core fact and failed as well.
To debug my manifest I added these two notice() calls
notice($os[family])
notice("$os[family]")
and observed this output:
: (Scope(Class[Dummy])) RedHat
: (Scope(Class[Dummy])) {family => RedHat, name => CentOS, release => 
{major => 6, minor => 5, full => 6.5}}[family]
This is kinda weird, it seems as if Puppet fails to interpolate 
structured facts in double-quoted strings,
because both calls to notice() should output the same text, right?
Or did I miss something?
Cheers,
Tom.
-- 
Thomas "Duke" Hager                               duke@sigsegv.at
GPG: 2048R/791C5EB1            http://www.sigsegv.at/gpg/duke.gpg
================================================================"Never
Underestimate the Power of Stupid People in Large Groups."
-- 
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 puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/e20649e4f5bb92aac7d99b366dd64548%40sigsegv.at.
For more options, visit https://groups.google.com/d/optout.