Hi Martin, I'm not sure what you mean. Both the mount and file resource are in the defined type.
On Wednesday, December 9, 2015 at 11:12:31 PM UTC+8, Martin Alfke wrote: > > Hi, > On 09 Dec 2015, at 14:08, [email protected] <javascript:> 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/06fa7c46-4d53-4cc5-9f4a-1b4eed17da23%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
