# Import Deprecated Not Solved

I have been looking all over for a well documented answer to this. Please do not post the url from puppetlabs, as it isn't terribly informative, unless your already an expert in puppet. It leads me to believe that I can import anything in the manifests directory (site.pp) and then define nodes as a module? if that is the case, is there a way to have multiple node files in the manifests directory of that module as I don't want to put them all back into one file. In that post instead of the ongoing discussion of import they should have posted an example of the work around.

Also, it seems that a lot of people answer this with "move to hiera", is that the official answer? If so, I did look a that, but my node definitions have regex's in them, so defining a file under hiera/clientcert/ like puppet.mydomain.com doesn't work when your using a regex to match any puppet.. name in that domain.

Any clear help here would be appreciated. Thanks

edit retag close merge delete

What version of Puppet? Enterprise or Open Source?

( 2015-05-06 11:42:17 -0500 )edit

Sort by » oldest newest most voted

You cannot "define nodes as a module". However, I believe what you are looking for is a way to have node definitions split among multiple files. The answer to this depends on your puppet configuration:

• If you are using directory environments (i.e. you are using Puppet 4.x, Puppet Enterprise 3.7 or later, or you have an environmentpath setting declared), then your starting manifest is either the manifest setting from your environment's enviroment.conf file, or is the default_manifest setting from your puppet.conf file, both relative to the enviromment's base directory if they do not begin with a /.
• If you are not using directory environments (i.e you do not have an environmentpath setting declared), then your starting manifest is the manifest setting from your puppet.conf file.
• In either case:
• If your starting manifest is a single file (e.g. /etc/puppet/manifests/site.pp or manifests/site.pp), then that single file needs to contain all of your node definitions.
• If your starting manifest is a directory (e.g. manifests or /etc/puppet/manifests), then all .pp files within that directory will be imported in alphabetical order and your node definitions can be split among them all.

So to answer your question, you need to define your starting manifest to be a directory and then create your multiple node definition .pp files within that directory.

more

Thanks, I think that straightened me out. I have it up and working now. Appreciate the help.

( 2015-05-08 14:50:18 -0500 )edit

( 2015-05-08 18:15:50 -0500 )edit