Skip to content

Instantly share code, notes, and snippets.

View tlk2126's full-sized avatar

Thomas Kula tlk2126

View GitHub Profile
@tlk2126
tlk2126 / CUL iptables handling
Created June 10, 2014 19:07
CUL Handling of iptables rules within individual states, using Salt Stack
iptables:
pkg:
- installed
service:
- running
- enable: True
- reload: True
- require:
- pkg: iptables
/path/to/file:
securefile:
- managed
- source: securesalt://something/path/to/file
- key: {{ salt['pillar.get']('some:key:path') }}
ID: /home
Function: mount.mounted
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.6/site-packages/salt/state.py", line 1372, in call
self.verify_ret(ret)
File "/usr/lib64/python2.6/contextlib.py", line 34, in __exit__
self.gen.throw(type, value, traceback)
File "/usr/lib/python2.6/site-packages/salt/utils/context.py", line 43, in func_globals_inject
yield
some-conf-thing:
git:
- latest
- name: <git url>
- rev: <some git treeish thing, e.g. `prod'>
- target: /where/i/want/conf/to/appear
- force: True
- force_checkout: True
- user: <user this should run as>
- require:
/some/configuration/file:
file:
- managed
- source: ...
- template: jinja
# Pillar stuff:
db_master:
- master.db.name
cleary.cul.columbia.edu:
----------
State: - pkgrepo
Name: epel
Function: managed
Result: False
Comment: Failed to confirm config of repo epel: coercing to Unicode: need string or buffer, NoneType found
Changes: