Book Image

Mastering SaltStack - Second Edition

Book Image

Mastering SaltStack - Second Edition

Overview of this book

SaltStack is a powerful configuration management and automation suite designed to manage servers and tens of thousands of nodes. This book showcases Salt as a very powerful automation framework. We will review the fundamental concepts to get you in the right frame of mind, and then explore Salt in much greater depth. You will explore Salt SSH as a powerful tool and take Salt Cloud to the next level. Next, you’ll master using Salt services with ease in your infrastructure. You will discover methods and strategies to scale your infrastructure properly. You will also learn how to use Salt as a powerful monitoring tool. By the end of this book, you will have learned troubleshooting tips and best practices to make the entire process of using Salt pain-free and easy.
Table of Contents (20 chapters)
Mastering SaltStack Second Edition
Credits
Foreword
About the Author
About the Reviewer
www.PacktPub.com
Preface

Working with webhooks


As mentioned previously, it is possible to use webhooks with the Salt API. Webhooks are designed to be commands that can be issued over HTTP/HTTPS in a single call-no getting tokens first. This can be problematic from a number of standpoints.

The first roadblock involves services that make use of tokens or any other authentication scheme that requires multiple web requests to be made to a server. Since webhooks need to be able to work in a single shot, using a Salt API token is out of the question.

As you have seen, the Salt API does allow commands to be issued in a single call as long as all the credentials are passed along. This is okay if the service making the call allows you to define things such as custom headers and POST data. In some situations, this is acceptable, but some services do not provide that capability.

That leaves us with unauthenticated web requests. This is also doable inside the Salt API, but the user will have to provide their own authentication...