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
Learning SaltStack

You're reading from   Learning SaltStack Build, manage, and secure your infrastructure with the power of SaltStack

Arrow left icon
Product type Paperback
Published in Jun 2016
Publisher Packt
ISBN-13 9781785881909
Length 202 pages
Edition 2nd Edition
Concepts
Arrow right icon
Author (1):
Arrow left icon
Colton Myers Colton Myers
Author Profile Icon Colton Myers
Colton Myers
Arrow right icon
View More author details
Toc

Managing groups of VMs with map files


So far, our exploration of Salt Cloud has been limited to operations on single VMs or manually compiled lists of VMs. This is very useful but doesn't scale as well because there's no central source of truth for your VMs, especially if you have VMs across multiple cloud providers.

Salt Cloud provides a tool to solve this problem: map files. Basically, we create a map of our infrastructure and all the VMs that are in it. When a map is executed, your infrastructure will be brought to the state defined in the map file. Any VMs that already exist will be unmodified, and any new VMs will be created.

Let's create a map file to create multiple Ubuntu and CentOS minions. The location of the map file is unimportant, as we will pass in an absolute path to the map file anyway. Let's create it at /etc/salt/mymap.sls, as follows:

ubuntu:
  - db1
  - db2
  - web1
centos:
  - web2
  - load

As you can see, cloud maps are also formatted in YAML. At their most basic, they...

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