No problem. You're wellcome! And you're not silly. It's just a common pitfall. If you define a resource within a function, this resource will be re-defined with every function call. And since resources have to be unique, the second call to the function will lead to a duplicate definition.
So that's expected behavior. The only thing that could be improved is the error message which does not lead to the real problem. Maybe the Puppet guys could work on this in the future ;-) Cheers Bernd > -----Ursprüngliche Nachricht----- > Von: puppet-users@googlegroups.com [mailto:puppet- > us...@googlegroups.com] Im Auftrag von Sans > Gesendet: Donnerstag, 12. April 2012 16:11 > An: Puppet Users > Betreff: [Puppet Users] Re: Error 400 on SERVER: Duplicate definition > > WOW!! that was real fast (I feel myself so silly now!!). Thanks a lot. > But do you mind explaining why I was getting errors in the first place? > If I do that 'static way', like this: > > > # /etc/puppet/modules/d_services/manifests/init.pp: > --------------------------------------------------- > class voms_cert { > > $voms_dir = '/etc/grid-security/vomsdir' > exec { 'chk_vomsdir': > path => [ '/bin', '/usr/bin' ], > command => "test -d ${voms_dir}", > } > > file { > 'camont': > name => "${voms_dir}/camont/voms.gridpp.ac.uk.lsc", > mode => '0644', owner => 'root', group => 'root', > source => "puppet:///modules/d_services/vomsdir/ > voms.gridpp.ac.uk.lsc", > require => Exec[ 'chk_vomsdir' ]; > > 'atls': > name => "${voms_dir}/atlas/voms.cern.ch.lsc", > mode => '0644', owner => 'root', group => 'root', > source => "puppet:///modules/d_services/vomsdir/ > voms.cern.ch.lsc", > require => Exec[ 'chk_vomsdir' ]; > } > } > --------------------------------------------------- > > I don't get any error at all. > > Cheers, > San > > > On Apr 12, 2:55 pm, Bernd Adamowicz <bernd.adamow...@esailors.de> > wrote: > > Try to change > > > > * exec { 'chk_vomsdir': > > > > to something like > > > > * exec { "chk_vomsdir_${dir}": > > > > and > > > > * require => Exec[ 'chk_vomsdir' ]; > > > > to > > > > * require => Exec["chk_vomsdir_${dir}"]; > > > > This should make everything unique. > > > > Bernd > > -- > 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. -- 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.