notify on agent from puppet function

136 views
Skip to first unread message

Vasil Mikhalenya

unread,
Feb 24, 2014, 9:15:29 AM2/24/14
to Puppet Users
Hi all,

could you advice any way to put a message in puppet agent output from puppet function on master.

--
Best regards,
Vasil Mikhalenya

jcbollinger

unread,
Feb 25, 2014, 9:26:54 AM2/25/14
to puppet...@googlegroups.com


On Monday, February 24, 2014 8:15:29 AM UTC-6, bazil wrote:
Hi all,

could you advice any way to put a message in puppet agent output from puppet function on master.



Not directly, because functions run on the master, during catalog compilation.  If the message can be computed on the master, then you can cause it to be emitted into the agent's log via a Notify resource.


John

Vasil Mikhalenya

unread,
Feb 25, 2014, 11:50:51 AM2/25/14
to Puppet Users
Unfortunately, the message could be computed only in function. Do I understand correctly that it is impossible to push Notify in catalog from function during compilation.


--
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/5a518de3-e563-4e2c-867f-80c859b8767e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

jcbollinger

unread,
Feb 26, 2014, 9:12:11 AM2/26/14
to puppet...@googlegroups.com


On Tuesday, February 25, 2014 10:50:51 AM UTC-6, bazil wrote:
Unfortunately, the message could be computed only in function. Do I understand correctly that it is impossible to push Notify in catalog from function during compilation.



No, you do not:

notify { 'a-message-from-our-sponsors':
  message => my_function($the_data)
}

The potential issue is not about the means of computing the message, it is about where the computation is performed, and a bit about when.  In particular, if the point of using a function is for it to use data or software available only on the target node, or to modify the target node directly, then the fact that Puppet custom functions are evaluated on the master will render your plan inoperable.

Similarly, if you need the computation to be performed only after one or more resources have been applied to the target node, then a Puppet custom function cannot help you.


John

Reply all
Reply to author
Forward
0 new messages