55dac85ffd398279d74e62b9540b9a6f38ac0603
[puppet_openvpn.git] / manifests / init.pp
1 # openvpn.pp
2
3 class openvpn {
4     package {
5         "openvpn":
6             ensure => installed;
7     }
8     service {
9         "openvpn":
10             ensure     => running,
11             hasrestart => true,
12             hasstatus  => true,
13             require    => Exec["/etc/default/openvpn concatenation"];
14     }
15     file {
16         "/etc/openvpn":
17             ensure  => directory,
18             require => Package["openvpn"];
19     }
20     file {
21         "/etc/openvpn/keys":
22             ensure  => directory,
23             require => File["/etc/openvpn"];
24     }
25     common::concatfilepart {
26         "00-etc-default-openvpn header":
27             ensure  => present,
28             content => template("openvpn/etc-default-openvpn.erb"),
29             notify  => Service["openvpn"],
30             file    => "/etc/default/openvpn";
31     }
32 }