Puppet Class: unicorn_systemd

Defined in:
manifests/init.pp

Overview

Class: unicorn_systemd

This class install and configure systemd unit files for unicorn

Parameters:

  • user (String)
  • group (String)
  • working_directory (String)
  • pidfile (String)
  • environment (Hash[String, String])
  • exec_start (String)
  • ensure (String) (defaults to: present)
  • service_ensure (String) (defaults to: running)
  • service_enable (Boolean) (defaults to: true)


5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'manifests/init.pp', line 5

class unicorn_systemd (
  String $user,
  String $group,
  String $working_directory,
  String $pidfile,
  Hash[String, String] $environment,
  String $exec_start,
  String $ensure = present,
  String $service_ensure = running,
  Boolean $service_enable = true,
) {

  include ::systemd

  file { '/etc/systemd/system/unicorn.service':
    ensure  => $ensure,
    content => template('unicorn_systemd/unicorn.service.erb'),
    owner   => 'root',
    group   => 'root',
    notify  => Exec['systemctl-daemon-reload'],
  }

  service { 'unicorn':
    ensure  => $service_ensure,
    enable  => $service_enable,
    require => File['/etc/systemd/system/unicorn.service'],
  }

}