astral303 / yajsw-cookbook

Installs and manages 'Yet Another Java Service Wrapper'

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

yajsw-cookbook

Installs and manages 'Yet Another Java Service Wrapper'.

Read more about YAJSW

Supported Platforms

  • Ubuntu 14.x, 15.x
  • Centos 6.x, 7.x
  • Chef 12.5.x or higher. Chef 11 is NOT SUPPORTED.

Attributes

Key Type Description Default
node['yajsw']['url'] String Where to download YAJSW http://softlayer-dal.dl.sourceforge.net/project/yajsw/yajsw/yajsw-stable-11.11/yajsw-stable-11.11.zip
node['yajsw']['checksum'] String MD5 checksum of the downloaded archive. 3b4fff8475e48cb001c38a42c27c953b
node['yajsw']['dirname'] String Name of the extracted directory. yajsw-stable-11.11
node['yajsw']['basedir'] String The base directory to use for the YAJSW installation. /usr/local
node['yajsw']['apps_home'] String The directory to use for YAJSW managed application. /usr/local/yajsw_apps
node['yajsw']['piddir'] String The directory to use for YAJSW application pids. /var/run
node['yajsw']['user'] String The owner of the YAJSW installation. root
node['yajsw']['use_data_bag'] Boolean Collect application info from a data bag instead of node attributes. false
node['yajsw']['data_bag_name'] String Name of the data bag to collect application information. yajsw
node['yajsw']['use_env_data_bags'] Boolean Appends the environment to the end of the data bag name. (ie. 'yajsw' becomes 'yajsw_prod') true
node['yajsw']['apps'] Array The array of application configurations (if not using data bags).
    [{
      'name' => 'myapp',
      'user' => 'yajsw',
      'initmemory' => 64,
      'maxmemory' => 256,
      'mainclass' => 'com.company.myapp',
      'jar' => 'lib/com.company.myapp.jar',
      'classpath' => [],
      'additional' => ['-server', '-Dfile.encoding=UTF-8'],
      'parameters' => ['-a', '-b', 'foobar', '-c'],
      'logfile' => {
        'maxfiles' => 10,
        'maxsize' => '10m',
        'loglevel' => 'INFO'
      }
    }]
      

Usage

yajsw::default

Include yajsw in your node's run_list:

{
  "run_list": [
    "recipe[yajsw::default]"
  ]
}

The default implementation will install yajsw in /usr/local/ and create an application dir in /usr/local/yajsw_apps.

Custom Resources

If you prefer, you can use the YAJSW recipes individually, or configure your application with the included Custom Resources.

yajsw_install

yajsw_install will install the specified version of yajsw

    yajsw_install 'default' do
      marker 'stable'
      version '11.11'
      checksum 'aeb845a7d77184b8a1cbd68ae26c7f07a74952f6e79fb31d3f8f41ba52c4c872'
      user yajsw
      action :create
    end

yajsw_app

yajsw_app will configure an instance of YAJSW

  logfile = { 'maxfiles' => 10, 'maxsize' => '10m', 'loglevel' => 'INFO' }
  yajsw_app 'myapp' do
    user 'yajsw'
    mainclass 'com.company.myapp'
    jar 'lib/com.company.myapp.jar'
    classpath []
    additional ['-server', '-Dfile.encoding=UTF-8']
    parameters ['-a', '-b', 'foobar', '-c']
    initmemory 16
    maxmemory 256
    logfile logfile
    create_user true
    action [:create, :update]
  end

Data Bags

TODO: implement this functionality

If node['yajsw']['use_data_bag'] is true, yajsw will require a data bag in the following format:

License and Authors

Copyright (C) 2015-2016 NorthPage

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Installs and manages 'Yet Another Java Service Wrapper'

License:Apache License 2.0


Languages

Language:HTML 53.1%Language:Ruby 42.7%Language:Shell 4.3%