Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save initcron/aa9dd03827a8d894bdecb0930fbb271b to your computer and use it in GitHub Desktop.
Save initcron/aa9dd03827a8d894bdecb0930fbb271b to your computer and use it in GitHub Desktop.

Coverting tomcat class into a parameterised class

class tomcat inherits tomcat::params{

class tomcat(
  $xms, 
  $xmx,
  $user, 
  $group, 
  $service_name,
  $service_state
 ) inherits tomcat::params{

Assigning default values to the parameters

class tomcat(
  $xms            = $::tomcat::params::xms, 
  $xmx            = $::tomcat::params::xmx,
  $user           = $::tomcat::params::user,
  $group          = $::tomcat::params::group, 
  $service_name   = $::tomcat::params::service_name,
  $service_state  = $::tomcat::params::service_state
) inherits tomcat::params{

Using resource like class declarations

Node definitions in app.pp change

from

include tomcat

to

  class {'tomcat':
    xms => "54m",
    xmx => "80m"
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment