title: Puppet hiera variable in erb `if` statement
body: <p>I have a hiera variable in my erb template for one condition check.</p>
  
  <pre><code>&lt;% if @server_name == 'jira-dev-api'
  </code></pre>
  
  <p>After upgrading to puppet 5, this variable in the <code>if</code> loop does not work. But this will take correct values without the <code>if</code> statement in an erb template.</p>
  
  <ol>
  <li><p>I tried puppet lookup for hiera debugging, and it works fine. The variable is defined within the same module as below.</p>
  
  <pre><code>module_name::install_confluence_apache_config::server_name=xyz
  </code></pre></li>
  <li><p>When I appended a scope with the absolute path like below,</p>
  
  <pre><code>scope['module_name::install_confluence_apache_config::server_name'] 
  </code></pre>
  
  <p>it works.</p></li>
  </ol>
  
  <p>Is there any change with erb scoping in <code>if</code> statement in puppet 5? I was using puppet 3 open source.</p>
  
  <p>Adding more info.</p>
  
  <p>a)server_name is a variable defined in "nodes/%{::clientcert}" yaml file.
  b)I was using puppet 3.8 and the working erb template was as below</p>
  
  <pre><code>&lt;% if @server_name == 'jira-dev-api'
  </code></pre>
  
  <p>c)upgraded to puppet 5.5.But observed that when i reference server_name variable in erb in a if statement as above the value is not getting.But working when i use </p>
  
  <pre><code>scope['module_name::install_confluence_apache_config::server_name']
  </code></pre>
  
  <p>Also this issue is only inside if statment in erb template.</p>