I would do something like this:
** In your YAML file
---
nfs_mounts
  mount1:
    mount_point    : '/data'
    mount_device : "fas3319-518.example.com:/vol/onecrddb_data/test"
  mount2:
    mount_point     : "/data2"
     mount_device : "fas3319-518.example.com:/vol/onecrddb_data/test2"

** In site.pp

$nfs_mounts = hiera_hash('nfs_mounts')
 create_resources(gu_misc::mount_nfs_shares, $nfs_mounts)


On Thu, Mar 1, 2012 at 9:28 AM, Mohamed Lrhazi <lrh...@gmail.com> wrote:

> I have not used the create_resources function before, looks like
> exactly what I need indeed.
>
> How do I use it with a define.. my ENC outputs something like:
>
>  nfs_mounts:
>        - mount_point: "/data"
>          mount_device: "fas3319-518.example.com:/vol/onecrddb_data/test"
>        - mount_point: "/data2"
>          mount_device: "fas3319-518.example.com:/vol/onecrddb_data/test2"
>
>
> Then in my manifests:
>
>
> class gu_misc {
> ...
>
>  define mount_nfs_shares(
>        $mount_point,
>        $mount_device) {
>
>        file{ $mout_point: ensure => directory }
>        mount { $mount_point:
>            device => $mount_device,
>            name => $mount_point,
>            require => File[$mount_point],
>        }
>    }
>
>    create_resources(gu_misc::mount_nfs_shares, $nfs_mounts)
>
> }
>
> I get error: undefined method `[]' for nil:NilClass
>
>
> Thanks a lot,
> Mohamed.
>
> --
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>


-- 

Gary Larizza
Professional Services Engineer
Puppet Labs

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

Reply via email to