Project

General

Profile

Actions

Bug #5571

closed

Puppet "each" function makes Foreman not show a class

Added by Vincent Miszczak almost 10 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
High
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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...

Actions #1

Updated by Stephen Benjamin almost 10 years ago

.each requires `parser = future` configured, is that enabled in the puppet.conf?

http://docs.puppetlabs.com/puppet/latest/reference/experiments_future.html#enabling-the-future-parser

Actions #2

Updated by Stephen Benjamin almost 10 years ago

Also `parser = future` needs to be in the [master] section not [main] for Foreman, that's due to #5522.

Actions #3

Updated by Vincent Miszczak almost 10 years ago

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, ...

Actions #4

Updated by Vincent Miszczak almost 10 years ago

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.

Actions #5

Updated by Dominic Cleal almost 10 years ago

  • 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.

Actions #6

Updated by Jason Knudsen almost 10 years ago

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.

Actions #7

Updated by Jason Knudsen almost 10 years ago

Oh and yes, I have parser = future in the main and master sections of puppet.conf

Actions #8

Updated by Jason Knudsen almost 10 years ago

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.

Actions #9

Updated by Anonymous almost 9 years ago

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.

Actions #10

Updated by Anonymous almost 9 years ago

  • Status changed from New to Feedback
Actions #11

Updated by Anonymous almost 7 years ago

  • Status changed from Feedback to Resolved

no reaction, closing

Actions

Also available in: Atom PDF