Skip to content

Instantly share code, notes, and snippets.

Created February 4, 2016 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/a7d6a21177a9f15a6cf7 to your computer and use it in GitHub Desktop.
Save anonymous/a7d6a21177a9f15a6cf7 to your computer and use it in GitHub Desktop.
# /srv/salt/elb/init.sls
add-instances:
boto_elb.register_instances:
- name: staging-elb
- keyid: {{ pillar['aws']['keyid'] }}
- key: {{ pillar['aws']['key'] }}
- instances:
{% for ec2 in salt['mine.get']('Salt-Minion-*', 'ec2', expr_form='pillar').items() %}
- {{ ec2['instance_id'] }}
{% endfor %}
# /srv/salt/pillar/ec2.sls
mine_functions:
ec2:
- mine_function: grains.get
- ec2
# /srv/salt/top.sls
base:
'*':
- requirements
- users
- ssh
- logging
- php
- composer
'Salt-Minion-1':
- pip
- boto
- rds
- elb
'G@Salt-Minion-*':
- awscli
- nginx
- ec2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment