Skip to content

ac3cloud/puppet-unicorn_systemd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

This module handles configuring and running unicorn service for systemd.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 72.6%
  • HTML 14.4%
  • Puppet 13.0%