One other thing  where are your getting $title ? Is that supposed to be the title of your resource? I haven't tried using a local scope variable for hiera lookups like that before  let me know if it works