summaryrefslogtreecommitdiff
path: root/puppet/modules/site_shorewall/manifests/couchdb/bigcouch.pp
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-04-02 15:38:54 -0700
committerelijah <elijah@riseup.net>2013-04-02 15:38:54 -0700
commitd2b525e0e471792ecc734b7b9f4f7ebcb98d868f (patch)
treec7f90bffed40f447d989518e1636216335761907 /puppet/modules/site_shorewall/manifests/couchdb/bigcouch.pp
parent4ed5d33f33c488a6a6d5f6a5e8f57b74ecd53a7d (diff)
parent1750bec7032e90ddbe43da35eb5f49066187d1d4 (diff)
Merge branch 'develop' of ssh://leap.se/leap_platform into develop
Diffstat (limited to 'puppet/modules/site_shorewall/manifests/couchdb/bigcouch.pp')
-rw-r--r--puppet/modules/site_shorewall/manifests/couchdb/bigcouch.pp36
1 files changed, 36 insertions, 0 deletions
diff --git a/puppet/modules/site_shorewall/manifests/couchdb/bigcouch.pp b/puppet/modules/site_shorewall/manifests/couchdb/bigcouch.pp
new file mode 100644
index 00000000..85272657
--- /dev/null
+++ b/puppet/modules/site_shorewall/manifests/couchdb/bigcouch.pp
@@ -0,0 +1,36 @@
+class site_shorewall::couchdb::bigcouch {
+
+ include site_shorewall::defaults
+
+ $stunnel = hiera('stunnel')
+ $bigcouch_replication_clients = $stunnel['bigcouch_replication_clients']
+
+ $bigcouch_replication_server = $stunnel['bigcouch_replication_server']
+ $bigcouch_replication_server_port = $bigcouch_replication_server['accept']
+ $bigcouch_replication_connect = $bigcouch_replication_server['connect']
+
+ # define macro for incoming services
+ file { '/etc/shorewall/macro.leap_bigcouch':
+ content => "PARAM - - tcp ${bigcouch_replication_server_port}",
+ notify => Service['shorewall'],
+ require => Package['shorewall']
+ }
+
+ shorewall::rule {
+ 'net2fw-bigcouch':
+ source => 'net',
+ destination => '$FW',
+ action => 'leap_bigcouch(ACCEPT)',
+ order => 300;
+ }
+
+ $bigcouch_shorewall_dnat_defaults = {
+ 'source' => '$FW',
+ 'proto' => 'tcp',
+ 'destinationport' => regsubst($bigcouch_replication_connect, '^([0-9.]+:)([0-9]+)$', '\2')
+ }
+
+ create_resources(site_shorewall::couchdb::dnat, $bigcouch_replication_clients, $bigcouch_shorewall_dnat_defaults)
+
+}
+