summaryrefslogtreecommitdiff
path: root/puppet/modules/openvpn/manifests/init.pp
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-07-21 12:13:33 -0700
committerelijah <elijah@riseup.net>2016-07-21 12:13:33 -0700
commit2df23a682b9a1a99502c79d7112dcefeecf63619 (patch)
tree80b3acab77cad9323f21bad035f31f660fad8ddd /puppet/modules/openvpn/manifests/init.pp
parentd6719731dce8ee7e048a16a447a426abcaa44f24 (diff)
git subrepo clone https://leap.se/git/puppet_openvpn puppet/modules/openvpn
subrepo: subdir: "puppet/modules/openvpn" merged: "ba7ec7a" upstream: origin: "https://leap.se/git/puppet_openvpn" branch: "master" commit: "ba7ec7a" git-subrepo: version: "0.3.0" origin: "https://github.com/ingydotnet/git-subrepo" commit: "cb2995b"
Diffstat (limited to 'puppet/modules/openvpn/manifests/init.pp')
-rw-r--r--puppet/modules/openvpn/manifests/init.pp45
1 files changed, 45 insertions, 0 deletions
diff --git a/puppet/modules/openvpn/manifests/init.pp b/puppet/modules/openvpn/manifests/init.pp
new file mode 100644
index 00000000..a3dd70c0
--- /dev/null
+++ b/puppet/modules/openvpn/manifests/init.pp
@@ -0,0 +1,45 @@
+# openvpn.pp
+
+class openvpn {
+ package {
+ 'openvpn':
+ ensure => installed;
+ }
+ service {
+ 'openvpn':
+ ensure => running,
+ enable => true,
+ hasrestart => true,
+ hasstatus => true,
+ require => Exec['concat_/etc/default/openvpn'];
+ }
+ file {
+ '/etc/openvpn':
+ ensure => directory,
+ require => Package['openvpn'];
+ }
+ file {
+ '/etc/openvpn/keys':
+ ensure => directory,
+ require => File['/etc/openvpn'];
+ }
+
+ include concat::setup
+
+ concat {
+ '/etc/default/openvpn':
+ owner => root,
+ group => root,
+ mode => 644,
+ warn => true,
+ notify => Service['openvpn'];
+ }
+
+ concat::fragment {
+ 'openvpn.default.header':
+ content => template('openvpn/etc-default-openvpn.erb'),
+ target => '/etc/default/openvpn',
+ order => 01;
+ }
+
+}