Is there a way in puppet to define making sure that only a given set of files exists in a directory? I know a recursive file ensure will make sure that a given set of files exists, but, is there a way to make sure that no files other than those exist? e.g. in /etc/cron.daily, we want 2 specific files to be there, and no others. We can recursively stick cron.daily with those two files in place, but, if somebody sticks a third file in, we want to make sure that disappears. --~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
You could copy recursively from the server a whole directory, e.g. put on the server the directory with just this two files, and then copy it to the client. this way, it will make sure that the directories are always the same. Ohad On Fri, Aug 8, 2008 at 9:31 PM, zoniguana <rjustinwilliams@gmail.com> wrote:> > Is there a way in puppet to define making sure that only a given set > of files exists in a directory? > > I know a recursive file ensure will make sure that a given set of > files exists, but, is there a way to make sure that no files other > than those exist? > > e.g. in /etc/cron.daily, we want 2 specific files to be there, and no > others. We can recursively stick cron.daily with those two files in > place, but, if somebody sticks a third file in, we want to make sure > that disappears. > > >--~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Not sure I understand. Recursively copying from the puppetmaster to the puppet will get the files there, but that doesn''t make sure that those are the only files. Am I mis-understanding something? On Aug 8, 10:28 am, "Ohad Levy" <ohadl...@gmail.com> wrote:> You could copy recursively from the server a whole directory, e.g. put on > the server the directory with just this two files, and then copy it to the > client. > > this way, it will make sure that the directories are always the same. > > Ohad > > On Fri, Aug 8, 2008 at 9:31 PM, zoniguana <rjustinwilli...@gmail.com> wrote: > > > Is there a way in puppet to define making sure that only a given set > > of files exists in a directory? > > > I know a recursive file ensure will make sure that a given set of > > files exists, but, is there a way to make sure that no files other > > than those exist? > > > e.g. in /etc/cron.daily, we want 2 specific files to be there, and no > > others. We can recursively stick cron.daily with those two files in > > place, but, if somebody sticks a third file in, we want to make sure > > that disappears.--~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
purge => "true" in your directory definition. Trevor On Fri, Aug 8, 2008 at 11:07 AM, zoniguana <rjustinwilliams@gmail.com> wrote:> > Not sure I understand. > > Recursively copying from the puppetmaster to the puppet will get the > files there, but that doesn''t make sure that those are the only > files. Am I mis-understanding something? > > On Aug 8, 10:28 am, "Ohad Levy" <ohadl...@gmail.com> wrote: >> You could copy recursively from the server a whole directory, e.g. put on >> the server the directory with just this two files, and then copy it to the >> client. >> >> this way, it will make sure that the directories are always the same. >> >> Ohad >> >> On Fri, Aug 8, 2008 at 9:31 PM, zoniguana <rjustinwilli...@gmail.com> wrote: >> >> > Is there a way in puppet to define making sure that only a given set >> > of files exists in a directory? >> >> > I know a recursive file ensure will make sure that a given set of >> > files exists, but, is there a way to make sure that no files other >> > than those exist? >> >> > e.g. in /etc/cron.daily, we want 2 specific files to be there, and no >> > others. We can recursively stick cron.daily with those two files in >> > place, but, if somebody sticks a third file in, we want to make sure >> > that disappears. > > >--~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Looks like I missed that parameter in the type reference. Sorry about that, and thanks! On Aug 8, 2:39 pm, "Trevor Vaughan" <peiriann...@gmail.com> wrote:> purge => "true" in your directory definition. > > Trevor > > On Fri, Aug 8, 2008 at 11:07 AM, zoniguana <rjustinwilli...@gmail.com> wrote: > > > Not sure I understand. > > > Recursively copying from the puppetmaster to the puppet will get the > > files there, but that doesn''t make sure that those are the only > > files. Am I mis-understanding something? > > > On Aug 8, 10:28 am, "Ohad Levy" <ohadl...@gmail.com> wrote: > >> You could copy recursively from the server a whole directory, e.g. put on > >> the server the directory with just this two files, and then copy it to the > >> client. > > >> this way, it will make sure that the directories are always the same. > > >> Ohad > > >> On Fri, Aug 8, 2008 at 9:31 PM, zoniguana <rjustinwilli...@gmail.com> wrote: > > >> > Is there a way in puppet to define making sure that only a given set > >> > of files exists in a directory? > > >> > I know a recursive file ensure will make sure that a given set of > >> > files exists, but, is there a way to make sure that no files other > >> > than those exist? > > >> > e.g. in /etc/cron.daily, we want 2 specific files to be there, and no > >> > others. We can recursively stick cron.daily with those two files in > >> > place, but, if somebody sticks a third file in, we want to make sure > >> > that disappears.--~--~---------~--~----~------------~-------~--~----~ 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---