Skip to content

Instantly share code, notes, and snippets.

View thatch45's full-sized avatar

Thomas S Hatch thatch45

View GitHub Profile
@thatch45
thatch45 / gist:1848800
Created February 16, 2012 23:38
many states, one id
httpd:
pkg:
- installed
service:
- running
- require:
- pkg: httpd
file:
- managed
- name: /etc/httpd/conf/httpd.conf
@thatch45
thatch45 / req.sls
Created February 21, 2012 22:40
require id and name
git:
pkg:
- installed
- name: git core
/etc/git/gitconfig:
file:
- managed
- source: salt://git/gitconfig
- require:
emacs:
pkg:
- installed
{% if grains['osrelease'].startswith('5') %}
- name: emacsBROKEN
{% endif %}
@thatch45
thatch45 / states.state.py
Created March 1, 2012 16:19 — forked from sirkonst/states.state.py
State of states module for salt (saltstack)
"""
State module
============
The state module for logical union of several states.
Available Functions
-------------------
some_config:
file:
- managed
- source: salt://some_service/vtag
- require: # or require declaration
- file: /etc/some_service/conf_1.conf
- file: /etc/some_service/conf_2.conf
- file: /etc/some_service/conf_3.conf
some_service:
@thatch45
thatch45 / file_roots master
Created March 2, 2012 18:46
Env priorities
file_roots:
base:
- /srv/salt/base
dev:
- /srv/salt/dev
- /srv/salt/base
# Some config stuff
module_dirs:
{% if grains['fqdn'] == 'foo'%}
- /path/to/dir
{% endif %}
@thatch45
thatch45 / gist:2141958
Created March 20, 2012 22:30
ssh error
Traceback (most recent call last):
File "/usr/bin/salt-call", line 21, in <module>
main()
File "/usr/bin/salt-call", line 17, in main
client.run()
File "/usr/lib/python2.7/site-packages/salt/cli/__init__.py", line 738, in run
caller.run()
File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 112, in run
ret = self.call()
File "/usr/lib/python2.7/site-packages/salt/cli/caller.py", line 46, in call
apt-update:
cmd:
- wait
- name: /usr/bin/apt-get update
@thatch45
thatch45 / gist:2484144
Created April 24, 2012 21:50
many state decs, one id dec
fred:
group:
- present
- gid: 2000
user:
- present
- uid: 2000
- gid: 2000
- require:
- group: fred