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 now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Extending SaltStack

You're reading from   Extending SaltStack Build and write salt modules

Arrow left icon
Product type Paperback
Published in Mar 2016
Publisher Packt
ISBN-13 9781785888618
Length 240 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Joseph Hall Joseph Hall
Author Profile Icon Joseph Hall
Joseph Hall
Arrow right icon
View More author details
Toc

Table of Contents (15) Chapters Close

Preface 1. Starting with the Basics FREE CHAPTER 2. Writing Execution Modules 3. Extending Salt Configuration 4. Wrapping States Around Execution Modules 5. Rendering Data 6. Handling Return Data 7. Scripting with Runners 8. Adding External File Servers 9. Connecting to the Cloud 10. Monitoring with Beacons 11. Extending the Master A. Connecting Different Modules B. Contributing Code Upstream Index

Understanding file formats


By default, Salt uses YAML for its various files. There are two primary reasons for this:

  • YAML is easily converted into Python data structures

  • YAML is easy for humans to read and modify

Salt configuration files must be in YAML as well (or JSON, which can be read by YAML parsers), but other files such as states, pillars, reactors, and so on can use other formats. A data serialization format is the most common, but any format that can be translated into a Python dictionary will do just fine.

For example, there are three different Python renderers that ship with Salt: py, pyobjects, and pydsl. Each has its strengths and weaknesses, but the end result is the same: they execute Python code that results in a dictionary, which is then passed into Salt.

Generally speaking, you will find two types of renderers inside of Salt. The first returns data in a Python data structure. Both serializers and code-based modules fit into this category. The second is for managing text formatting...

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 $19.99/month. Cancel anytime