title: Puppet concatenate list conditionally
body: <p>I try to only deploy fail2ban Apache jails if apache is actually installed. I have a fact for that that works.</p>
  <pre><code>  # fail2ban
    $jails = [
        'ssh', 'ssh-ddos',
        'pam-generic'
    ] + if $f2b_enable_apache { ['apache-auth', 'apache-badbots', 'apache-multiport', 'apache-noscript', 'apache-overflows'] }
  
    notify{&quot;Enable apache jails: ${f2b_enable_apache}&quot;:}
    notify{&quot;Jails: ${jails}&quot;:}
  
    class { 'fail2ban':
      package_ensure =&gt; 'latest',
      jails =&gt; $jails
    }
  </code></pre>
  <p>When I run it though, then I get the follwing output</p>
  <p>Without apache:</p>
  <pre><code>Puppet : Enable apache jails: false
  Puppet : Jails: [ssh, ssh-ddos, pam-generic, apache-auth, apache-badbots, apache-multiport, apache-noscript, apache-overflows]
  </code></pre>
  <p>With apache:</p>
  <pre><code>Puppet : Enable apache jails: true
  Puppet : Jails: [ssh, ssh-ddos, pam-generic, apache-auth, apache-badbots, apache-multiport, apache-noscript, apache-overflows]
  </code></pre>
  <p>What am I doing wrong? Why is it in both cases appended? Is there a better way to achieve this that is extensible?</p>