Hi all, Is it possible to override the behaviour of all instances of a resource from a module? I would like to have my "apt" module add a requirement for Exec["apt- get update"] to all Package resources. putting Package { require => Exec["apt-get update"] } in the module itself won''t work, since the scope of that will only be in the module itself. using Package <| |> { require => Exec["apt-get update"} will do what I want, but it has the side-effect of realizing all virtual resources. many of which I don''t want. Any options? -- 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.
On Jun 24, 2010, at 10:55 PM, Mathijs wrote:> Hi all, > > Is it possible to override the behaviour of all instances of a > resource from a module? > I would like to have my "apt" module add a requirement for Exec["apt- > get update"] to all Package resources. > > putting > Package { require => Exec["apt-get update"] } > in the module itself won''t work, since the scope of that will only be > in the module itself.Actually, it''s pretty trivial. Just put: Package { require => Exec["apt-get update"] } in the root of your manifests. One typical place is the beginning of site.pp. Technically, I recommend putting all your package init in a class, and requiring that class in Package like this: Package { require => Class["apt-presetup"] } -- 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.
> >Actually, it''s pretty trivial. Just put: >Package { require => Exec["apt-get update"] } >in the root of your manifests. One typical place is the >beginning of site.pp. >The -y flag might be needed for it to work without user interaction.> >Technically, I recommend putting all your package init in a >class, and requiring that class in Package like this: >Package { require => Class["apt-presetup"] } >This email communication and any files transmitted with it may contain confidential and or proprietary information and is provided for the use of the intended recipient only. Any review, retransmission or dissemination of this information by anyone other than the intended recipient is prohibited. If you receive this email in error, please contact the sender and delete this communication and any copies immediately. Thank you. http://www.encana.com -- 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.