OK, I am beginning to question either puppet+hiera's reliability or my 
sanity...

I have code I am working on. It is existing code in which has a bunch of 
variables prime for hiera use. I pull one variable out of the code into 
hiera for testing and it works well. Tweak the code and now I am only using 
hiera for that variable. Hooray!

Then i pull a second variable out. Nothing in hiera works now. There is 
*nothing* in the --debug log about hiera except for when it reads the 
/etc/puppet/hiera.yaml file and a few SELinux context pieces. Well that is 
weird. I didn't do anything different that I can tell...so I will revert 
back to my git commit to the last working state (the first variable). 
Nothing. I can't get it to do anything at all. I am at a complete loss as 
to why it stopped working.

On a hunch I did a 'sudo service puppetmaster restart' and the first 
variable started working again! Hooray! Why puppetmaster needs a restart, I 
have NO idea but whatever. Lets add a test dummy variable into hiera and do 
a simple notify. Nope. Broken again. Maybe another puppetmaster restart? 
Still no.

So either hiera is only capable of doing a single variable, or it /really/ 
hates me. I am willing to bet on the latter.

My code is literally only a single line in the hiera file (one for the host 
and one for common) 'repos::testvar blah' and 'repos::testvar yadda' and in 
my init.pp file I just added the one line in the declaration 
'$testvar=$repos::testvar' and in the class body I added 'notify {"test 
$testvar":}'. That apparently is enough to break puppet's integration with 
hiera.... Even a 'sudo service puppetmaster restart' doesn't fix that..If I 
reset those three lines then reset the puppetmaster, it start working 
again...

Well, maybe it is the code? Other then the name change there is nothing 
different than my SimpleHiera test. So I threw the notify code into that, 
and it works! In fact, the code working in the SimpleHiera test case I 
built earlier /while the other class is still enabled/. The repos class 
fails while the test code works! o_O     Just to clarify that point. The 
SAME code works in one module but not in the other! (obviously I changed 
the top level scope of the variables to match the module it was being 
referenced in; but the code is otherwise identical) Thus, puppet+hiera has 
a selective memory on which time it feels like looking up hiera 
data...<sarcasm>That sounds like a product I want to trust in production! 
</sarcasm>

How do people debug hiera in puppet? Everything /always/ works on the 
command line so I really don't think it is hiera nor my configuration of 
hiera. And there is never anything of use in the puppet logs. At least 
nothing I see with a 'puppet agent -t | egrep "hiera|repos|testvar". 

I have *got* to be missing something. I feel that the average puppet+hiera 
dev doesn't struggle constantly with puppet suddenly forgetting how to use 
hiera everytime they add a new variable. But I am at a loss as to what i am 
doing wrong...

Any help would be greatly appreciated. 

Thanks!
~Stack~

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/2ba2097a-47b1-449f-b598-f9b6de31262d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to