On Jan 9, 8:56 am, Olivier <ofran...@gmail.com>
wrote:> I am new to Puppet and am having a hard time relating modules and
> classes in configuration files to actual operating system files. For
> instance I saw the following example on this list:
[...]
At your stage and for this purpose you should probably ignore examples
on this list, unless they specify full paths to each file. It is
typical for us to omit or abrieviate file names and paths except when
we''re specifically discussing file locations.
> node ''somenode'' {
> include puppetmaster
>
> }
>
> class puppetmaster {
> include common
> include puppet
> include ldap_auth
> include iptables::disabled
> include httpd::ssl
> include ruby-enterprise::passenger
>
> }
>
> class ruby-enterprise::passenger {
> include common
> include httpd
> include ruby-enterprise
>
> }
>
> class httpd::ssl {
> include httpd }
>
> The base file where everything starts is /etc/puppetlabs/puppet/
> manifests/site.pp. Where do I define the puppetmaster class? Should I
> follow the structure shown on page 92 of the "Pulling Strings with
> Puppet" book?
Generally speaking, site.pp should contain only global declarations
(global variables, resource defaults, etc.) and often an
''import'' of a
separate manifest of node definitions (i.e. "import
''nodes.pp''").
When you''re just starting out, that one import is all you want or need
at first.
PuppetLabs recommends, and most users seem to agree, that the best
practice is to put substantially all class definitions in modules, and
to lay them out in files so that Puppet''s autoloader will find them
automatically. The Puppet module documentation explains the layout
needed to make that work; http://docs.puppetlabs.com/guides/modules.html.
Very simple example:
/etc/puppetlabs/puppet/manifests/site.pp
------
# site.pp
import ''nodes.pp''
/etc/puppetlabs/puppet/manifests/nodes.pp
------
# nodes.pp
node default {
include demo::hello
}
/etc/puppetlabs/puppet/modules/demo/manifests/init.pp
------
# module demo
# init.pp
# (empty)
/etc/puppetlabs/puppet/modules/demo/manifests/hello.pp
------
# module demo
# hello.pp
class demo::hello {
notify { "hello'':
message => "Hello, world!"
}
}
John
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.