Skip to content

Instantly share code, notes, and snippets.

@jcockhren
Last active February 16, 2016 22:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcockhren/6697195 to your computer and use it in GitHub Desktop.
Save jcockhren/6697195 to your computer and use it in GitHub Desktop.
Simple salt example. core.sls is in the same directory as top.sls (that's one way to designate a state file). monitoring state ID is defined in a FILE called "init.sls" in the "monitoring" subdirectory.
core:
pkg.installed:
- pkgs:
- htop
- vim-nox
- git-core
- zsh
- tmux
- git
/etc/apt/sources.list.d/newrelic.list:
file.managed:
- source: salt://monitoring/newrelic.list
- user: root
- group: root
- mode: 644
newrelic-sysmond:
pkgrepo.managed:
- humanname: New Relic
- name: deb http://apt.newrelic.com/debian/ newrelic non-free
- file: /etc/apt/sources.list.d/newrelic.list
- keyid: 548C16BF
- keyserver: subkeys.pgp.net
- require_in:
- pkg: newrelic-sysmond
pkg:
- installed
service:
- running
- enable: True
- require:
- pkg: newrelic-sysmond
- watch:
- file: /etc/newrelic/nrsysmond.cfg
/etc/newrelic/nrsysmond.cfg:
file.managed:
- source: salt://monitoring/nrsysmond.cfg
- user: root
- group: root
- mode: 644
- replace: True
- template: jinja
base:
'*':
- core
'* and not G@roles:vagrant':
- match: compound
- monitoring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment