Node declaration

Our first piece will be the node declaration. This will go in our site.pp, and each application will go under a specific site call. In the following sample, notice the following:

  • All apps are declared in the top-level site{} declaration.
  • myapp {'myapp': } is just one possible app that can go in site.pp. We could have another beneath it called myapp.{'myapp2': } is inside of the site, and has a second standalone instance of this application.
  • Node['<nodename>'] and Myapp::<app> are capitalized.
  • I can still use the site.pp for other things, as indicated by the classification of the Puppet Master, as follows:
site {  myapp { 'myapp':      nodes => {        Node['mysql'] => [ Myapp::Db['myapp']], Node['appserver'] => [ Myapp::Web['myapp']], ...

Get Mastering Puppet 5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.