easy. every resource may only be defined _once_. you try ... twice (file { $path : ... } and file { $path: ... }, right?)
why not simply file { $path: ensure => directory, recurse => true, purge => true, source => 'puppet:///modules/jboss/lib } ? if you _need_ to do this twice for whatever reason, do something like this (but you SHOULD NOT): file { "$path/0": $path => $path, ensure => directory, recurse => true, purge => true, } file { "$path/1": path => $path, ensure => directory, resurce => true, source => 'puppet:///modules/jboss/lib } cause puppet identifies the resource by the title, which must differ, which it does not. note THAT THIS IS NOT THE RIGHT WAY :) . HTH & greetings, Axel. Am Freitag, 10. August 2012 12:40:21 UTC+2 schrieb Rost: > > Hi all, > > I am struggling on how to do this : > > $path = '/tmp/lib' > > file { $path: > ensure => directory, > recurse => true, > purge => true, > } > > file { $path: > ensure => directory, > resurce => true, > source => 'puppet:///modules/jboss/lib > } > > When puppet compiles the manifest, I get the following error: > > * Duplicate declaration: File[/tmp/lib] is already declared in file > /etc/puppet/modules/srhjboss/manifests/purge.pp at line 4; cannot redeclare > at /etc/puppet/modules/srhjboss/manifests/purge.pp:10 on node frparsrnlinnto > * > * > * > It seems that i can't purge the directory before to copy the new one from > the source. > > Suggestions ?? > Thanks > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/sxb-OBGRKiAJ. 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.