Do you want to have each of the websites test1 through test3 to be
running on each of the domains test1 through test3, or do you want to
have each website running on its own domain?
In the former case, work with the array of domains with webapp to create
unique resources. E.g by using something like
>
https://github.com/DavidS/puppet-common/blob/master/plugins/puppet/parser/functions/prefix_with.rb
In the latter case, remove the $domain argument or default it to $name
and do not pass wrong data to your define.
Other possibilities include custom hiera lookups, and passing domain
data as a hash and indexing by $name.
Regards, D.