On Mon, Jun 15, 2020 at 4:43 AM Andreas Dvorak <[email protected]> wrote:
> Hello, > > I am trying to use the deferred function according to the page > http://puppet-on-the-edge.blogspot.com/2018/10/the-topic-is-deferred.html > > My code does not show the time. Does anybody has a solution? > > notify {"time_now": > message => Deferred('new', [TimeStamp]) > } > > $d = Deferred('new', [TimeStamp]) > notify {'time_now_2': > message => "The time is: ${d}" > } > > $dd = Deferred('new', [TimeStamp]) > notify {"time_now_3": > message => Deferred("sprintf", ["The time is: %s", $dd]) > } > > notify { 'time_now_4': > message => Deferred('inline_epp', [@(END)]) > The time is: <%= TimeStamp() %> > |- END > } > > > My result > > Notice: Deferred({'name' => 'new', 'arguments' => [Timestamp]}) > Notice: > /Stage[main]/Vault::Consul_server::Install/Notify[time_now]/message: > defined 'message' as 'Deferred({\'name\' => \'new\', \'arguments\' => > [Timestamp]})' > Notice: The time is: Deferred({'name' => 'new', 'arguments' => > [Timestamp]}) > Notice: > /Stage[main]/Vault::Consul_server::Install/Notify[time_now_2]/message: > defined 'message' as 'The time is: Deferred({\'name\' => \'new\', > \'arguments\' => [Timestamp]})' > Notice: Deferred({'name' => 'sprintf', 'arguments' => ['The time is: %s', > Deferred({'name' => 'new', 'arguments' => [Timestamp]})]}) > Notice: > /Stage[main]/Vault::Consul_server::Install/Notify[time_now_3]/message: > defined 'message' as 'Deferred({\'name\' => \'sprintf\', \'arguments\' => > [\'The time is: %s\', Deferred({\'name\' => \'new\', \'arguments\' => > [Timestamp]})]})' > Notice: Deferred({'name' => 'inline_epp', 'arguments' => ['The time is: > <%= TimeStamp() %>']}) > Notice: > /Stage[main]/Vault::Consul_server::Install/Notify[time_now_4]/message: > defined 'message' as 'Deferred({\'name\' => \'inline_epp\', \'arguments\' > => [\'The time is: <%= TimeStamp() %>\']})' > > > Andreas > > -- > 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/84e6d862-2c4c-41d6-b45e-f16f94594b99o%40googlegroups.com > <https://groups.google.com/d/msgid/puppet-users/84e6d862-2c4c-41d6-b45e-f16f94594b99o%40googlegroups.com?utm_medium=email&utm_source=footer> > . > Deferred functions are a new feature in puppet 6. Make sure you're using the latest version, which currently is 6.16.0. Josh -- Josh Cooper | Software Engineer [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/CA%2Bu97u%3DJXhA0PcTjEHFi6-R-gCH2pka-TqTpW2i3pbJXyVcLUw%40mail.gmail.com.
