Book Image

Salt Cookbook

By : Anirban Saha
Book Image

Salt Cookbook

By: Anirban Saha

Overview of this book

Table of Contents (18 chapters)
Salt Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Introduction


So you have heard of this new tool called Salt, you've probably looked it up on the Internet, and now it has drawn your attention. What is Salt?

Salt is a systems management software created and maintained by SaltStack. It is used to manage infrastructure, virtualization, applications, databases, private and public clouds, software, or code. With Salt, data center automation, server provisioning, configuration management, and orchestration are a few tasks that can be done in a simple, elegant, and fast manner. Salt was first released in 2011 and has been gaining tremendous momentum ever since.

The primary advantages of Salt are as follows:

  • Simple to set up and manage: No matter what the size of the infrastructure is, Salt is extremely easy to set up and maintain. It has a simple server/client model, which works seamlessly from a small deployment to massive data center deployments.

  • Ability for parallel execution: Salt uses hostname, system properties called grains and custom configured matchers to perform remote module, state, and command execution on target nodes. These executions happen in parallel for rapid deployments.

  • Speed and security: Salt incorporates a message broker in the Salt daemon itself by using the ZeroMQ networking library. It uses public keys for authentication between the master and the client nodes with AES encryption for faster payload communication. Salt enables light and fast network traffic using msgpack.

  • Scalability and flexibility: Salt provides flexibility for systems management by providing various ways for the master and client nodes to communicate and synchronize using both the push and pull methods. The Salt master can also be scaled with multiple master configurations to support large and growing infrastructures.

  • Uses Python interface: Salt routines can be written as Python modules, and Salt itself can be called from the command line or Python API. The Salt states even allow the use of Python style conditionals, iterators, and functions to carry out automated systems management tasks.

Apart from the few aforementioned advantages, Salt has many more features that we will explore throughout this book. Salt has a large and vibrant community, which has come up with a massive number of built-in state and execution modules to simplify the management and deployment process as much as possible.

It is to be noted that almost all of the examples mentioned in this book have been targeted to work on the CentOS operating system, unless specified otherwise. The methods for other operating systems should be similar with different package, file, and service names.

Already excited by the possibilities of Salt? Let's dive in and explore it hands on.