title: Iterate over a hash key/values in Puppet
body: <p>I'm dabbling with Puppet to update an arbitrary list of appsettings in an ASP.NET web.config (for deployment purpose) and I'm in a dilemma, mostly because I'm a real n00b in puppet.  </p>
  
  <p>I have this yaml file (hiera)</p>
  
  <pre><code>---
  appSettings:
    setting1: "hello"
    setting2: "world!"
    setting3: "lalala"
  </code></pre>
  
  <p>the number of <code>setting[x]</code> can span arbitrarily (one appSetting) and I would like to loop through the hash keys/value to update the corresponding <code>appSetting/add</code> in the web.config (using <code>exec</code> with powershell) the problem is i've searched high and low on how to iterate on <em>keys</em> and <em>values</em>.  </p>
  
  <p>I came across <code>create_resources</code> and this of course iterates through a hash of hash with a pre-determined set of keys.  again, the key names are not known within the manifest (hence iterating the key/value pairs).</p>
  
  <p>any guidance is appreciated.</p>
  
  <p>Edit:  looks like there is a <code>keys()</code> function i can use over the hash and iterate over that then use hiera_hash('appSettings') to get the hash and iterate through the values.</p>