Book Image

Learning SaltStack

By : Colton Myers
Book Image

Learning SaltStack

By: Colton Myers

Overview of this book

Table of Contents (15 chapters)

The Salt event system


Events are an integral part of almost everything Salt does. However, for the most part, these events are designed to be invisible, to work behind the scenes to provide interprocess communication and make an asynchronous platform feel synchronous in practice.

However, we can also leverage the event system for our own purposes.

Listening for events

Before you learn about reacting to events or firing our own, let's inspect some of these events that are happening all the time in Salt. A script is provided in the Salt source for just this purpose. You can find it on Github at https://github.com/saltstack/salt/blob/develop/tests/eventlisten.py.

Download the script and place it somewhere on your master server. I am going to download it to the /root/ directory on my server, as follows:

# pwd
/root
# wget https://raw.githubusercontent.com/saltstack/salt/v2014.7.0/tests/eventlisten.py
--2014-11-27 00:07:19--  https://raw.githubusercontent.com/saltstack/salt/v2014.7.0/tests/eventlisten...