The resource title and namevar must be unique for any resource as documented here...
http://docs.puppetlabs.com/puppet/latest/reference/lang_resources.html#uniqueness Defined resource types follow the same rules and the $name variable is always assumed to be a namevar. Craig On Mon, Mar 31, 2014 at 2:14 PM, David Portabella < [email protected]> wrote: > as explained here: > http://docs.puppetlabs.com/puppet/latest/reference/lang_defined_types.html#title-and-name > resource *title* is guaranteed to be unique for each instance. > > I thought that resource *name* was not required to be unique. > however this code suggests the opposite: > > my_resource { r1: > name => 'r' > } > > my_resource { r2: > name => 'r' > } > > define my_resource { > } > > $ puppet apply test.pp > Error: Puppet::Parser::AST::Resource failed with error ArgumentError: > Cannot alias My_resource[r2] to ["r"] at /private/tmp/a.pp:7; resource > ["My_resource", "r"] already declared at /private/tmp/a.pp:3 at > /private/tmp/a.pp:7 on node mac4c.local > > > so, is resource *name* also unique for each instance? > > where is it explained? > I do not see this info on the documentation: > > http://docs.puppetlabs.com/puppet/latest/reference/lang_defined_types.html#title-and-name > > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/puppet-users/6504c812-6f10-4955-8907-b29c0ac71d07%40googlegroups.com<https://groups.google.com/d/msgid/puppet-users/6504c812-6f10-4955-8907-b29c0ac71d07%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- *Enviatics *| Automation and configuration management http://www.enviatics.com | @Enviatics Puppet Training http://www.enviatics.com/training/ -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CACxdKhHobFwRquzhy35_UFiHVdVUaL-HeqjUS0wzDkki2Ddu1Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
