Ramin K
2012-Mar-08 02:02 UTC
[Puppet Users] Questions about virtual resources and resource chaining
I managed to trigger this behavior when I realized the readline package in the ruby_devel class instead of specifying it. It appears that the resource chain in the rvm class does not include the realized resource. Is this the current expected behavior? I''m running 2.7.11 on the client and server. class vpackages @package { ''readline'': } } class ruby_devel { realize Package[''readline''] } class rvm { include ruby_devel include rvm::params, rvm::data, rvm::install Class[''ruby_devel''] -> Class[''rvm::install''] } Ramin -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/a4uPr3TRQeQJ. 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.
jcbollinger
2012-Mar-08 15:48 UTC
[Puppet Users] Re: Questions about virtual resources and resource chaining
On Mar 7, 8:02 pm, Ramin K <ramin.khat...@gmail.com> wrote:> I managed to trigger this behavior when I realized the readline package in > the ruby_devel class instead of specifying it. It appears that the resource > chain in the rvm class does not include the realized resource. Is this the > current expected behavior?I think so. This appears to be a somewhat special case of confusing parse order with application order. Class[''ruby_devel''] does not actually do anything during resource application -- realizing a virtual package is strictly a server-side activity. Package[''readline''] belongs to Class[''vpackages''], so if you want to express your order dependency on a class instead of directly on Package[''readline''] then the class to target should be Class[''vpackages'']. If you want to hide that a bit, then I think you could add Class[''vpackages''] -> Class[''ruby_devel''] in the same file as ruby_devel, right after the class''s closing brace. Probably. Then the chain in your "rvm" class should have the expected result.> I''m running 2.7.11 on the client and server. > > class vpackages > @package { ''readline'': } > > } > > class ruby_devel { > realize Package[''readline''] > > } > > class rvm { > include ruby_devel > include rvm::params, rvm::data, rvm::install > Class[''ruby_devel''] -> Class[''rvm::install''] > > }John -- 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.
Ramin K
2012-Mar-08 17:11 UTC
[Puppet Users] Re: Questions about virtual resources and resource chaining
On Thursday, March 8, 2012 7:48:52 AM UTC-8, jcbollinger wrote:> > > > On Mar 7, 8:02 pm, Ramin K <ramin.khat...@gmail.com> wrote: > > I managed to trigger this behavior when I realized the readline package > in > > the ruby_devel class instead of specifying it. It appears that the > resource > > chain in the rvm class does not include the realized resource. Is this > the > > current expected behavior? > > > I think so. This appears to be a somewhat special case of confusing > parse order with application order. Class[''ruby_devel''] does not > actually do anything during resource application -- realizing a > virtual package is strictly a server-side activity. > Package[''readline''] belongs to Class[''vpackages''], so if you want to > express your order dependency on a class instead of directly on > Package[''readline''] then the class to target should be > Class[''vpackages'']. > >I was inclined to think it was my mistake, but wanted to make sure after looking at a few bugs around virtuals. Thanks for the explanation, that has helped me get it straight in my head. . Ramin -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/3BBBBkx7ttYJ. 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.