glassfish

A plugin to manage Glassfish instalation and domains, system-properties, jdbc-connection-pools and jdbc-resources and application deployment.

Krzysztof Suszyński

wavesoftware

11,130 downloads

4,250 latest version

5.0 quality score

Version information

  • 1.0.0 (latest)
  • 0.4.0
released Jun 21st 2018
This version is compatible with:
  • Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.7.0 <6.0.0
  • CentOS
    ,
    Debian
    ,
    Ubuntu

Start using this module

Documentation

wavesoftware/glassfish — version 1.0.0 Jun 21st 2018

Puppet Glassfish plugin

This plugin for Puppet installs Glassfish Application Server and adds resource types and providers for managing Glassfish domains, system-properties, jdbc-connection-pools, jdbc-resources, custom-resources, auth-realms and application deployment by using the asadmin command line tool.

License: GPLv3

Default settings:

This plugin uses the executable asadmin of Glassfish instalation. Plugin installs Glassfish in version 3.1.2.2 as standard and using java-7-oracle (also supports other JDK versions: java-7-oracle, java-7-openjdk, java-6-oracle, java-6-openjdk). It will also starts it as a service.

Example instalation usage:

Simple (using defaults):

include glassfish

or explicit:

class { glassfish:
  java => 'java-7-openjdk', # optional, can be one of: java-7-oracle, java-7-openjdk, java-6-oracle, java-6-openjdk
  version => '3.1.2.2',     # glassfish version
  extrajars => [            # extra jars to install
    "http://jdbc.postgresql.org/download/postgresql-9.2-1002.jdbc4.jar",
  ],
}

More examples on using various types:

Domain {
  user         => 'gfish',
  asadminuser  => 'admin',
  passwordfile => '/home/gfish/.aspass',
}

domain {
  'mydomain':
    ensure => present;

  'devdomain':
    ensure   => present,
    portbase => '5000';

  'myolddomain':
    ensure => absent;
}

Systemproperty {
  user         => 'gfish',
  asadminuser  => 'admin',
  passwordfile => '/home/gfish/.aspass',
}

systemproperty { 'search-url':
  ensure   => present,
  portbase => '5000',
  value    => 'http://www.google.com',
  require  => Domain['devdomain'];
}

Jdbcconnectionpool {
  ensure              => present,
  user                => 'gfish',
  asadminuser         => 'admin',
  passwordfile        => '/home/gfish/.aspass',
  datasourceclassname => 'com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource',
  resourcetype        => 'javax.sql.ConnectionPoolDataSource',
  require             => Glassfish['mydomain'],
}

jdbcconnectionpool {'MyPool':
  properties => {
    'password' => 'mYPasS',
    'user' => 'myuser',
    'url' => 'jdbc:mysql://host.ex.com:3306/mydatabase',
    'useUnicode' => true,
    'characterEncoding' => 'utf8',
    'characterResultSets' => 'utf',
    'autoReconnect' => true,
    'autoReconnectForPools' => true,
  }
}

Jdbcresource {
  ensure       => present,
  user         => 'gfish',
  passwordfile => '/home/gfish/.aspass',
}

jdbcresource { 'jdbc/MyPool':
  connectionpool => 'MyPool',
}

Customresource {
  ensure       => present,
  restype => 'java.util.Properties',
  factoryclass => 'org.glassfish.resources.custom.factory.PropertiesFactory',
}

customresource { 'custom/SampleProperties':
  properties => {
    "type" => 'local',
    "path" => '/tmp/published',
  }
}

Application {
  ensure       => present,
  user         => 'gfish',
  passwordfile => '/home/gfish/.aspass',
}

application {
  'pluto':
    source => '/home/gfish/pluto.war';

  'myhello':
    source  => '/home/gfish/hello.war',
    require => Application['pluto'];
}

Jvmoption {
  ensure       => present,
  user         => 'gfish',
  passwordfile => '/home/gfish/.aspass',
}

jvmoption {
  ['-DjvmRoute=01', '-server']:
}

Authrealm {
  ensure       => present,
  user         => 'gfish',
  asadminuser  => 'admin',
  passwordfile => '/Users/larstobi/.aspass',
}

authrealm {
  'agentRealm':
    ensure     => present,
    classname  => 'com.sun.identity.agents.appserver.v81.AmASRealm',
    properties => ['jaas-context=agentRealm:foo=bar'],
    require    => Domain['mydomain'];
}