salt icon indicating copy to clipboard operation
salt copied to clipboard

Fix examples in event document

Open russellballestrini opened this issue 12 years ago • 3 comments

http://docs.saltstack.com/topics/event/index.html#firing-events-from-code

The code example which claims to allow Salt Minions to fire events at Salt Master does not work. Everything else in this document works.

I was able to get the code example to work if I run both the 'listener' and 'emitter' on the Salt Master and I modify sock_dir to be '/var/run/salt/master'.

A 3rd party script firing events from Salt Master to Salt Master is not super useful.

A more useful example would be a 3rd party script firing events from Salt Minion to a 3rd party listener on the Salt Master. This would truly be piggy backing on the event bus.

I took my best shot at firing an event from 3rd Party script into Salt Minion Event bus which would then be sent to the Salt Master event bus and finally found on the 3rd party listener script running on the Salt Master, but alias I became stuck.

UPDATE

I documented a white paper of sorts here:

http://www.foxhop.net/salt-stack-piggy-back-encrypted-zmq-event-bus

With the help from another user in IRC (Math`) I was able to send an event from 3rd party script to minion event bus. The event was a 'multievent' and had the 'fire_master' tag so it was forwarded by the salt-minion Daemon to the Salt Master's event bus. I had another 3rd party script listening to the Salt Master's event bus filtering on a tag, and I was able to see the message!

We were not able to get a 'single' event to be filtered on the Salt Master bus due to the issue discussed in https://github.com/saltstack/salt/pull/10890

russellballestrini avatar Mar 02 '14 16:03 russellballestrini

I assume you were using the example which was for versions >=0.17.0? If that example doesn't work, we should definitely get it fixed.

Also, we should maybe add your example from your white paper to the docs.

basepi avatar Mar 04 '14 18:03 basepi

@jacobhammons - @basepi can work with you on this issue this sprint.

meggiebot avatar Aug 03 '15 16:08 meggiebot

On further inspection, this documentation was rewritten in February by @whiteinge, and I think is working. Keep us posted if not, but for now I'm going to close this.

basepi avatar Aug 03 '15 16:08 basepi