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.

Reply via email to