Deferred without result

52 views
Skip to first unread message

Andreas Dvorak

unread,
Jun 15, 2020, 7:42:58 AM6/15/20
to Puppet Users
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

Josh Cooper

unread,
Jun 15, 2020, 2:32:20 PM6/15/20
to puppet...@googlegroups.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...@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

Andreas Dvorak

unread,
Jun 16, 2020, 1:35:17 AM6/16/20
to Puppet Users
Hi,

I have
Puppet Agent v6.14.0. and puppetserver version: 6.10.0.
Do I need to update?

Andreas
Reply all
Reply to author
Forward
0 new messages