Skip to content

Instantly share code, notes, and snippets.

@jeffmccune
Created May 16, 2012 00:40
Show Gist options
  • Save jeffmccune/2706336 to your computer and use it in GitHub Desktop.
Save jeffmccune/2706336 to your computer and use it in GitHub Desktop.
Alias a resource in the munge method of the namevar
1.8.7 :010 > catalog = Puppet::Resource::Catalog.new; catalog.class
=> Puppet::Resource::Catalog
1.8.7 :011 > resource = Puppet::Type.type(:registry_key).new(:name => 'HKLM\Software\Vendor\PuppetLabs', :catalog => catalog); resource.class
=> Puppet::Type::Registry_key
1.8.7 :012 > catalog.add_resource resource
=> nil
1.8.7 :013 > pp catalog.resource_keys
[["Registry_key", "hklm\\Software\\Vendor\\PuppetLabs"],
["Registry_key", "HKLM\\Software\\Vendor\\PuppetLabs"],
["Registry_key", "hklm\\software\\vendor\\puppetlabs"]]
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment