From 86c536e48d4f01762905fae47e10705d8e80e112 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 4 Jan 2013 18:40:43 +0100 Subject: workaround the limitation that puppet can't do complex queries while collecting with stored configs --- manifests/init.pp | 5 +++-- templates/remote_host.erb | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 35555f6..2767783 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -51,8 +51,9 @@ class strongswan( right_subnet => $strongswan::default_left_subnet, tag => 'strongswan_auto' } - # collect all other auto exported except myself - Strongswan::Remote_Host<<| tag == 'strongswan_auto' and title != $::fqdn |>> + # collect all other auto exported + # myself is excluded in the template + Strongswan::Remote_Host<<| tag == 'strongswan_auto' |>> } if $manage_shorewall { diff --git a/templates/remote_host.erb b/templates/remote_host.erb index 9dff955..a67238e 100644 --- a/templates/remote_host.erb +++ b/templates/remote_host.erb @@ -1,4 +1,5 @@ # host <%= name %> +<% if scope.lookupvar('::fqdn') != left_id -%> conn <%= name %> <% if left_ip_address != 'absent' -%> left=<%= left_ip_address %> @@ -17,4 +18,8 @@ conn <%= name %> <% end -%> type=transport auto=start - +<% else -%> +# placeholder to not add ourself to the hostlist +# this is due to a limitations how puppet can collect +# exported resources +<% end -%> -- cgit v1.2.3