Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Learning SaltStack

You're reading from   Learning SaltStack Learn how to manage your infrastructure by utilizing the power of SaltStack

Arrow left icon
Product type Paperback
Published in Jan 2015
Publisher
ISBN-13 9781784394608
Length 174 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
 Myers Myers
Author Profile Icon Myers
Myers
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Learning SaltStack
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Diving In – Our First Salt Commands FREE CHAPTER 2. Controlling Your Minions with Remote Execution 3. Execution Modules – Write Your Own Solution 4. Defining the State of Your Infrastructure 5. Expanding Our States with Jinja2 and Pillar 6. The Highstate and Environments 7. Using Salt Cloud to Manage Virtual Minions 8. The Reactor and the Event System Index

Reacting to events


Now that you've learned how to fire our own custom events, it's time to learn how to react to those events. To accomplish this, we will use a tool, fittingly named the reactor.

The reactor is configured in two parts. The first piece is in the master configuration file and defines which events will trigger which reactor files. The second part consists of the reactor files themselves, which define the actions to be taken when reacting to events, and which are similar to state files.

Here are the lines we will be adding to our master configuration file (/etc/salt/master):

reactor:
  - 'salt/custom/*':
    - salt://reactor.sls

Note that globbing is used to target multiple events with a single configuration. Thus, we are now set up such that when the master receives any event that has a tag that starts with salt/custom/, the master will execute the reactor.sls reactor file from our Salt files in /srv/salt.

Note

If multiple event matchers are defined, Salt will check them in order...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images