Skip to content

Latest commit

 

History

History
254 lines (145 loc) · 4.81 KB

File metadata and controls

254 lines (145 loc) · 4.81 KB

Reference

Table of Contents

Classes

Defined types

Classes

unicorn

Install and run unicorn.

Examples

unicorn::app { 'my-sinatra-app':
  approot     => '/opt/my-sinatra-app',
  pidfile     => '/opt/my-sinatra-app/unicorn.pid',
  socket      => '/opt/my-sinatra-app/unicorn.sock',
  user        => 'sinatra',
  group       => 'sinatra',
  preload_app => true,
  rack_env    => 'production',
  source      => 'bundler',
  require     => [
    Class['ruby::dev'],
    Bundler::Install[$app_root],
  ],
}

Parameters

The following parameters are available in the unicorn class:

export_home

Data type: Optional[Stdlib::Absolutepath]

Path to export the HOME environment.

Default value: undef

manage_package

Data type: Boolean

Whether to manage the unicorn package.

Default value: true

ensure

Data type: String[1]

State to ensure the unicorn package.

Default value: 'present'

provider

Data type: String[1]

The provider used to ensure the unicorn package.

Default value: 'gem'

unicorn::params

Params class with default values.

Defined types

unicorn::app

Defines a unicorn application

Parameters

The following parameters are available in the unicorn::app defined type:

approot

Data type: Stdlib::Absolutepath

Path to the application working directory.

pidfile

Data type: Stdlib::Absolutepath

Path to the PID file.

socket

Data type: Stdlib::Absolutepath

Path to socket file.

listens

Data type: Array

Additional listen directives other than the default socket.

Default value: []

export_home

Data type: Optional[Stdlib::Absolutepath]

Path to export the HOME environment.

Default value: undef

backlog

Data type: String

Value to set for the backlog on the listening socket.

Default value: '2048'

workers

Data type: Integer

Number of worker_processes to run.

Default value: $facts['processors']['count']

user

Data type: String[1]

Specify the user to run unicorn as.

Default value: 'root'

group

Data type: String[1]

Specify the group to run unicorn as.

Default value: 'root'

config_file

Data type: Optional[Stdlib::Absolutepath]

The path to install the configuration file.

Default value: undef

config_template

Data type: String[1]

The source template for the configuration file.

Default value: 'unicorn/config_unicorn.config.rb.erb'

initscript

Data type: Optional[String[1]]

The template to use for the unicorn init script.

Default value: undef

init_time

Data type: Integer

The time in seconds between checks for the old unicorn process during a service reload.

Default value: 15

logdir

Data type: Stdlib::Absolutepath

Path to the application log directory.

Default value: "${approot}/log"

rack_env

Data type: String[1]

The rack environment mode to start as.

Default value: 'production'

preload_app

Data type: Boolean

Whether to preload the application before forking worker processes.

Default value: false

source

Data type: String[1]

The daemon source used to run the application.

Default value: 'system'

extra_settings

Data type: Hash

A hash of additional settings to pass directly intol the application configuration file.

Default value: {}