Tutorial

How To Install Salt on Ubuntu 12.04

Published on August 20, 2013
Default avatar

By Dave Boucha

How To Install Salt on Ubuntu 12.04

Status: Deprecated

This article covers a version of Ubuntu that is no longer supported. If you are currently operate a server running Ubuntu 12.04, we highly recommend upgrading or migrating to a supported version of Ubuntu:

Reason: Ubuntu 12.04 reached end of life (EOL) on April 28, 2017 and no longer receives security patches or updates. This guide is no longer maintained.

See Instead: This guide might still be useful as a reference, but may not work on other Ubuntu releases. If available, we strongly recommend using a guide written for the version of Ubuntu you are using. You can use the search functionality at the top of the page to find a more recent version.

<b>An Article From <a href=“http://saltstack.com”>SaltStack</a> Submitted by: Dave Boucha</b>

Introduction

Salt is an awesome 100% open source configuration management and remote execution tool. Salt is a new approach to infrastructure management. Easy enough to get running in minutes, scalable enough to manage tens of thousands of servers, and fast enough to communicate with them in seconds.

SaltStack is the awesome and open company behind Salt. All Salt code and features are released under the Apache 2.0 license and can be downloaded at https://github.com/saltstack/salt and your preferred OS’s package manager.

In this article we will accomplish the following:

  • Install a Salt Master and a Salt Minion on a DigitalOcean droplet running Ubuntu 12.04
  • Execute commands

This article assumes the following:

  • You’ve already created a DigitalOcean droplet running Ubuntu 12.04
  • You’re already logged in as the default root user
  • That’s it!

Installation

Ok, the first thing we’re going to do is add the SaltStack ppa:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:saltstack/salt

Hit Enter when prompted.

Now update the apt package database:

sudo apt-get update

Once you’ve added the ppa we can now install the Salt Master and the Salt Minion:

sudo apt-get install salt-master
sudo apt-get install salt-minion

Now we just need to tell the Salt Minion where to find its Salt Master. Since we’re running the Salt Master and the Salt Minion on the same host we’re, going to set the master config option to localhost. Use your preferred editor to modify the Salt Minion’s config file:

vi /etc/salt/minion

Change the master config option to localhost and remove the # to uncomment it.

master: localhost

Now save your changes and then restart the Salt Minion service:

service salt-minion restart

List all the Minion keys your Master knows about:

salt-key -L

The Minion’s key should now show up under Unaccepted Keys. Your droplet’s name should appear where dave03 appears below:

Accepted Keys:
Unaccepted Keys:
dave03
Rejected Keys:

The last thing we need to do is have the Master accept the Minion’s public key. Use your droplet’s name instead of ‘dave03’:

salt-key -a 'dave03'

You should see output similar to what’s below:

The following keys are going to be accepted:
Unaccepted Keys:
dave03
Proceed? [n/Y] y
Key for minion dave03 accepted.

You now have a working Salt Master and Salt Minion running on your Ubuntu 12.04 server! Let’s try out some of the commands that you can run.

Check that the Minion responds:

salt '*' test.ping

Output:

dave03:
        True

Let’s list the server’s ip addresses:

salt 'dave03' network.ip_addrs

Output:

dave03:
        - 192.xxx.xxx.xxx

Let’s install nginx:

root@dave03:~# salt 'dave03' pkg.install nginx

root@dave03:~# salt 'dave03' service.start nginx

See Also

We’ve created some basic Salt formulas that make use of Salt’s built in states to configure our server. This is just the very beginning of what you can do with Salt!

The Official SaltStack Walkthrough is a great way to learn more about Salt.

To learn more about all the ways Salt can help you manage your infrastructure read through the extensive documentation for Salt at http://docs.saltstack.com

Please come join the great Salt community! Our mailing list is [here] (https://groups.google.com/forum/#!forum/salt-users) and our IRC channel is #salt on freenode.

Development of Salt takes place here: https://github.com/saltstack/salt

Please feel free to stop by and ask for help!

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about us


Tutorial Series: An Introduction to Salt

Salt is an open-source configuration management and remote execution tool. This tutorial series serves as an introduction to Salt, and will help beginners to get started with using the application.

About the authors
Default avatar
Dave Boucha

author

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
 
Leave a comment


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Join the Tech Talk
Success! Thank you! Please check your email for further details.

Please complete your information!

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel