Hi > I have several modules that need to export the same sshkey resources > with different tags each one, for example: > > # module backups > @@sshkey { $fqdn: > key => $sshrsakey, > type => "rsa", > tag => "backups_$fqdn", > } > > # module ssh > @@sshkey { $fqdn: > key => $sshrsakey, > type => "rsa", > tag => "ssh_$fqdn", > } > > this throws a duplicate definition error like: > > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Duplicate definition: Sshkey[vbox1.ingent.ct] is already defined in > file /home/lluis/git/initr/puppet/modules/ssh_station/manifests/server.pp at > line 36; cannot redefine at > /home/lluis/git/initr/puppet/modules/webserver1/manifests/init.pp:200 on node > vbox1.ingent.ct
actually what are you doing is managing the same resource twice, hence the duplicate definition error. For puppet the variable labeled as `namevar` in the Reference has to be unique per resource for one host. > sshkey name or alias must be $fqdn to make ssh associate correct > ssh_known_hosts line with the node, how can I export the same sshkey > with different tags in separate modules? you can add multiple tags to one resource: @@sshkey { $fqdn: key => $sshrsakey, type => "rsa", tag => [ "backups_$fqdn", "ssh_$fqdn" ], } cheers pete --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---