Issue #12923 has been updated by Nigel Kersten. Status changed from Needs Decision to Rejected
James has it right. Import isn't an area we're investing in, and there's a reasonably simple workaround here. Set the 'manifest' directive per-environment in puppet.conf, and then you can do relative imports based upon the environment. As of the next release of Puppet import will be deprecated, and the most frictionless way to work is going to be to use modules with the autoloader (which occurs per-environment. ---------------------------------------- Bug #12923: $environment doesn't work with import https://projects.puppetlabs.com/issues/12923#change-56062 Author: Nathan Campi Status: Rejected Priority: High Assignee: Nigel Kersten Category: environments Target version: Affected Puppet version: Keywords: Branch: Create a site.pp like this: <pre> notify { 'environment_notify': message => "NOTICE: This system is being configured with the environment ${environment}." } import "environments/$environment/nodes/*.pp" </pre> You'll get your environment in the notification, but then you'll get an error from the import like: <pre> err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not parse for environment production: Syntax error at 'environments/' at /etc/puppet/manifests/site.pp:27 on node foobar </pre> Puppet version 2.6.4 on client and server. It's entirely appropriate, IMHO, for puppet to be able to interpolate the $environment var on an import line. Thanks. -- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
