Puppet Class: openvpn::service

Inherits:
openvpn::params
Defined in:
manifests/service.pp

Overview

Class: openvpn::service

Ensure that the OpenVPN system service is enabled, if requested, expect on systemd distros.

Parameters:

  • enable (Boolean)


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

class openvpn::service
(
    Boolean $enable

) inherits openvpn::params {

    # Distros which have systemd treat each VPN connection as a separate 
    # service, so the "main" OpenVPN service should be disabled. This prevents
    # startup script from starting all OpenVPN connections on boot, as happens
    # by default on Debian 8.x unless /etc/default/openvpn is modified.
    #
    if str2bool($::has_systemd) {
        $service_enable = false
    } else {
        $service_enable = $enable
    }

    service { 'openvpn':
        name    => $::openvpn::params::service_name,
        enable  => $service_enable,
        require => Class['openvpn::install'],
    }
}