I do not know that a workaround is needed. I believe that when a package is
upgraded, the old and new versions should show up in the logs already, so
the notify may not be needed.

On Thursday, October 6, 2016, Erez Zarum <[email protected]> wrote:

> Ok, so the workaround is to use a variable (set default), if that fails,
> try the fact.
>
> Thanks!
>
> On Thursday, October 6, 2016 at 10:45:26 AM UTC+3, R.I. Pienaar wrote:
>>
>>
>>
>> ----- Original Message -----
>> > From: "Erez Zarum" <[email protected]>
>> > To: "puppet-users" <[email protected]>
>> > Sent: Thursday, 6 October, 2016 09:40:44
>> > Subject: [Puppet Users] Facts and Resource relationships
>>
>> > I'm not sure if it's a bug or an expected behavior.
>> >
>> > I have written a simple fact for a module that returns a version of a
>> > binary file, it executes: "binary --version" and then parses the
>> version,
>> > no issues there, it works.
>> >
>> > The issue i am having is relying on this fact in case the binary file
>> gets
>> > upgraded during a package installation (this is the simple example)
>> >
>> > package { 'package':
>> > ensure => '1.3.8'
>> > } ->
>> > notify { "version: ${::binary_version}": }
>> >
>> > If the previous version was 1.3.7 the fact "binary_version" will return
>> > 1.3.7, the next run it will return 1.3.8 as expected.
>> > The biggest issue is if i rely on this fact to pick up a template to
>> use,
>> > if this package is not yet installed the fact won't work and will work
>> only
>> > on the second run.
>> >
>> > I can only assume this happens because the facts are being "compiled"
>> > before the catalog is.
>> >
>> > I have tried different ways to declare the relationship but it doesn't
>> work.
>>
>> yes, you cant use facts for something that changes during a run.  It's
>> for facts
>> about your node that influence the creation of the catalog.
>>
>> things the catalog changes - well thats after the catalog was created
>>
> --
> 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 [email protected]
> <javascript:_e(%7B%7D,'cvml','puppet-users%[email protected]');>
> .
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/puppet-users/1af175d0-ba5d-4626-8fcc-986f6c7fc8f3%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/1af175d0-ba5d-4626-8fcc-986f6c7fc8f3%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 

Rob Nelson
[email protected]

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAC76iT-UZyhicPbsmoF1CbTQiYQrhiPp8_PwCB5rHqmz%2Bsz17Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to