jfusterm / learn-salt

Create Saltstack environments for educational purposes using Vagrant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

learn-salt

Deploy easily an environment where you can test and learn Salt. Check Salt in 10 minutes for more information.

The environment is composed of one master and several minions.

  • salt-master

    • OS: Ubuntu Xenial
    • IP: 192.168.43.10
    • Boot by default: Yes
  • salt-minion1

    • OS: Ubuntu Xenial
    • IP: 192.168.43.11
    • Boot by default: Yes
  • salt-minion2

    • OS: CentOS 7
    • IP: 192.168.43.12
    • Boot by default: No
  • salt-minion3

    • OS: Debian Jessie
    • IP: 192.168.43.13
    • Boot by default: No

Requirements

Usage

  1. Clone the repository
$ git clone https://github.com/jfusterm/learn-salt.git
$ cd learn-salt
  1. Launch the VMs
$ vagrant up

This will launch just the master and minion1. If you want to start minion2 or minion3 to test Salt's integration with different operating systems you can do it using:

$ vagrant up salt-minion2

If you want to start the master and all the minions at once:

$ vagrant up "/salt-*/"
  1. Connect to the VMs using the VM name
$ vagrant ssh salt-master
  1. Check that the master has access to the minions

By default, all the minions will be connected to the master automatically. You can check that the master can reach the minions.

$ vagrant status
Current machine states:

salt-master               running (virtualbox)
salt-minion1              running (virtualbox)
salt-minion2              running (virtualbox)
salt-minion3              running (virtualbox)

$ docker ssh salt-master

ubuntu@salt-master:~$ sudo salt-key -L
Accepted Keys:
salt-minion1
salt-minion2
salt-minion3
Denied Keys:
Unaccepted Keys:
Rejected Keys:

ubuntu@salt-master:~$ sudo salt '*' test.ping
salt-minion3:
    True
salt-minion1:
    True
salt-minion2:
    True

Vagrant configuration

You can adjust your Salt environment changing the options included in the configuration file config.rb

  • $vm_gui. If you want to start the VM with GUI, set this to true.

  • $vm_memory. Amount of memory assigned to the VM.

  • $vm_cpus. Number of CPUs assigned to the VM.

  • $install_type. Which release of Salt will be used.

    • stable
    • git
    • daily
    • testing
  • $install_syndic. If true, Salt Syndic will be installed on the master.

  • $verbose. If true, Salt's installation will be verbose.

  • $colorize. If true, Salt's installation output will be colorized.

Salt configuration

If you want to test thoroughly Salt's configuration you can edit either /etc/salt/master or /etc/salt/minion followed by a service restart.

On the master.

systemctl restart salt-master

On the minion.

systemctl restart salt-minion

About

Create Saltstack environments for educational purposes using Vagrant

License:MIT License


Languages

Language:Ruby 74.4%Language:Shell 25.6%