Closed major0 closed 8 years ago
What version of ruby are you using? Tp doesn't work on Ruby 1.8.7 https://github.com/example42/puppet-tp#prerequisites-and-limitations
# ruby --version
ruby 2.3.1p112 (2016-04-26) [x86_64-linux-gnu]
Sorry, I didn't read properly your extra info. The reason of your issue is that variable interpolation is currently not supported by TP when lookup into data files. Consider that tp does NOT actually uses hiera for lookups, it just emulates its behaviour (check a file called hiera.yaml for hiearchy and they traverse the hierarchy).
Also I don't fully understand what you expect to do in data/common.yaml with :
profiles::example::hierarchy:
- "%{::fqdn}"
- '"host/%%{}{::hostdata}"'
In any case those variables can't be interpolated by tp (edit: actually tp interpolates variables only in hiera.yaml, but not every possible variable, only the ones expected by the tp_lookup function. It does not interpolate variables in data files) and that's not a useful file for anything related to tiny puppet.
There could be some confusion among hiera, data in modules and tiny puppet.
Tiny Puppet has basically nothing to do with both of them but (probably to add confusion):
Hope to have clarified things a bit
Yes, that clarifies things. I had looked up the error and ran across a similar error, and advice to solving it in this post: https://ttboj.wordpress.com/2013/08/25/finding-yaml-errors-in-puppet/
The commands listed in the post found no direct parse error with our YAML data, and based on the output of the error I "assumed" that the error had something to do with TP's handling of data as it was returned from the Hiera data during automatic parameter expansion.
In this case assuming we have profiles::foo::bar defined in the hiera data and we have something like the following profile:
class profiles::foo ($bar = 'boo')
{
tp::install3 { 'foo': }
tp::conf3 { 'foo':
template => 'site/foo/config.erb',
options_hash => {
bar => $bar,
}
}
}
Any advice on how to narrow down what is causing the error?
I have located the problem, it was the wrong ruby version as you stated. I had a derp moment and collected data from the puppet agent as opposed to the server.
Expected Behavior
Expect tp::install3 to work on Puppet3/4.
Actual Behaviour
tp::install3 failing with an error, possibly due to obscure hiera lookups within the hiera data.
Steps to Reproduce the Problem
Trying to narrow down the exact trigger for this, but I suspect it is our use of
%%{}[label]
macros within our data/common.yaml. See: https://tickets.puppetlabs.com/browse/HI-127Examples:
Specifications