I have problem figuring out how I can make a custom module inside a highstate run wait until a special event is published from a runner running in the salt-master to the event bus.
Here's what I want to accomplish:
1) A highstate run is triggered.
2) During the highstate run a custom state module (of mine) is executed.
3) The state module sends an event (via events.send) to the event bus
4) This event triggers a reactor in the salt-master
5) Reactor starts a runner.
So far everything works beautifully. What I need to do after is that the runner must be able to send some data back to the minion while its still doing its highstate run.
I guess that I could modify my custom state module (see the 2nd step) to wait (or poll every few seconds) for a specially named event from the event bus which the reactor will be sending, but I just don't know how. The goal is that the highstate run will be blocked until the runner sends this event, because all other states following this cannot be executed unless the runner has done its job.
I'm an experienced Python programmer, so I know that I must be able to do this somehow, but I'm not familiar with Salt internals. Naturally the first choice would be to use the existing event bus, but I haven't found suitable API from Salt minion side which I could easily use from a custom python state module. All ideas and pointers are appreciated.
Thanks,
- Garo