unicorn_systemd

pdk
Manage systemd unit files of unicorn.

Okumura Takahiro

hfm

11,903 downloads

3,989 latest version

5.0 quality score

Version information

  • 2.2.0 (latest)
  • 2.1.0
  • 2.0.1
  • 2.0.0
  • 1.1.4
  • 1.1.3
  • 1.1.2
  • 1.1.1
  • 1.1.0
  • 1.0.1
  • 1.0.0
released Mar 19th 2019
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
  • RedHat
    ,
    CentOS
    ,
    Scientific
    ,
    Debian
    ,
    Ubuntu

Start using this module

Documentation

hfm/unicorn_systemd — version 2.2.0 Mar 19th 2019

puppet-unicorn_systemd

Build Status Puppet Forge

Table of Contents

  1. Description
  2. Usage - Configuration options and additional functionality
  1. Reference - An under-the-hood peek at what the module is doing and how
  1. Limitations - OS compatibility, etc.
  2. Development - Guide for contributing to the module

Description

This module handles configuring and running unicorn service for systemd.

Usage

Configuring unicorn_systemd

class { 'unicorn_systemd':
  user              => 'app',
  group             => 'app',
  working_directory => '/srv',
  pidfile           => '/var/run/unicorn.pid',
  exec_start        => '/usr/local/bin/unicorn -E $RAILS_ENV /srv/sample.ru',
  environment       => {
    'RAILS_ENV=production',
    'UNICORN_RB=config/unicorn.rb',
  }
}

Configuring modules from Hiera

---
unicorn_systemd::user: app
unicorn_systemd::group: app
unicorn_systemd::working_directory: /srv
unicorn_systemd::pidfile: /var/run/unicorn.pid
unicorn_systemd::exec_start: /usr/local/bin/unicorn -E $RAILS_ENV -c $UNICORN_RB /srv/sample.ru
unicorn_systemd::environment:
  RAILS_ENV: production
  UNICORN_RB: config/unicorn.rb

Reference

Classes

Public Classes

Parameters

unicorn_systemd

  • user: The user to execute the processes as. String type.
  • group: The group to execute the processes as. String type.
  • working_directory: The working directory for executed processes. String type.
  • pidfile: The pidfile for unicorn master process. String type.
  • exec_start: The commands with their arguments that are executed for this service. String type.
  • environment: The environment variables for executed processes. Hashes type.
  • ensure: Whether the unit files should exist. Valid options: present, absent, file. Default to present.
  • service_ensure: Whether the service should be enabled. String type. Defaults to running.
  • service_enable: Whether the service should be enabled. Boolean type. Defaults to true.

Limitations

This module has been tested on:

  • RedHat Enterprise Linux 7
  • CentOS 7
  • Scientific Linux 7
  • Debian 8
  • Ubuntu 16.04

Development

Running tests

The STNS puppet module contains tests for beaker-rspec (acceptance tests) to verify functionality. For detailed information on using these tools, please see their respective documentation.

Testing quickstart

  • Acceptance tests:
# Set your DOCKER_HOST variable
$ eval "$(docker-machine env default)"

# Run beaker acceptance tests
$ BEAKER_set=centos7 bundle exec rake beaker