Puppet Class: netbox::service

Defined in:
manifests/service.pp

Summary

Manage the Netbox and Netvox-rq Systemd services

Overview

A class for running Netbox as a Systemd service

Parameters:

  • install_root (Stdlib::Absolutepath)

    The directory where the netbox installation is unpacked

  • user (String)

    The user running the service.

  • group (String)

    The group running the service.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'manifests/service.pp', line 16

class netbox::service (
  Stdlib::Absolutepath $install_root,
  String $user,
  String $group,
){

  $netbox_pid_file = '/var/tmp/netbox.pid'

  $service_params_netbox_rq = {
    'netbox_home'  => "${install_root}/netbox",
    'user'         => $user,
    'group'        => $group,
  }

  $service_params_netbox = {
    'netbox_home'  => "${install_root}/netbox",
    'user'         => $user,
    'group'        => $group,
    'pidfile'      => $netbox_pid_file,
  }

  systemd::unit_file { 'netbox-rq.service':
    content => epp('netbox/netbox-rq.service.epp', $service_params_netbox_rq),
    enable  => true,
    active  => true,
  }

  systemd::unit_file { 'netbox.service':
    content => epp('netbox/netbox.service.epp', $service_params_netbox),
    enable  => true,
    active  => true,
  }
}