Bret Wortman
2013-May-07 16:38 UTC
[Puppet Users] How to have one file depend on many packages
Here''s a puzzler (though I''m sure the answer is obvious and I''m just not seeing it): I have a manifest where I''m listing about 40-50 packages that I want the system to remove, and a file that I want to create only after successful removal of all the packages. What''s the best way to show this dependency so that the file is only created after all the packages are removed? Thanks! Bret -- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Peter Bukowinski
2013-May-07 17:47 UTC
Re: [Puppet Users] How to have one file depend on many packages
On May 7, 2013, at 12:38 PM, Bret Wortman <bret.wortman@damascusgrp.com> wrote:> Here''s a puzzler (though I''m sure the answer is obvious and I''m just not seeing it): > > I have a manifest where I''m listing about 40-50 packages that I want the system to remove, and a file that I want to create only after successful removal of all the packages. > > What''s the best way to show this dependency so that the file is only created after all the packages are removed? > > Thanks! > > > BretThe simplest method is to use the ''before'' metaparameter in each of the package resources that must be synced before you want the file created. E.g. package { [ "a", "b", "c" ]: ensure => absent, before => File["/some/file"], } file { "/some/file": ensure => file, content => "Where did all the packages go?", } -- Peter -- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.