title: Map puppet path to absolute path
body: <p>I'm trying to write a new function for puppet which would take a puppet source path as argument, such as:</p>
  
  <pre><code>puppet:///modules/foo/some/dir
  </code></pre>
  
  <p>The function then needs to analyse this directory, so I need to figure out the absolute path to the directory, which depends on the environment, for example:</p>
  
  <pre><code>/srv/puppetmaster/stable/modules/foo/files/some/dir
  </code></pre>
  
  <p>What function can I use to achieve this?</p>