Bug #5571
closed
Puppet "each" function makes Foreman not show a class
Added by Vincent Miszczak over 10 years ago.
Updated over 7 years ago.
Description
I have a Puppet class that contains :
$listen.each |$port|{
apache::listen{"$port": }
}
If the class has this, it won't appear in the importer.
If the class does not have this, class appears.
I've just installed Foreman and this is the first thing I tried to do and this is not working...
Also `parser = future` needs to be in the [master] section not [main] for Foreman, that's due to #5522.
I had this option enabled before installing Foreman on my test Puppet. Foreman replaced Puppet configuration and the value was not there anymore.
But if I put `parser = future` in [main], my class won't appear but worst, Foreman wants to remove all my classes !
production Remove: apache, ...
Vincent Miszczak wrote:
I had this option enabled before installing Foreman on my test Puppet. Foreman replaced Puppet configuration and the value was not there anymore.
But if I put `parser = future` in [main], my class won't appear but worst, Foreman wants to remove all my classes !
production Remove: apache, ...
You should have read `parser = future` in [*master*] ofc.
- Project changed from Foreman to Smart Proxy
- Category deleted (
Puppet integration)
If you're using Puppet 3.5 then there's also bug #5239 where our future parser support's currently broken.
I'm also seeing an issue whereby the foreman_proxy fails to import classes if they have 'future parser' code within.
ENV: CentOS 6.5
Puppet: 3.6.2
Foreman: 1.5.1
Error:
Error while parsing /path/to/init.pp: Could not match |$key, at line 404
Line 404 in init.pp:
each($foreman_api::servers) |$key, $value| {
My current workaround is to create a blank module, run the foreman classes import, then update the module to contain my future parsed code.
Oh and yes, I have parser = future in the main and master sections of puppet.conf
Upon further investigation, it seems to be a problem with determining which parser to use when it reads from puppet.conf, it doesn't discover that I'm using parser = future and continues to use the old parser. It may be something specific to my environment, but if I set eparser = true in the ruby code, it succeeds to import the class correctly.
I can't replicate the issue with Puppet 3.8.1: if the "parser" setting in puppet.conf is set to "future", modules containing future-parser compatible syntax get loaded and parsed as expected.
- Status changed from New to Feedback
- Status changed from Feedback to Resolved
Also available in: Atom
PDF