On Mar 20, 12:40 pm, Peter Meier <peter.me...@immerda.ch> wrote:

> case $sshd_listen_address {
>    '': {
>      if $ipaddress_eth1 {
>        $sshd_listen_address = $ipadress_eth1
>      } else {
>        $sshd_listen_address = $ipaddress
>      }
>    }
> }

Oh.. I was thinking about putting the logic inside the template, but
see that maybe it fits better in the manifest. So I tried this in the
ssh class manifest:

    case $sshd_listen_address {
        '': {
            if $ipaddress_eth1 {
                $sshd_listen_address = $ipadress_eth1
            } else {
                $sshd_listen_address = $ipaddress
            }
        }
    }
    file { "/etc/ssh/sshd_config":
        owner   => root,
        group   => root,
        mode    => 400,
        content => template("ssh/sshd_config.erb"),
        require => [ Package["openssh-server"], Class["banner"],
File["/etc/pam.d/sshd"] ]
    }

and only use a "ListenAddress   <%= sshd_listen_address %>" in the
template. But this gives me a blank listenaddress if
$sshd_listen_address isn't defined in the node, so I'm wondering if
this is maybe because the case statement is evaluated after the
template is pushed.. Hmm, can "file" require a variable to enforce the
order here, or is there any other sensible way without splitting this
in sub-classes ?


  -jf

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to