----- Original Message -----
| How can I pass an array to a define? It's not documented in the
| puppet
| language guide.
| 
| I've got:
| 
| define lvm::create_vg ( $pvdisks ) {
|     exec {
|         'pvcreate':
|             command => "/sbin/pvcreate -yf $pvdisks",
|             unless  => "/sbin/pvdisplay $pvdisks",
|            ...
|     }
| }
| 
| class someclass {
|     lvm::create_vg {
|         'bcvg01':
|             pvdisks => ['/dev/xvdb1', '/dev/xvdc1'];
|     }
| }
| 
| Inside the define, $pvdisks gets expanded to '/dev/xvdb1/dev/xvdc1'
| 
| Doug.


It appears that split is a method for doing this.  I found this online.

$ifs = split($interfaces,",")

define do_this {
        $mule = "ipaddress_${name}"
        $donkey = inline_template("<%= scope.lookupvar(mule) %>")

        notify { "Found interface $donkey":; }
}

do_this { $ifs:; }

-- 
James A. Peltier
Manager, IT Services - Research Computing Group
Simon Fraser University - Burnaby Campus
Phone   : 778-782-6573
Fax     : 778-782-3045
E-Mail  : [email protected]
Website : http://www.sfu.ca/itservices
          http://blogs.sfu.ca/people/jpeltier

Success is to be measured not so much by the position that one has reached
in life but as by the obstacles they have overcome. - Booker T. Washington

-- 
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