title: Puppet in operator
body: <p>I'm writing a conditional statement in Puppet (3.7) that tests whether the hostname is in a defined array of hostnames. If true, the class continues to run, if not, it exits with the 
  fail function</p>
  
  <pre><code>if $::hostname in $approved_hosts != str2bool("true") {
    fail("This module is for approved reposync hosts only")
  </code></pre>
  
  <p>Where $approved_hosts is an array of hostnames. This method does not work, but if I change $approved_hosts to ['hostname1', 'hostname2'] it does work:</p>
  
  <pre><code>if $::hostname in ['hostname1', 'hostname2'] != str2bool("true") {
    fail("This module is for approved reposync hosts only")
  </code></pre>
  
  <p>Can anyone explain why when I convert the array of hostnames to a variable the condition fails but works otherwise?</p>
  
  <p>Thanks :)</p>