Giter Site home page Giter Site logo

mericano1 / puppet-tomcat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from timidri/puppet-tomcat

0.0 2.0 0.0 268 KB

Puppet code for deploying and configuring Tomcat on Debian-like servers.

License: Apache License 2.0

Puppet 93.99% Ruby 0.53% Shell 5.49%

puppet-tomcat's Introduction

puppet-tomcat

Puppet code for deploying and configuring Tomcat multi-instance on Debian-like servers.

Dependencies:

'ripienaar/concat', '>=0.2.0'
'klangrud/profile_d', '>=0.0.1'
'proteon/maven', '>=1.0.1'
'proteon/java', '>=0.1.6'

Basic usage

To install Tomcat (optional)

include tomcat

Configure an instance

To create an instance

tomcat::instance { 'tomcat_1': }

A slightly more complicated example

tomcat::instance { 'tomcat_2':
  shutdown_port => '18005',
  apr_enabled   => false,
  min_heap      => '1024m',
  max_heap      => '2048m',
  min_perm      => '384m',
  max_perm      => '512m',
  unpack_wars   => false,
  auto_deploy   => false,
  java_version  => 'oracle_1_8_0',
  catalina_opts => ['-server, '-XX:+UseParNewGC', '-XX:ParallelGCThreads=2'],
}

Install a web application

To install a web application (.war)

tomcat::webapp { 'ROOT': 
  instance   => 'tomcat_02',
  source	 => 'puppet:///yourapplication/downloadable.war',
}

Install a web application from a maven repository

To install a web application (.war) from a maven artifact repository

tomcat::webapp::maven { 'testapplication': 
  instance   => 'tomcat_01',
  groupid    => 'com.yourcompany.project',
  artifactid => 'yourwebapp',
  version    => '1.0.0-SNAPSHOT',
  repos	 => ['http://maven.yourcompany.com/'],
}

Configure a jndi record for an instance

To add a database resource

tomcat::jndi::database { 'jdbc/database':
  instance    => 'tomcat_3',
  username    => 'root',
  password    => 'root',
  driver      => 'com.mysql.jdbc.Driver'
  url         => 'jdbc:mysql://localhost:3306/database',
}

To add a mysql database resource

tomcat::jndi::database::mysql { 'jdbc/mysqldb':
  instance    		 => 'tomcat_1',
  database	  		 => 'database_01',
  username	  		 => 'dbuser',
  password	  		 => 'qwerty',
  host        		 => 'db_server_1',
  use_unicode 		 => false,
  character_encoding => 'UTF-8',
}

To add an environment variable

tomcat::jndi::environment { 'greeting':
  instance    => 'tomcat_3',
  env_value   => 'hello world',
}

Configure a connector for an instance

This example will only enable the AJP connector for this instance, because the connector resource has the same title as the instance. Keep in mind that this won't create the default http connector it would when not specifying any connector.

tomcat::connector::ajp { 'tomcat_1':
  instance	=> 'tomcat_1',
  port 	=> 8009,
}

tomcat::instance { 'tomcat_1': }

Configure a realm (authentication) for an instance

To add a userdatabase with the 'MemoryUserDatabaseFactory' (tomcat-users.xml)

tomcat::realm::userdatabase { 'tomcat_1_userdatabase_realm':
  instance => 'tomcat_1'
}

Add roles to the userdatabase

tomcat::realm::userdatabase::role { ['role_1','manager-gui','admin-gui']: }

Add a user to the userdatabase (this example allows this user to use the manager applications)

tomcat::realm::userdatabase::user { 'user_1':
  instance => 'tomcat_1',
  password => '1_tacmot',
  roles    => 'manager-gui,admin-gui',
}

Configure clustering for an instance

To add simple clustering for instances

tomcat::cluster::simple { ['tomcat_1','tomcat_2','tomcat_3']: }

Configure the tomcat manager and host-manager

To add the manager applications for instances

tomcat::webapp::manager { ['tomcat_1','tomcat_2']:}

This will make them available at /manager and /host-manager

Configure the tomcat docs

To add the docs for instances

tomcat::webapp::docs { 'tomcat_1':}

This will make them available at /docs

Configure the tomcat example applications

To add the example applications for instances

tomcat::webapp::examples { 'tomcat_1':}

This will make them available at /examples

Upgrading / downgrading web-applications and libraries

When upgrading or downgrading applications installed using maven just update the artifact version number. In case of a ROOT application upgrade, the module will stop tomcat, remove the deployed application, clear out the temp and work directories and restart tomcat.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.