Skip to content

Instantly share code, notes, and snippets.

View dginther's full-sized avatar

Demian Ginther dginther

  • Superorbital.io
  • Albuquerque, NM
View GitHub Profile
{% for grp in 'deploy','application' %}
{{ grp }}:
group:
- present
{% endfor %}
application:
user.present:
- require:
- group: application
----------
State: - cmd
Name: /tmp/SumoCollector_linux_amd64_19_47-5.sh
Function: script
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/salt/state.py", line 1238, in call
*cdata['args'], **cdata['kwargs'])
File "/usr/lib/pymodules/python2.7/salt/states/cmd.py", line 630, in script
run_check_cmd_kwargs, onlyif, unless, group
web:
'*-web*':
- roles.web
nginx:
pkg:
- installed
- name: nginx
service:
- running
- require:
- pkg: nginx
- reload: True
- enable: True
base:
'*':
- core
'ec2_roles:web':
- match: grain
- bashrc
- nginx
- sysctl
'ec2_roles:db':
- bashrc
mysql:
pkg:
- installed
- names:
- mysql-server
- mysql-client
- require:
- pkg: python-mysqldb
- module: 'mysql-debconf'
service:
include:
- mysql
icinga-repo:
pkgrepo.managed:
- humanname: Icinga PPA
- ppa: formorer/icinga
- require_in: icinga-pkgs
icinga-pkgs:
def ext_pillar( pillar, * args, **kwargs ):
pillar = {}
hostname = __grains__['nodename']
env = __grains__['ec2_environment']
roles = __grains__['ec2_roles']
if env == 'dev' and 'mail' in roles:
pillar['maildomain'] = 'dev-mail.fqdn'
zabbix-repo:
pkgrepo.managed:
- humanname: Zabbix Repo
- mirrorlist: http://repo.zabbix.com/zabbix (OR WHATEVER THE REPO IS)
zabbix:
pkg:
-installed
{% for user in pillar['users']['username'] %}
{{ user }}:
uid:
- present
{% endfor %}