Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning SaltStack
  • Table Of Contents Toc
  • Feedback & Rating feedback
Learning SaltStack

Learning SaltStack - Second Edition

By : Myers
3.6 (5)
close
close
Learning SaltStack

Learning SaltStack

3.6 (5)
By: Myers

Overview of this book

SaltStack is one of the best infrastructure management platforms available. It provides powerful tools for defining and enforcing the state of your infrastructure in a clear, concise way. With this book learn how to use these tools for your own infrastructure by understanding the core pieces of Salt. In this book we will take you from the initial installation of Salt, through running their first commands, and then talk about extending Salt for individual use cases. From there you will explore the state system inside of Salt, learning to define the desired state of our infrastructure in such a way that Salt can enforce that state with a single command. Finally, you will learn about some of the additional tools that salt provides, including salt-cloud, the reactor, and the event system. We?ll finish by exploring how to get involved with salt and what'?s new in the salt community. Finally, by the end of the book, you'll be able to build a reliable, scalable, secure, high-performance infrastructure and fully utilize the power of cloud computing.
Table of Contents (12 chapters)
close
close
11
Index

Our first state

Without further ado, let's write our first state. All Salt-specific files that aren't Python files end in the extension .sls. By default, the states are located in the /srv/salt/ directory. We created this directory in the previous chapter, but if you didn't follow along there, make this directory now, as follows:

# mkdir -p /srv/salt
# cd /srv/salt

Inside this directory, let's create a file named apache.sls, as shown in the following line of code:

# vim apache.sls

Here are the contents of that file:

install_apache:
  pkg.installed:
    - name: apache2

Note

State files are formatted using Yet Another Markup Language (YAML). The most common syntax errors in state files are forgetting the colons at the end of the first two lines, so watch out for that. More information about YAML can be found at http://www.yaml.org/. In addition, many simple YAML parsers can be found with a simple Google search. These can be very useful to detect simple syntax errors.

Let&apos...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning SaltStack
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon