Giter Club home page Giter Club logo

puppet-glassfish's Introduction

Puppet Glassfish Domain type

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

Copyright - Lars Tobias Skjong-Børsting [email protected]

License: GPLv3

Installation:

This plugin uses the executable "asadmin". For this plugin to work, the folder where the executable is located must exist in the PATH environment variable.

Place the "lib" folder and it's subfolders in the module path, i.e. /etc/puppet/modules/glassfish/lib/...

Example:

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

domain {
    "mydomain":
        ensure => present;

   "devdomain":
        portbase => "5000",
        profile => "devel",
        ensure => present;

    "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",
}

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"];
}

puppet-glassfish's People

Contributors

duncanphillips avatar kgintuit avatar larstobi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

puppet-glassfish's Issues

Better naming for define types

The naming of the define types should be change to something which better indicates the it belongs to the glassfish module. Domain, application, ... is way to generic.

Regards,
Matthias

err: Could not run Puppet configuration client: Could not find a default provider for domain

Hi,
I get the following error when I try and use your module.
Here is the relevant parts of my node.pp

    Domain {
            user => "glassfish",
            asadminuser => "admin",
            passwordfile => "/home/glassfish/.aspass",
    }

    domain {
            "domain1":
            ensure => present;

    }

    Systemproperty {
            user => "glassfish",
            asadminuser => "admin",
            passwordfile => "/opt/glassfishv3/.aspass",
    }

I have checked to make sure that the types and providers made it to the client node which they have. I am new to puppet so I am sort of at a loss on how to start debugging this. Thanks.

Ted

Manage JDBC database connections

Manage GlassFish's JDBC database connections with asadmin.

Ex.
asadmin create-jdbc-connection-pool [--datasourceclassname|--resourcetype] MyPool
asadmin create-jdbc-resource --connectionpoolid MyPool jdbc/MyPool

Support --domaindir

Support creating and managing domains and resources with the domaindir in a different folder than under glassfish/domains/ using the "--domaindir" option of the asadmin command.

glassfish application

It is correct to do
newparam(:adminport) do
desc "The Glassfish domain port base. Default: 4848"
defaultto "4848"
end

rather then
newparam(:portbase) do
desc "The Glassfish domain port base. Default: 4848"
defaultto "4800"
end

list-jvm-options doesn't match on options with a +

asadmin list-jvm-options, when the jvm has an option that contains a +, replaces the + with a space on output:

glassfish@wopr:$ asadmin --port 4948 --user admin --passwordfile /opt/glassfishv3/.aspass list-jvm-options | grep PrintGCDateStamps
-XX: PrintGCDateStamps
glassfish@wopr:
$

Thus any -XX: JVM option that has a + is added on each puppet run, because lib/provider/jvmoption/asadmin.rb doesn't correctly match.

Consider doing this instead:

def exists?
asadmin_exec(["list-jvm-options"]).each do |line|
line.sub!(/-XX: ([^\ ]+)/, '-XX:+\1')
if line.match(/^-.[^\ ]+/)
return true if @resource[:name] == line.chomp
end
end
return false
end

(Thankfully, asadmin list-jvm-options correctly displays -XX:-PrintGCDateStamps, or this woud have really sucked.)

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.