This module handles configuring and running unicorn service for 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',
}
}
---
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
unicorn_systemd
: Configures unicorn service files and sysconfig.
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.
This module has been tested on:
- RedHat Enterprise Linux 7
- CentOS 7
- Scientific Linux 7
- Debian 8
- Ubuntu 16.04
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.
- Acceptance tests:
# Set your DOCKER_HOST variable
$ eval "$(docker-machine env default)"
# Run beaker acceptance tests
$ BEAKER_set=centos7 bundle exec rake beaker