Re: [Puppet Users] Deferred without result

2020-06-15 Thread Andreas Dvorak
Hi,
>
>
I have
Puppet Agent v6.14.0. and puppetserver version: 6.10.0.
Do I need to update?

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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/8c29fe24-715d-422c-86aa-939f662fedfdo%40googlegroups.com.


Re: [Puppet Users] Deferred without result

2020-06-15 Thread Josh Cooper
On Mon, Jun 15, 2020 at 4:43 AM Andreas Dvorak 
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 puppet-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/84e6d862-2c4c-41d6-b45e-f16f94594b99o%40googlegroups.com
> 
> .
>

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
j...@puppet.com

-- 
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 puppet-users+unsubscr...@googlegroups.com.
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.


[Puppet Users] Deferred without result

2020-06-15 Thread Andreas Dvorak
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/84e6d862-2c4c-41d6-b45e-f16f94594b99o%40googlegroups.com.