Skip to content

Instantly share code, notes, and snippets.

View knuta's full-sized avatar

Knut Auvor Grythe knuta

  • Base2 Solutions
View GitHub Profile
#!py
"""
Generates a master config snippet which contains one environment per user, so
you can test your salt configuration without commiting to the repository. This
way, you can run salt straight from your home directory like this:
salt-call state.highstate saltenv=$LOGNAME test=True
Remove test=True to actually execute the changes.
/etc/salt/master.d/pvv.conf:
file.managed:
- source: salt://{{ tpldir }}/master.d/pvv.conf.py
- template: py
/etc/service/postfix/run:
file.managed:
- contents: ...
/etc/postfix/main.cf
file.managed:
- source: ...
@knuta
knuta / whatever.sls
Created November 16, 2015 07:53
Salt: Install something from source
# A tarball with the sources
/root/whatever.tar.gz:
file.managed:
- source: salt://whatever/whatever.tar.gz
# A script for installing the sources
/usr/local/sbin/install-whatever.sh:
cmd.wait:
- watch:
- file: /usr/local/sbin/install-whatever.sh