title: Remove value from hash Puppet
body: <p>I have the following params in hiera:</p>
  
  <pre><code>base::users:
    john@example.com:
      ensure: present
      user: john
      sudo: true
      type: ssh-rsa
      key: AAAAB3NzaC1yc2EAAAABJ
  </code></pre>
  
  <p>in puppet i'm getting the following hash:</p>
  
  <pre><code> {john@example.com =&gt; {ensure =&gt; present, user =&gt; john, sudo =&gt; true, type =&gt; ssh-rsa, key =&gt; AAAAB3NzaC1yc2EAAAABJ}}
  </code></pre>
  
  <p>Then i'm calling create resources to create appropriate authorized_keys file:</p>
  
  <pre><code>create_resources('ssh_authorized_key', $users)
  </code></pre>
  
  <p>but it doesn't work because i have added new parameter 'sudo' and before calling create_resources I want to remove this key from hash and operate in another resource.</p>
  
  <p>I've tried the next step to remove it:</p>
  
  <pre><code>$users_filtered = $users.each |$k, $v| { $v.delete['sudo'] }
  </code></pre>
  
  <p>i'm getting the next error:</p>
  
  <pre><code>Error while evaluating a Function Call, delete(): Wrong number of arguments given 1 for 2.
  </code></pre>
  
  <p>As I understand puppet tried to use 'delete' function from stdlib module.
  But i have also tried:</p>
  
  <pre><code>$users_filtered = $users.each |$k, $v| { delete($users, $v['sudo'] }
  </code></pre>
  
  <p>But it doesn't work. Appreciate any help</p>