summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-01-04 16:40:17 +0100
committermh <mh@immerda.ch>2013-01-04 16:40:17 +0100
commit770bc48ae57ca4ffb8294c8f96841a28ade8a9cf (patch)
treed1fcfb12a96f1f7f5e98f6e97348cdf023757732
parentb76b3287a6e4393ce7c87c757d7318447ae94f97 (diff)
make it possible to also define left parts
-rw-r--r--manifests/remote_host.pp3
-rw-r--r--templates/remote_host.erb9
2 files changed, 12 insertions, 0 deletions
diff --git a/manifests/remote_host.pp b/manifests/remote_host.pp
index de7a729..059d969 100644
--- a/manifests/remote_host.pp
+++ b/manifests/remote_host.pp
@@ -3,6 +3,9 @@ define strongswan::remote_host(
$right_ip_address,
$right_subnet = [],
$ensure = 'present',
+ $left_id = 'absent',
+ $left_ip_address = 'absent',
+ $left_subnet = [],
$right_id = $name,
$right_cert_name = $name,
$right_cert_content = 'absent'
diff --git a/templates/remote_host.erb b/templates/remote_host.erb
index a05378c..9dff955 100644
--- a/templates/remote_host.erb
+++ b/templates/remote_host.erb
@@ -1,5 +1,14 @@
# host <%= name %>
conn <%= name %>
+<% if left_ip_address != 'absent' -%>
+ left=<%= left_ip_address %>
+<% end -%>
+<% if left_id != 'absent' -%>
+ leftid=<%= left_id %>
+<% end -%>
+<% unless left_subnet.empty? %>
+ leftsubnet=<%= left_subnet.collect{|s| s.include?('/') ? s : (s.include?(':') ? "#{s}/128" : "#{s}/32" ) }.join(',') %>
+<% end -%>
right=<%= right_ip_address %>
rightid=@<%= right_id %>
rightcert=<%= right_cert_name %>.asc