Skip to content

SaltNotes

Josh Schairbaum edited this page Dec 20, 2013 · 6 revisions

Notes, hints, allegations of using Salt.

Commands

Bootstrapping

See saltstack/saltbootstrap for more information.

  • curl -L http://bootstrap.saltstack.org | sh -s -- -M git v0.17.0
  • curl -L http://bootstrap.saltstack.org | sh -s -- -h

Running It All

  • salt '*' state.highstate

Starting and Stopping

This is for Ubuntu. See directions.

  • service salt-master start
  • service salt-minion start

Viewing Pillar Items

  • salt '*' pillar.items

Idioms

Restart service when file changes

salt-minion:
  service:
    - running
    - watch:
      - file: /etc/salt/minion

Getting pillar data

Use salt['pillar.get']('key1:key2:key3', 'default_value') to dive into multi-level dicts.

{{ salt['pillar.get']('salt-master:host', 'master') }}