[Puppet Users] Calling a define multiple times

Matt
Mon, 13 Oct 2008 11:21:21 -0000

Hi folks,

I think i''m missing something obvious here.  I''m trying to
search/replace
multiple times in n files but I keep hitting a ''ArgumentError:
Duplicate
definition'' or similar in any method I try and do it in.

I guess this is because i''m using ${name} to edit the multiple files,
but as
far as I can tell, i''m unable to use another type of array. i.e. if I
do:

define dnstext ($cwd, $dnstext) {
        exec {$name:
                cwd     => $cwd,
                path    => ["/bin"],
                command => "sed -i ''s/$rtext/$stext/''
./${name}",
        }

}

dnstext { $myfiles:
      cwd     => "/opt",
      stext => "replacethis",
      rtext => "withthis",
}

that works, but if I try and do another one:

dnstext { $myfiles:
      cwd     => "/opt",
      stext => "replacethis",
      rtext => "withthis",
}

--~--~---------~--~----~------------~-------~--~----~
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---