Hi Pete,

I tried that with $myfiles as an array, but as I said, that just executed
the sed command with all of the filenames concatanated.

I've got a fix at the moment.  I've just prefixed multiple execs in the
define method with something unique.  Its working, but just feels like there
would be a better way to do this.

My code at the moment is:

define searchreplace ( $cwd, $stext, $rtext, $sstext, $rrtext, $ssstext,
$rrrtext ) {
        exec {"dns_$name":
                cwd     => $cwd,
                path    => ["/bin"],
                command => "sed -i 's/$stext/$rtext/' ./${name}",
        }
        exec {"tag_$name":
                cwd     => $cwd,
                path    => ["/bin"],
                command => "sed -i 's/$sstext/$rrtext/' ./${name}",
        }
        exec {"ray_$name":
                cwd     => $cwd,
                path    => ["/bin"],
                command => "sed -i 's/$ssstext/$rrrtext/' ./${name}",
        }
}

searchreplace {$bfprocesses :
                cwd     => "/home",
                stext   => "replacethis",
                rtext   => $dns,
                sstext  => "replacethis2",
                rrtext  => $tag,
                ssstext  => "replacethis3",
                rrrtext  => $ray,

        }
}


It works - just wondering if there was a simpler way.

Cheers,

Matt

2008/10/13 Peter Meier <[EMAIL PROTECTED]>

>
> Hi
>
> > But that executed the sed command with all of the files as input.
> >
> > I also tried with a general define searchreplace method but i'm only able
> to
> > call it once in a class with the $name due to the $name method again.
> >
> > Is it possible to get puppet to iterate a definition other than using the
> > $name method?
>
>
> use something else than $name as filename. because $name have to be unique.
>
> greets pete
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to