Node definitions in 3.6 directory environments

105 views
Skip to first unread message

Paul Seymour

unread,
May 19, 2014, 4:05:26 AM5/19/14
to puppet...@googlegroups.com
Hello,

Could I ask for a little clarification over node definitions in 3.6+ and directory environments please.

On our 2.7 masters we have an /etc/puppet/manifests/site.pp with some defaults within it.

import "nodes/*.pp"

filebucket { 'main':
  server => 'puppet.dev',
  path   => false,
}

File {
  backup => 'main',
}

node default {
  .. Some default modules for all nodes..
}

And this in the puppet.conf

[dev]
    modulepath = /etc/puppet/environments/dev/modules

And all the <nodes>.pp files are then imported based on the hostname.

Now on a new 3.6 server that I am testing/setting up I have the following in puppet.conf

    environmentpath = $confdir/environments
    basemodulepath  = $confdir/modules

And in the /etc/puppet/environments/dev directory I have now
$ ls -l
-rw-r--r--   1 root root   57 May 19 08:44 environment.conf
lrwxrwxrwx   1 root root   21 May 16 15:12 manifests -> /etc/puppet/manifests
drwxr-xr-x 180 root root 4096 May 15 13:46 modules

Which seems to be functioning. But I am concerned that I am not doing it the "best practice" way with the import still in there and
what not.

So is there a better way to lay this out or do I remove the "import" statement and bring all the <node>.pp files back into the same
place as site.pp etc ?

Thanks
Paul

Henrik Lindberg

unread,
May 19, 2014, 5:12:03 PM5/19/14
to puppet...@googlegroups.com
The replacement for import is to place all of your "initial content" in
the same directory - they are processed in alphanumerical order based on
the file name.

See

http://docs.puppetlabs.com/puppet/latest/reference/lang_import.html#what-to-use-instead

http://docs.puppetlabs.com/puppet/latest/reference/dirs_manifest.html

- henrik

> Thanks
> Paul
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users...@googlegroups.com
> <mailto:puppet-users...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/4c21998c-419e-4ebf-992d-9566176df83a%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/4c21998c-419e-4ebf-992d-9566176df83a%40googlegroups..com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.


--

Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/

Reply all
Reply to author
Forward
0 new messages