Version information
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
- , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'hfm-unicorn_systemd', '2.2.0'
Learn more about managing modules with a PuppetfileDocumentation
hfm/unicorn_systemd — version 2.2.0 Mar 19th 2019
puppet-unicorn_systemd
Table of Contents
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
unicorn_systemd
: Configures unicorn service files and sysconfig.
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
v2.2.0 (2019-03-19)
v2.1.0 (2018-08-11)
Release 2.0.1 (2017/04/13)
- #5 Remove .service suffix from unicorn service resource
Release 2.0.0 (2017/04/13)
- #4 Renewal
Release 1.1.4 (2016/05/07)
- #3 Support Xenial
Release 1.1.2 (2016/05/07)
- #2 Update comment
Release 1.1.0 (2016/03/28)
- #1 Enable to set environment parameter
Release 1.0.1 (2016/03/27)
- 6bd0db8 Fix specs
Release 1.0.0 (2016/03/23)
- Initial release.
Dependencies
- camptocamp-systemd (>= 0.0.0 < 3.0.0)
The MIT License (MIT) Copyright (c) 2016 OKUMURA Takahiro Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.