Application components

Our myapp defined type will make use of the db resource we created in the previous section, passing four values to PuppetDB, directly from myapp::db. We'll use this manifest to build a MySQL server, and provide information to our WordPress instance on another node. Notice the following in the example:

  • A regular defined type, with standard Puppet DSL. We build a server and a database to support the app.
  • $host is not used in the manifest, but is passed along to the produced Db resource.
  • Myapp::Db produces Db is placed directly after the define, in the same manifest:
define myapp::db (  $dbuser,  $dbpass,  $host = $::fqdn,){  class {'::mysql::server':    root_password => 'Sup3rp@ssword!',    override_options => { 'mysqld' => { ...

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.