nic@clue.co.za
2013-Jun-14 09:02 UTC
[Puppet Users] puppetlabs-apt and package resource dependency
Hi I have only recently started using modules off the forge and running a recent version of Puppet (the majority of our network is still utilising 0.25.4). I spent a significant amount of time ensuring that dependencies in our existing Puppet implementation result in a single Puppet run will always succeed with the intended config applied to a node. When making use of puppetlabs-apt I notice that there is nothing included in that module that would make the Exec[''apt_update''] run before other package resources in my catalogue. My thought would be to add something like this to update.pp: Exec[''apt_update''] -> Package <| title != "python-software-properties" and title != "software-properties-common" |> I have also tried using the tag metaparameter ( tag != "apt" ) but then ended up with a dependency cycle. Does anyone have an opinion as to why this is a terrible idea? I ask because I have submitted a pull request for the change prior to reading the very informative page about contributing to puppetlabs modules and would value any community feedback on my approach. Regards, Nic -- 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. For more options, visit https://groups.google.com/groups/opt_out.
jcbollinger
2013-Jun-17 14:48 UTC
[Puppet Users] Re: puppetlabs-apt and package resource dependency
On Friday, June 14, 2013 4:02:30 AM UTC-5, n...@clue.co.za wrote:> > Hi > > I have only recently started using modules off the forge and running a > recent version of Puppet (the majority of our network is still utilising > 0.25.4). I spent a significant amount of time ensuring that dependencies > in our existing Puppet implementation result in a single Puppet run will > always succeed with the intended config applied to a node. > > When making use of puppetlabs-apt I notice that there is nothing included > in that module that would make the Exec[''apt_update''] run before other > package resources in my catalogue. >That is because any such relationship would be outside the module''s scope -- the module is about managing your apt configuration, not about managing packages via apt.> My thought would be to add something like this to update.pp: > > Exec[''apt_update''] -> Package <| title != "python-software-properties" and title != "software-properties-common" |> > >Adding something along these general lines to your manifest set is fine if it is appropriate for you, but it does not belong in the puppetlabs-apt module. For one thing, it would needlessly (and perhaps harmfully) catch packages that use providers other than apt, such as gem. Although I think it''s a poor practice to use multiple package managers on the same system, some people do so. There are other potential problems as well.> I have also tried using the tag metaparameter ( tag != "apt" ) but then > ended up with a dependency cycle. >I''m not surprised you did, with that.> > Does anyone have an opinion as to why this is a terrible idea? I ask > because I have submitted a pull request for the change prior to reading the > very informative page about contributing to puppetlabs modules and would > value any community feedback on my approach. > >As I said, what you are suggesting does not belong in the module, though something like it may be appropriate for manifest sets that use the module. Outside the module, though, it would probably be better practice to use something like this: Class[''apt::update''] -> Package<| <optional selection predicate> |> so as not to rely on module implementation details. John -- 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. For more options, visit https://groups.google.com/groups/opt_out.