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