Skip to content

Instantly share code, notes, and snippets.

View SEJeff's full-sized avatar

Jeff Schroeder SEJeff

View GitHub Profile
[MASTER]
profile=no
persistent=yes
ignore=migrations
cache-size=500
[BASIC]
# Regular expression which should only match correct module names
module-rgx=([a-z][a-z0-9_]*)$

The mustache gotcha

When using “bound” objects in an .aurora file it is an absolute that you do not have spaces in the “mustaches”.

Examples:

  • Bad: {{ profile.my_var }}
  • Good: {{profile.my_var}}

Mesos Slave Constraints

When scheduling a task on aurora with Production=True, the 0.7-incubating scheduler will set a default constraint preventing more than one instance of the task on the same rack.

@SEJeff
SEJeff / djangomodule.py
Created February 28, 2012 00:37 — forked from fatbox/djangomodule.py
Load Django modules from within a Salt module
"""
This allows you to import Django modules into a Salt module
"""
import logging
import sys
import os
log = logging.getLogger(__name__)
include:
- apt
# our custom sources
/etc/apt/sources.list.d/fatbox.list:
file:
- managed
- source: salt://fatbox/debian/apt/fatbox.list
- owner: root
- group: root
/etc/salt/minion:
file:
- managed
- owner: root
- group: root
- mode: 444
- source: salt://salt/files/salt-minion.config
- template: jinja
- context:
{% if grains['fqdn'] == 'clients.fatbox.ca' %}
@SEJeff
SEJeff / djangomodule.py
Created March 28, 2012 21:46 — forked from fatbox/djangomodule.py
Load Django modules from within a Salt module
"""
This allows you to import Django modules into a Salt module
"""
import logging
import sys
import os
log = logging.getLogger(__name__)
@SEJeff
SEJeff / salt_mock.py
Created April 5, 2012 17:03 — forked from tgecho/salt_mock.py
Brainstormed mock for testing salt states and modules
class Mock(object):
def __init__(self):
history = []
unmet_expectations = []
def __call__(self, func, *args, **kwargs):
"""
Here we can grab a copy of the actual function/state and insert
the Mock object as __salt__ so the usual calls to
@SEJeff
SEJeff / yaml_ordered_dict.py
Created May 21, 2012 23:28 — forked from enaeseth/yaml_ordered_dict.py
Load YAML mappings as ordered dictionaries
import yaml
import yaml.constructor
try:
# included in standard lib from Python 2.7
from collections import OrderedDict
except ImportError:
# try importing the backported drop-in replacement
# it's available on PyPI
from ordereddict import OrderedDict
@SEJeff
SEJeff / gist:2769055
Created May 22, 2012 13:29 — forked from kadel/gist:2768868
Salt watch statement and requires example
ganglia-monitor:
pkg:
- installed
service:
- running
# Since the service name is ganglia-monitor and the daemon binary is gmond
- sig: '^gmond'
- watch:
- file: /etc/ganglia/gmond.conf
- pkg: ganglia-monitor
@SEJeff
SEJeff / gist:2777798
Created May 23, 2012 21:00 — forked from thatch45/gist:2484144
many state decs, one id dec
fred:
group:
- present
- gid: 2000
user:
- present
- uid: 2000
- gid: 2000
- require:
- group: fred