-
-
Save baniobloom/5167cddf53d08b5c21b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pull in the reactor payload data | |
{% set target = salt['pillar.get']('target_server') %} | |
{% set grains_dict = salt['pillar.get']('grains_dict') %} | |
common_setup: | |
salt.state: | |
- tgt: {{ target }} | |
- sls: | |
- common.commonstate | |
{% if 'ebs_volumes' in grains_dict %} | |
{% for volume in grains_dict['ebs_volumes'] %} | |
mkdir_{{ grains_dict['ebs_volumes'][volume]['mount_point'] }}: | |
salt.function: | |
- tgt: {{ target }} | |
- name: file.mkdir | |
- arg: | |
- {{ grains_dict['ebs_volumes'][volume]['mount_point'] }} | |
attach_{{volume}}: | |
salt.function: | |
- tgt: 'role:saltmaster' | |
- tgt_type: grain | |
- name: cmd.run | |
- arg: | |
- /usr/local/bin/ebsattach.py -i {{ grains_dict['ec2']['instance_id'] }} -l {{ grains_dict['ebs_volumes'][volume]['lineage_tag'] }} -s {{ grains_dict['ebs_volumes'][volume]['default_size'] }} -a {{ grains_dict['ec2']['placement']['availability_zone'] }} -d {{ grains_dict['ebs_volumes'][volume]['device'] }} | |
- require: | |
- salt: common_setup | |
- salt: mkdir_{{ grains_dict['ebs_volumes'][volume]['mount_point'] }} | |
mount_{{ grains_dict['ebs_volumes'][volume]['mount_point'] }}: | |
salt.state: | |
- tgt: {{ target }} | |
- sls: | |
- common.mount | |
- arg: | |
- volume: volume | |
{% endfor %} | |
{% endif %} | |
highstate_setup: | |
salt.state: | |
- tgt: {{ target }} | |
- highstate: True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment