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

Book Description

Over 80 hands-on recipes to efficiently configure and manage your infrastructure with Salt

In Detail

Salt has become one of the major players in automation and configuration management solutions

This book starts with the basics of the tool, the procedures to get up and running with Salt and then moves on to configuring very simple but important details to receive optimal performance from the tool. It also walks you through Salt configurations for different infrastructure components and the details of the Salt modules for each of the components. The book also provides some common problem scenarios and how to troubleshoot them.

With detailed configuration, their explanation and command line outputs of the module execution, Salt Cookbook will help you to get up and running with Salt for all your infrastructural needs.

What You Will Learn

  • Understand the basic Salt architecture and components and learn how to configure them

  • Understand and configure advanced Salt components and manipulate configurations

  • Configure Salt modules, the orchestration procedure and set up multi-master configurations

  • Configure operating system components such as files, users, volumes, authentication, and so on

  • Leverage the cloud capabilities of Salt

  • Understand and configure the Salt event and reactor system

  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. Salt Cookbook
      1. Table of Contents
      2. Salt Cookbook
      3. Credits
      4. About the Author
      5. About the Reviewer
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Sections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Salt Architecture and Components
        1. Introduction
        2. Installing and configuring the Salt master
          1. How to do it...
            1. Installing the Salt master on RedHat/CentOS/Fedora
            2. Installing the Salt master on Ubuntu
            3. Configuring the Salt master
          2. How it works...
          3. See also
        3. Configuring the Salt environment and pillar paths
          1. How to do it...
          2. How it works...
          3. See also
        4. Understanding and configuring Salt pillars
          1. How to do it...
          2. How it works...
          3. See also
        5. Understanding and writing Salt states
          1. How to do it...
          2. How it works...
          3. See also
        6. Understanding and writing the top file
          1. How to do it...
          2. How it works...
          3. There's more…
          4. See also
        7. Installing and configuring the Salt minion
          1. How to do it...
            1. Installing the Salt minion on RedHat/CentOS/Fedora
            2. Installing the Salt minion on Ubuntu
            3. Configuring the Salt minion
          2. How it works...
          3. There's more...
            1. The masterless minion
          4. See also
        8. Configuring environments and grains on the minion
          1. How to do it...
            1. Setting grains in /etc/salt/minion
            2. Setting grains in /etc/salt/grains
          2. How it works...
            1. Setting grains in /etc/salt/minion
            2. Setting grains in /etc/salt/grains
          3. See also
        9. Applying Salt states to minions
          1. How to do it...
            1. Applying states using the push mechanism from master to minion
            2. Applying states using the pull mechanism by minion from master
          2. How it works...
          3. There's more...
            1. Applying Salt states to masterless minions
          4. See also
      9. 2. Writing Advanced Salt Configurations
        1. Introduction
        2. Writing and retrieving pillar data
          1. How to do it...
          2. How it works...
          3. See also
        3. Using pillar data in states
          1. How to do it...
          2. How it works...
          3. There's more...
            1. Including other pillars in the pillar file
            2. Setting pillar data at the command line
          4. See also
        4. Using grains in states
          1. How to do it...
          2. How it works...
          3. See also
        5. Using conditionals in states and pillars
          1. How to do it...
          2. How it works...
          3. See also
        6. Using Python functions in conditionals
          1. How to do it...
          2. How it works...
          3. See also
        7. Using iterations in states
          1. How to do it...
          2. How it works...
          3. See also
        8. Setting and using variables in states
          1. How to do it...
          2. How it works...
          3. See also
        9. Testing a state run before applying to minions
          1. How to do it...
          2. How it works...
          3. See also
        10. Configuring nodegroups
          1. How to do it...
          2. How it works...
          3. See also
        11. Targeting minions
          1. How to do it...
          2. How it works...
          3. See also
      10. 3. Modules, Orchestration, and Scaling Salt
        1. Introduction
        2. Using execution modules
          1. How to do it...
          2. How it works...
          3. See also
        3. Using state modules
          1. How to do it...
          2. How it works...
          3. There's more…
          4. See also
        4. Configuring templates
          1. How to do it...
          2. How it works...
          3. See also
        5. Using requisites
          1. How to do it...
          2. How it works...
          3. There's more…
          4. See also
        6. Using Salt runners
          1. How to do it...
          2. How it works...
          3. See also
        7. Orchestration with Salt orchestrate
          1. How to do it...
          2. How it works...
          3. See also
        8. Salt multi-master setup (active-active mode)
          1. How to do it...
          2. How it works...
          3. See also
        9. Salt multi-master setup (active-passive mode)
          1. How to do it...
          2. How it works...
          3. See also
      11. 4. General Administration Tasks
        1. Introduction
        2. Running commands
          1. How to do it...
          2. How it works...
          3. There's more…
          4. See also
        3. Setting host entries and grains
          1. How to do it...
          2. How it works...
          3. See also
        4. Setting time zone, locale, and kernel configurations
          1. How to do it...
          2. How it works...
          3. See also
        5. Handling archive files
          1. How to do it...
          2. How it works...
          3. See also
        6. Adding groups and users
          1. How to do it...
          2. How it works...
          3. See also
        7. Performing SSH authentication tasks
          1. How to do it...
          2. How it works...
          3. See also
        8. Scheduling jobs with cron
          1. How to do it...
          2. How it works...
          3. See also
        9. Managing volumes
          1. How to do it...
          2. How it works...
          3. See also
        10. Working with disks and mounts
          1. How to do it...
          2. How it works...
          3. There's more…
          4. See also
        11. Managing network configurations
          1. How to do it...
          2. How it works...
          3. See also
      12. 5. Advanced Administration Tasks
        1. Introduction
        2. Managing package repositories
          1. How to do it...
          2. How it works...
          3. See also
        3. Managing packages using the default package manager
          1. How to do it...
          2. How it works...
          3. See also
        4. Managing packages using rvm, gem, and pip
          1. How to do it...
          2. How it works...
          3. See also
        5. Managing files
          1. How to do it...
          2. How it works...
          3. See also
        6. Managing services
          1. How to do it...
          2. How it works...
          3. See also
        7. Managing code repositories with Git
          1. How to do it...
          2. How it works...
          3. See also
        8. Managing code repositories with svn
          1. How to do it...
          2. How it works...
          3. See also
        9. Configuring alternatives
          1. How to do it...
          2. How it works...
          3. See also
      13. 6. Managing Application Servers
        1. Introduction
        2. Apache web server packages and services
          1. How to do it...
          2. How it works...
          3. See also
        3. Managing web server modules
          1. How to do it...
          2. How it works...
          3. There's more…
          4. See also
        4. Adding web server configuration
          1. How to do it...
          2. How it works...
          3. See also
        5. Web server security with htpasswd
          1. How to do it...
          2. How it works...
          3. See also
        6. Setting up Java for Apache Tomcat
          1. How to do it...
          2. How it works...
          3. See also
        7. Apache Tomcat packages, files, and services
          1. How to do it...
          2. How it works...
          3. See also
        8. Deploying the WAR file in Apache Tomcat
          1. How to do it...
          2. How it works...
          3. There's more…
          4. See also
      14. 7. Managing Databases
        1. Introduction
        2. Using MySQL packages, files, and services
          1. How to do it...
          2. How it works...
          3. See also
        3. Using MySQL databases
          1. How to do it...
          2. How it works...
          3. See also
        4. Creating MySQL database users
          1. How to do it...
          2. How it works...
          3. See also
        5. Running MySQL queries
          1. How to do it...
          2. How it works...
          3. See also
        6. Providing MySQL user grants
          1. How to do it...
          2. How it works...
          3. See also
        7. Using PostgreSQL packages, files, and services
          1. How to do it...
          2. How it works...
          3. See also
        8. Setting up PostgreSQL groups and users
          1. How to do it...
          2. How it works...
          3. See also
        9. Configuring PostgreSQL databases
          1. How to do it...
          2. How it works...
          3. See also
      15. 8. Configuring Salt Cloud
        1. Introduction
        2. Configuring the Salt cloud environment
          1. How to do it...
          2. How it works...
          3. See also
        3. Configuring cloud providers
          1. How to do it...
          2. How it works...
          3. See also
        4. Configuring cloud profiles
          1. How to do it...
          2. How it works...
          3. See also
        5. Extending profiles and providers
          1. How to do it...
          2. How it works...
          3. See also
        6. Configuring cloud maps
          1. How to do it...
          2. How it works...
          3. See also
        7. Using post-install scripts
          1. How to do it...
          2. How it works...
          3. See also
        8. Launching, querying, and destroying instances
          1. How to do it...
          2. How it works...
          3. See also
        9. Performing general cloud functions
          1. How to do it...
          2. How it works...
          3. See also
      16. 9. Managing Amazon Web Services
        1. Introduction
        2. Implementing security groups
          1. How to do it...
          2. How it works...
          3. There's more…
          4. See also
        3. Using elastic load balancers
          1. How to do it...
          2. How it works...
          3. See also
        4. Configuring DNS with Route53
          1. How to do it...
          2. How it works...
          3. See also
        5. Configuring Simple Queue Service
          1. How to do it...
          2. How it works...
          3. See also
        6. Deploying ElastiCache clusters
          1. How to do it...
          2. How it works...
          3. See also
        7. Configuring CloudWatch alarms
          1. How to do it...
          2. How it works...
          3. See also
      17. 10. Salt Event and Reactor System
        1. Introduction
        2. Learning the basics of the event system
          1. How to do it...
          2. How it works...
          3. See also
        3. Listening to events
          1. How to do it...
          2. How it works...
          3. There's more…
          4. See also
        4. Firing events
          1. How to do it...
          2. How it works...
          3. There's more…
          4. See also
        5. Identifying and working with Salt event types
          1. How to do it...
          2. How it works...
          3. See also
        6. Integrating and configuring the reactor system
          1. How to do it...
          2. How it works...
          3. See also
        7. Using reactors for Salt tasks
          1. How to do it...
          2. How it works...
          3. See also
      18. 11. Troubleshooting
        1. Introduction
        2. Troubleshooting the Salt master
          1. How to do it...
          2. How it works...
          3. See also
        3. Troubleshooting the Salt minion
          1. How to do it...
          2. How it works...
          3. See also
        4. Dealing with too many open files
          1. How to do it...
          2. How it works...
          3. See also
        5. Connectivity, DNS, and ports
          1. How to do it...
          2. How it works...
          3. See also
        6. Dealing with YAML configuration problems
          1. How to do it...
          2. How it works...
          3. See also
      19. Index