Bootstrapping Salt

Length: 00:08:21

Lesson Summary:

Bootstrapping Salt is a simple process that uses the same series of commands across all available distros. To bootstrap Salt, we first want to prepare our servers by setting our hostnames and ensure any servers acting as minions can access the master via the hostname salt. Next, we want to pull down the installation script using any file retrieval application, such as curl or wget. Then, we want to run the installation script – and that's all it takes to bootstrap Salt!

Now, let's go ahead and set up the system we're going to use throughout the bulk of this course.

Bootstrapping the Demo Environment

We'll be using three Linux Academy Cloud Servers:

  • Master: Ubuntu 16.04
  • Minion1: Ubuntu 16.04
  • Minion2: CentOS 7

Master Setup

We'll be using the Ubuntu 16.04 server as our Salt Master. Let's get started:

  1. Update the hostname and the /etc/hosts file so that the servers answers to the hostname salt:

     sudo hostnamectl set-hostname salt
     sudo $EDITOR /etc/hosts
    
     127.0.0.1 localhost salt
    
  2. Download the installation script; this example uses curl:

     curl -L https://bootstrap.saltstack.com -o install_salt.sh
    
  3. Run the installer; remember we want the Salt Master to be a minion against itself:

     sudo sh install_salt.sh -P -M
    

Minion 1 Setup

Our first minion, which we'll name minion1, will be our Ubuntu 14.04 server:

  1. Update the hostname and /etc/hosts file so the hostname resolves to minion1; we also want to ensure that the hostname salt resolves to the local IP address of our Master.

     sudo hostnamectl set-hostname minion1
     sudo $EDITOR /etc/hosts
    
     <MASTER_PRIVATE_IP> salt
    
  2. Download the installation script:

     curl -L https://bootstrap.saltstack.com -o install_salt.sh
    
  3. Run the installer; remember, this is a minion server:

     sudo sh install_salt.sh -P
    

Minion 2 Setup

  1. Update the hostname and /etc/hosts file so the hostname resolves to minion2; we also want to ensure that the hostname salt resolves to the local IP address of our Master.

     sudo hostnamectl set-hostname minion2
     sudo $EDITOR /etc/hosts
    
     <MASTER_PRIVATE_IP> salt
    
  2. Download the installation script:

     curl -L https://bootstrap.saltstack.com -o install_salt.sh
    
  3. Run the installer; remember, this is a minion server:

     sudo sh install_salt.sh -P
    

With this done, we now want to finish the "handshake" process between our Master and minions, so that the connection between the two is established and secure. This will be covered in our next section!


This lesson is only available to Linux Academy members.

Sign Up To View This Lesson
Or Log In

Looking For Team Training?

Learn More