On Tue, Mar 22, 2011 at 08:10:40AM -0700, Nigel Kersten wrote: > On Tue, Mar 22, 2011 at 7:20 AM, jcbollinger <john.bollin...@stjude.org> > wrote: > > > > > > On Mar 21, 8:53 pm, Nigel Kersten <ni...@puppetlabs.com> wrote: [...] > >> Thoughts? > > > > I agree that File is a mishmash, but I don't think symlinks and > > recursive copying are the key concepts that would be good to split > > out. Instead, I think splitting directories into their own type would > > be the way to go. > > > > Consider what would happen if symlinks were made their own type. What > > about dependencies? Right now, I can have > > > > service { "my_service": require => File["/etc/my_service.conf"] } > > > > without caring whether File["/etc/my_service.conf"] represents an > > actual file or a symlink. I can even change that in the declaration > > of the file without having to touch anything that depends on it. If > > symlinks were modeled via a separate type, however, then I would need > > everywhere to account for which files were plain and which were > > symlinks. > > That's a really good point. One workaround would be to encapsulate > such configs into a class and require that. > [...] > > This, then, is the direction that makes the most sense to me: > > > > 1) Split out (only) directories into their own type. Among other > > things, recursive-tree management would go into the new Directory > > type. > > 2) Give File and Directory each a "link_to" property by which these > > types can be made to manage symbolic links instead of the underlying > > regular file or directory. > > like our existing "target" property? How does it make sense to manage > a symlink in a Directory type? I'm not seeing it.... >
Same reason like above. If you're doing something like case $operatingsystem { 'Solaris': { # Filetype or even new link type file { '/foo': target => '/linktarget', ensure => link } } default { directory { '/foo': ensure => present} } } You cannot setup a dependency like require => Directory['/foo']. If the directory type has a target attribute and ensure => link, this would be possible. While I think that this is a good point I still prefer splitting into file, directory and directorytree (or similar). One note about recursive copies. I have one case where I want to controll owner/group/mode on a toplevel directory and just owner/group for all the children in that directory. Thats not possible at the moment (or not that I'm aware of). If I now can define Directorytree['foo'] and Directory['foo'] I would be able to manage different aspects for parent directory and children. So +1 for Nigel's initial post from me. -Stefan
pgpCxVF1WJkT6.pgp
Description: PGP signature