diff options
author | mh <mh@immerda.ch> | 2013-01-04 18:40:43 +0100 |
---|---|---|
committer | mh <mh@immerda.ch> | 2013-01-04 18:40:43 +0100 |
commit | 86c536e48d4f01762905fae47e10705d8e80e112 (patch) | |
tree | 0e89a081bb5c16e11f3dae5ab560d62e585f6073 | |
parent | 3cc70ef0c9f2b2eef4b251358fd89559e763b471 (diff) |
workaround the limitation that puppet can't do complex queries while collecting with stored configs
-rw-r--r-- | manifests/init.pp | 5 | ||||
-rw-r--r-- | 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 -%> |