Hi,

---
profiles:
  vpn:
    openvpn:
      defaults:
        client:
          dev:               'tun'
          proto:             'udp'
          resolv-retry:      'infinite'
          nobind:
          user:              'nobody'
          group:             'nogroup'
          persist-key:
          persist-tun:
          ca:                '/etc/openvpn/ca-charlieroot.de.crt'
          cert:              '/etc/openvpn/mail.helmut-ritter.de.crt'
          key:               '/etc/openvpn/mail.helmut-ritter.de.key'
          ns-cert-type:      'server'
          # OpenVPN <= 2.3
          comp-lzo:          'yes'
          # OpenVPN > 2.3
          # compress:          'lz4'
          log-append:        '/var/log/openvpn.log'
          verb:              '4'
          script-security:   '2'
          up:                '/etc/openvpn/update-resolv-conf'

The eep is called by

content => epp("openvpn/etc/openvpn/config.epp", { openvpnConf =>
$openvpnConf, openvpnMode => $openvpnMode, instance => $instance }),

The epp:

<%- | Hash $openvpnConf, String $openvpnMode, String $instance | -%>
<% ({
'Mode' => [
        "$openvpnMode",
],
'Connection' => [
        'remote',
        'proto',
        'dev',
        'persist-tun',
        'nobind',
        'resolv-retry',
        'compress',
        'comp-lzo',
],
'Privileges' => [
        'user',
        'group',
        'persist-key',
],
'Authentication' => [
        'cert',
        'key',
        'ca',
        'ns-cert-type',
],
'Logging' => [
        'verb',
        'log-append',
],
'Misc' => [
        'script-security',
        'plugin',
        'up',
        'down',
],
}).each |$category, $parameters| { -%>
### <%= $category %> ###
<%#= $openvpnConf %>
<% $parameters.each |$parameter| { -%>
<% if $parameter == 'remote' { -%>
<%= $parameter %> <%= $openvpnConf['server'] %> <%=
$openvpnConf['port'] %>
<% } elsif $openvpnConf[$parameter] { -%>
<%= $parameter %> <%= regsubst($openvpnConf[$parameter],
'__INSTANCE__', $instance) %>
<% } elsif defined($openvpnConf[$parameter]) { -%>
<%= $parameter %>
<% } -%>
<% } %>
<% } -%>

The problem: compress does not exist in the hiera but is printed in the
epp. How can I test if the key "compress" exists in the
$openvpnConf-Hash?

Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/xn0lcn8do1cf5g5000%40news.gmane.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to