Skip to content

Instantly share code, notes, and snippets.

@iggy
iggy / -etc-salt-master.d-60reactor.conf
Created April 1, 2015 01:16
sync all on minion start
# /etc/salt/master.d/60reactor.conf
# reactor config for salt master
reactor:
- 'salt/minion/*/start':
- salt://salt/reactor/sync_all.sls
# Tell each db server to run the pgsql command to coalesce the database
coalesce_db:
salt.function:
- name: postgres.psql_query
- tgt: 'tags:db'
- tgt_type: grain
- arg:
- "select pg_start_backup('foo');"
# we want our salt master to run the cloud snapshot script
# See http://serverfault.com/questions/538218/deploy-ssh-key-from-master-to-minion-via-salt-pillars
{% for user, data in salt['pillar.get']('users', {}).iteritems() %}
add_{{ user }}:
user.present:
uid: {{ data['uid'] }}
{% endfor %}
# vim : set ft=yaml tabstop=2 sts=2 sw=2 et ai si
@iggy
iggy / master-reactor.conf
Created April 15, 2015 16:05
reactor calling orchestrate
reactor:
- 'salt/minion/*repo*/start':
- salt://salt/reactor/repo_start.sls
@iggy
iggy / map.jinja
Created April 16, 2015 22:42
dict merging hurts my eyes
{% import_yaml "mongodb/defaults.yaml" as defaults %}
{% import_yaml "mongodb/osmap.yaml" as osmap %}
{% import_yaml "mongodb/codenamemap.yaml" as codemap %}
{# get the settings for the os_family grain #}
{% set osfam = salt['grains.filter_by'](osmap) %}
{# get the settings for the oscodename grain, os_family data will override
oscodename data #}
{% set oscode = salt['grains.filter_by'](codemap,
grain='oscodename',
Host salt-states-github.com
Hostname github.com
IdentityFile /etc/salt/pki/ssh/salt-states-ssh-key
StrictHostKeyChecking no
@iggy
iggy / error.txt
Created May 14, 2015 15:18
file.recurse failure
----------
ID: put-files-in-srv-modules-grains
Function: file.recurse
Name: /srv/modules/grains/
Result: False
Comment: #### /srv/modules/grains/. ####
Specified target /srv/modules/grains/. is a directory
Started: 00:24:17.862156
Duration: 22.618 ms
Changes:
@iggy
iggy / guidelines.md
Last active August 29, 2015 14:21
Formula Guidelines

Intended Audience

This document is intended as a set of loose guidelines for people with commit access to the saltstack-formulas GitHub organization. This is not meant for people who just want to make changes to formulas except as a reference for what committers tend to look out for in pull requests.

Intro

Formulas are commonly used by many SaltStack users, as such, we have certain guidelines we should all attempt to follow to ensure they continue to function in the manner to which people have become accustomed.

Guidelines

  1. No committing to master
  • You should never commit directly to master
  • All commits should go through the normal pull request process whether it's a one character change or a 4000+ line change
  1. No merging your own pull requests
  • You should always have someone else review and merge your pull requests
@iggy
iggy / defaults.py.patch
Created June 4, 2015 19:14
WIP defaults.get addition
--- /usr/lib/python2.7/dist-packages/salt/modules/defaults.py 2015-05-11 06:37:45.000000000 -0500
+++ _modules/defaults.py 2015-06-04 14:09:18.402593449 -0500
@@ -2,6 +2,7 @@
from __future__ import absolute_import
import inspect
import json
+import logging
import os
import yaml
@iggy
iggy / vultrpy.py.patch
Last active June 13, 2016 01:09
first cut at ssh key support for salt-cloud vultr provider
diff --git a/salt/cloud/clouds/vultrpy.py b/salt/cloud/clouds/vultrpy.py
index 2c88884..29959fd 100644
--- a/salt/cloud/clouds/vultrpy.py
+++ b/salt/cloud/clouds/vultrpy.py
@@ -9,15 +9,22 @@ The Vultr cloud module is used to control access to the Vultr VPS system.
Use of this module only requires the ``api_key`` parameter.
+You can optionally use ssh keys for the bootstrapping phase. See the example below.
+