Ask Your Question

Import Deprecated Not Solved

asked 2015-05-06 09:08:13 -0500

Havok gravatar image

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 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 flag offensive close merge delete


What version of Puppet? Enterprise or Open Source?

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

1 answer

Sort by ยป oldest newest most voted

answered 2015-05-06 12:22:32 -0500

JohnsonEarls gravatar image

updated 2015-05-06 12:23:42 -0500

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.

edit flag offensive delete link more


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

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

Please accept the answer so folks know this one's done :)

JohnsonEarls gravatar imageJohnsonEarls ( 2015-05-08 18:15:50 -0500 )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


Asked: 2015-05-06 09:08:13 -0500

Seen: 209 times

Last updated: May 06 '15