I am using puppet 3.8.4 on debian. I want to recursively set the owner and group on a set directory, but only set permissions on the directory itself ie. I don't want to chmod anything in the dir only chown/chgrp it.
I have tried the following...
file {[ "/foo/bar" , ] : ensure => directory, owner => root, group => bar, recurse => true, require => [ User[root], Group[bar], ], } file {[ "/foo/bar" , ] : ensure => directory, mode => 0640, # +x automatically added to directories recurse => false, }
But of course puppet then complains of a Duplicate declaration: File[/foo/bar] if you do that.
Is there a way in puppet to do this without having to do the top level directory and then all the files and folders under it explicitly?