Hi,
On 09 Dec 2015, at 14:08, ddns...@gmail.com wrote:

> Hello Group,
> 
> 
> I am working on a module to handle mounting of NFS mounts.
> Puppet: 3.7.1
> Hiera: 1.3.4
> 
> I have already tested it in my lab machine and it works as expected:
> 
> mytestserver.example.com.yaml
> nfsmounts:
>     '/net1':
>         path: '/net1'
>         device: 'somefiler:/vol/vol1/test1'
>     '/net2':
>         path: '/net2'
>         device: 'nfsserver:/data/test2'
>     '/net3':
>         path: '/net3'
>         device: '192.168.0.100:/local/foo/test3'
> 
> 
> init.pp  
> class mynfsmounts {
>     $nfsmounts_hash = hiera_hash('nfsmounts')
>     create_resources('mynfsmounts::mounts',$nfsmounts_hash )
> }
> 
> mounts.pp
> define mynfsmounts::mounts ($path,$device,)
> {
>     $mountopts = 'rw,_netdev'
>     $owner = 'admuser'
>     $group = 'admuser'
> 
>     mount { $name:
>         ensure   => 'mounted',
>         device   => $device,
>         fstype   => 'nfs',
>         options  => $mountopts,
>         atboot   => 'yes',
>         require  => File[$title],
>     }
>  
>     file { $title:
>         ensure  => directory,
>         owner   => $owner,
>         group   => $group,
>         mode    => '2775',
>     }
> 
> }
> 
> 
> My question is, how do I separate the file and the mount resources in a 
> separate manifest inside the same module and have the same effect? Our puppet 
> admins require that defined type declarations do not include resources inside 
> them.

Wow.
A self defined resource type purely makes use of existing resource types.
Why are you allowed to have the mount resource in the define but not the file 
resource declaration?


-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/D9DF0847-3811-4421-9430-F1D836D17A23%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to