Is there any way to use arrays in a puppet module (not in template)?

Posted by KARASZI István on Server Fault See other posts from Server Fault or by KARASZI István
Published on 2010-05-10T15:09:22Z Indexed on 2010/05/10 15:14 UTC
Read the original article Hit count: 366

Filed under:
|
|

I want to use puppet to manage a hadoop cluster. On the machines we have several directories which must be created and set permissions.

But i'm unable to add array values for defined methods.

define hdfs_site( $dirs ) {
    file { $dirs:
        ensure => directory,
        owner => "hadoop",
        group => "hadoop",
        mode  => 755;
    }

    file {
        "/opt/hadoop/conf/hdfs-site.xml":
            content => template("hdfs-site.xml.erb"),
            owner   => "root",
            group   => "root",
            mode    => 644;
    }
}

define hadoop_slave( $mem, $cpu, $dirs ) {
    hadoop_base {
        mem => $mem,
        cpu => $cpu,
    }

    hdfs_site {
        dirs => $dirs,
    }
}

hadoop_base is similar to hdfs_site.

Thanks!

© Server Fault or respective owner

Related posts about puppet

Related posts about hadoop