Using SaltStack with Linode Cloud

Lately I added some parts about using Salt Cloud to create and manipulate Cloud VMs in SaltStack For DevOps Book, that’s why I would like to share with you a quickstart to create Linode Cloud VMs using SaltStack.

Linode (a portmanteau of the words linux and node) is a virtual private server/cloud hosting provider offering SSD Linux servers and simple management tools.

We will be using the Linode 1GB server with Salt Cloud.

Follow those steps to set up a Linode key that will be used with Salt Cloud:

– Go to Linode site
– Create a free account
– After confirming the account from your email, log in
– Click on ‘My Profile’
– Re-authenticate to unlock the settings
– Click on ‘API keys’
– Generate a key (I gave it the name ‘salt_cloud_demo’)

Note that you should save the generated key in your local machine since you will not be able to view it again in the web manager.

Note that I use this file structure when I work with Salt Cloud:

Let’s set up the provider configuration file for Linode:

As you can see in the next configuration, we are using the apikey provided by Linode with the password.

You should also configure the ssh_pubkey that you are using on your machine (in this example, I am executing Salt Cloud command from my local machine on a remote Linode server).

If you don’t have a public key, generate a key pair (public/private) using this command:

Now let’s create a Salt Cloud Profile file:

Nice ! Let’s start our machine ‘testing_server‘ based on ‘ubuntu_linode‘ profile:

Let’s start two machines:

Now we had two Linode machines with the following configuration:

Note that using Salt Cloud Maps could help you to create infrastructures instead of creating just some VMs, you should give it a try if you want to use SaltStack for managing Cloud VMs.

Well, this was just a quickstart, I am working on other examples that I will publish in SaltStack For DevOps book, do not hesitate if you have suggestions 🙂

Cheers.

You may also like...