title: Hiera: can't convert String into Hash, what could be the reason?
body: <p>I've written a module which uses <code>rpm -e $package_name --nodeps</code> to remove a single RPM without it's dependencies.</p>
  
  <p>I'm using Hiera and I've got <code>hiera_include("classes", [])</code> set in the Puppet server's <code>site.pp</code> file.</p>
  
  <p>The module includes two configuration files, the first one is <code>init.pp</code>:</p>
  
  <pre><code>class rmpkg {
      $pkg_name = hiera_hash('rpm_name', undef)
          if $pkg_name != undef {
              create_resources("rmpack", $pkg_name)
          }
  }
  </code></pre>
  
  <p>And <code>remove_rpm.pp</code>:</p>
  
  <pre><code>define rmpack ($rpm_name) {
  exec { 'remove_rpm_${name}':
          command =&gt; "/bin/rpm -e ${rpm_name} --nodeps",
          path =&gt; "/bin/rpm",
          onlyif =&gt; "/bin/rpm -q --quiet ${rpm_name}",
   }
  </code></pre>
  
  <p>The relevant hiera file looks like so:</p>
  
  <pre><code>classes:
    - rmpkg
  
  rpm_name:
      rpm_1: cups
  </code></pre>
  
  <p>I've also tried:</p>
  
  <pre><code>classes:
    - rmpkg
  
  rpm_name:
      rpm_1:
        rpm: cups
  </code></pre>
  
  <p>When I run <code>puppet agent -t</code> on the affected client I receive the following error:</p>
  
  <pre><code>[root@itaitest ]# puppet agent -t
  Info: Retrieving pluginfacts
  Info: Retrieving plugin
  Info: Loading facts
  Error: Could not retrieve catalog from remote server: Error 400 on SERVER: can't convert String into Hash at /etc/puppet/environments/production/modules/rmpkg/manifests/init.pp:4 on node itaitest.nj.company.com
  Warning: Not using cache on failed catalog
  Error: Could not retrieve catalog; skipping run
  [root@itaitest ]#
  </code></pre>
  
  <p>What am I doing wrong?</p>