You are previewing Salt Essentials.
O'Reilly logo
Salt Essentials

Book Description

Get a complete introduction to Salt, the widely used Python-based configuration management and remote execution tool. This practical guide not only shows system administrators how to manage complex infrastructures with Salt, but also teaches developers how to use Salt to deploy and manage their applications.

Written by two Salt experts, this book provides the information you need to deploy Salt in a production infrastructure right away. You’ll also learn how to customize Salt and use salt-cloud to manage your virtualization. If you have experience with Linux and data formats such as JSON or XML, you’re ready to get started.

Table of Contents

  1. Preface
    1. Who Should Read This Book
    2. Why We Wrote This Book
    3. What This Book Is Not
    4. A Word on Salt Today
    5. Navigating This Book
    6. Online Resources
    7. Conventions Used in This Book
    8. Using Code Examples
    9. Safari® Books Online
    10. How to Contact Us
    11. Acknowledgments
  2. 1. Introduction
    1. What Is Salt?
    2. High-Level Architecture
    3. Some Quick Examples
      1. System Management
      2. Configuration Management
    4. A Brief History
    5. Topology Options
    6. Extending Salt
  3. 2. Quick Start: First Taste of Salt
    1. Single-Master Setup
      1. From Packages
      2. Bootstrap Script
    2. Starting Up
    3. Basic Commands
      1. salt: The Main Workhorse
      2. salt-key: Key Management
      3. salt-call: Execution on the Minion
      4. salt-run: Coordination of Jobs on the Master
      5. Summary of Commands
    4. Key Management
      1. Viewing Keys
      2. Accepting Keys
      3. Rejecting Keys
      4. Key Files
    5. Minion Targeting
      1. Minion ID
      2. List (-L)
      3. Glob
      4. Regular Expression (-E)
      5. Grains (-G)
      6. Compound (-C)
      7. Targeting Summary
    6. Additional Remote Execution Details
    7. Conclusion
  4. 3. Execution Modules: The Functional Foundation
    1. sys: Information and Documentation About Modules
      1. sys.doc Basic Documentation
      2. sys.list_modules, sys.list_functions: Simple Listings
    2. cmd: Execute Via a Shell
      1. cmd.run: Run Any Command
    3. pkg: Manage Packages
      1. Virtual Modules
      2. pkg.list_pkgs: List All Installed Packages
      3. pkg.available_version: See What Version Will Be Installed
      4. pkg.install: Install Packages
    4. user: Manage Users
      1. user.add: Add Users
      2. user.list_users, user.info: Get User Info
    5. saltutil: Access Various Salt Utilities
    6. Summary
  5. 4. Configuration Management: Salt States
    1. State File Overview
      1. SLS Example: Adding a User
      2. Working with the Multilayered State System
    2. Highstate and the Top File
      1. The Top File
    3. State Ordering
      1. require: Depend on Another State
      2. watch: Run Based on Other Changes
      3. Odds and Ends
    4. Summary
  6. 5. Minion Data/Master Data
    1. Grains Are Minion Data
      1. Performing Basic Grain Operations
      2. Setting Grains
      3. Targeting with Grains in the Top File
    2. Pillars Are Data from the Master
      1. Querying Pillar Data
      2. Querying Other Sources with External Pillars
    3. Renderers Give Data Options
  7. 6. Extending Salt: Part I
    1. Introduction to Jinja
      1. Jinja Basics
    2. Templating with Jinja
      1. Filtering by Grains
    3. Custom Execution Module
    4. Custom State Modules
    5. Custom Grains
    6. External Pillars
    7. Summary
  8. 7. More on the Master
    1. Runners
      1. Manage Minions
      2. Manage Jobs
    2. The orchestrate Runner
    3. The Event System
    4. The Reactor System
    5. Summary
  9. 8. Extending Salt: Part II
    1. Python Client API
      1. Reading Configuration Data on a Master and Minion
      2. Using the Master Client (LocalClient) API
      3. Using the Caller Client API
    2. Custom Runners
      1. Writing a Custom Runner
      2. Using the RunnerClient API
    3. Summary
  10. 9. Topology and Configuration Options
    1. Master Configuration
      1. Directories and Files
      2. Logging
      3. Access Control
      4. File Server Options
    2. Topology Variations
      1. Masterless Minions
      2. Peer System
      3. Syndication Masters
      4. Multiple Masters
  11. 10. Brief Introduction to salt-cloud
    1. Overview
    2. Setup: AWS and salt-cloud
      1. Installing salt-cloud
      2. Cloud Providers
      3. Cloud Profiles
      4. Cloud Maps
    3. Introspection via salt-cloud
    4. Creating an Infrastructure
    5. More Information
  12. A. Using Vagrant to Run Salt Examples
    1. Install Companion Code, VirtualBox, and Vagrant
    2. Configure Salt
  13. B. YAML
  14. Index