How to get started?

Install sls

The command line tool sls will help you with installing salt states from saltstates.org or any git repository.

You can download sls from https://github.com/saltstates/cli

Using sls

On your salt master go to the directory containing your salt states, usually /srv/salt/states.

Create a .sls file in the salt states directory containing:

source: 'https://saltstates.org'
sls:
  - <state>
  - <state>: '<version>'
  - <state>: 'git:<git url>'

Now just run sls and you are done:

$ sls

Need more info about sls? check https://github.com/saltstates/cli

Using the states from saltstates.org

In this example we will be using the state ntp and all files mentioned are located on the salt master.

The .sls file:

source: 'https://saltstates.org'
sls:
  - ntp

Top state file (static):

base:
  '*':
    - saltstates

Top pillar file:

base:
  '*':
    - ntp

The ntp pillar file:

ntp:
  sls: ntp
  ntpservers: [ '127.0.0.1', '127.0.0.2' ]