Ask Your Question
0

deprication of import

asked 2015-02-10 10:52:43 -0600

simonrondelez gravatar image

I noticed the deprication of the keyword import in my main manifest. I use it like this:

import "clouds/c1/*"

that way we can split our configurations up a bit. Is there a way to fix this deprication?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-02-10 15:07:14 -0600

GregLarkin gravatar image

The short answer is to refactor your Puppet code into autoloadable modules with the structure described here: https://docs.puppetlabs.com/puppet/latest/reference/lang_namespaces.html

The reasoning for deprecating and eventually removing the import keyword is as follows:

The distinction between import and include/class declaration confuses many users, and we've had a number of edge cases with import that have caused even more confusion.

The path forward is to structure your manifests in classes in modules, and to follow autoloader conventions. This does make Puppet much more opinionated, but we believe the benefits are worth it.

Particularly this will push people towards a world where Puppet manifests are more easily shareable in the form of modules, and by running everyone through the autoloader, we'll have a much more consistent set of behaviors.

Hope that helps!

edit flag offensive delete link more

Comments

where should i declare my nodes then? because there are no nodes in my site.pp but i sort them in sub directories

simonrondelez gravatar imagesimonrondelez ( 2015-02-10 16:14:58 -0600 )edit
GregLarkin gravatar imageGregLarkin ( 2015-02-10 16:52:32 -0600 )edit

thanks for the info!

simonrondelez gravatar imagesimonrondelez ( 2015-02-11 09:32:37 -0600 )edit

Glad to help!

GregLarkin gravatar imageGregLarkin ( 2015-02-11 10:38:35 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-02-10 10:52:43 -0600

Seen: 58 times

Last updated: Feb 10 '15