summaryrefslogtreecommitdiff
path: root/sitemodules/profiles/manifests/sniproxy.pp
diff options
context:
space:
mode:
Diffstat (limited to 'sitemodules/profiles/manifests/sniproxy.pp')
-rw-r--r--sitemodules/profiles/manifests/sniproxy.pp33
1 files changed, 31 insertions, 2 deletions
diff --git a/sitemodules/profiles/manifests/sniproxy.pp b/sitemodules/profiles/manifests/sniproxy.pp
index a126739..7cba9b1 100644
--- a/sitemodules/profiles/manifests/sniproxy.pp
+++ b/sitemodules/profiles/manifests/sniproxy.pp
@@ -6,7 +6,7 @@
# Parameters
# ----------
#
-# -
+# @param https_forwards a list of server names to target ips/ports
#
# Examples
# --------
@@ -26,7 +26,9 @@
#
# Copyright 2017 Jan Dittberner
#
-class profiles::sniproxy {
+class profiles::sniproxy (
+ Array[String] $https_forwards,
+) {
file { '/etc/apt/sources.list.d/debian-testing.list':
ensure => file,
owner => 'root',
@@ -46,4 +48,31 @@ class profiles::sniproxy {
package { 'sniproxy':
ensure => present,
}
+
+ file { '/etc/default/sniproxy':
+ ensure => file,
+ owner => 'root',
+ group => 'root',
+ mode => '0644',
+ source => 'puppet:///modules/profiles/sniproxy/etc_default_sniproxy',
+ require => Package['sniproxy'],
+ }
+
+ file { '/etc/sniproxy.conf':
+ ensure => file,
+ owner => 'root',
+ group => 'root',
+ mode => '0644',
+ content => epp(
+ 'profiles/sniproxy/sniproxy.conf.epp',
+ {'https_forwards' => $https_forwards}
+ ),
+ require => Package['sniproxy'],
+ }
+
+ service { 'sniproxy':
+ ensure => running,
+ enable => true,
+ require => [Package['sniproxy'], File['/etc/default/sniproxy'], File['/etc/sniproxy.conf']],
+ }
}