Skip to content

Demo repo with Vagrant cluster to showcase SaltStack orchestration.

Notifications You must be signed in to change notification settings

calvinhp/salt-orchestation-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Getting start with Salt Orchestration

This repository contains the salt states needed to configure a set of VMs to demo SaltStack.

Local Salt Testing

When creating state for this project you can test them locally using Vagrant. The current Vagrantfile is configure to bring up multiple virtual machines using VirtualBox.

Current Servers in Vagrantfile

  • salt
  • proxy
  • app1
  • app2
  • app3
  • db

Installing Vagrant

  1. Install VirtualBox.
  2. Install Vagrant.

Spinning up the virtual machines

Now that you have the required dependancies, you can start up a server to try your salt states onto.

The vagrant command will now be available from the command line. You will use this to start, stop and SSH into the virtual machines.

Start All of the Servers

You will need a lot of RAM...

$ vagrant up

Start just the Salt Master

$ vagrant up salt

Once it is bootstrapped the Salt master will still need to be highstated.

The salt.run_highstate = true Vagrant option will not work for the master as we would have to pre-seed the keys. That topic is out of scope for this demo and easy to work around.

$ vagrant ssh salt
$ sudo salt salt state.apply

Start just one of the Application Servers

$ vagrant up app1

Start just the Master and one App server

$ vagrant up salt app1

Shell into the Servers

$ vagrant ssh salt

Modify and Try the Salt States

$ vagrant up app1
Bringing machine 'app1' up with 'virtualbox' provider...
...
$ vagrant ssh app1
ubuntu@app1:~$ sudo salt-call state.apply

You can now edit the files locally on your workstation and re-run the state.apply as needed. You do not need to sync or reboot the VM for the changes to be picked up.

Test just one State

ubuntu@app1:~$ sudo salt-call state.apply django.code

Test just one ID in a Single State

ubuntu@app1:~$ sudo salt-call state.sls_id django django.django-deps

Shutting down your Virtual Machines

This will stop the running VMs, but will leave the data on your system.

$ vagrant halt

To completely remove the data from the system, you can destroy the setup.

$ vagrant destroy

That command will destroy the VMs, but your changes to the salt states remain in this repository.

About

Demo repo with Vagrant cluster to showcase SaltStack orchestration.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published