provisioning-catalog/providers/demo/templates/demo_volumes.j2

38 lines
732 B
Text
Raw Permalink Normal View History

#!/bin/bash
# Demo Provider Volume Provisioning
# Generated by provisioning at {{ now }}
set -e
{% if debug and debug == "yes" %}set -x{% endif %}
echo "=== Creating Volumes ==="
{%- for volume in volumes %}
{%- if volume.name %}
echo ""
echo "Creating volume: {{ volume.name }}"
{%- if volume.size %}
VOLUME_SIZE={{ volume.size }}
{%- else %}
VOLUME_SIZE=20
{%- endif %}
{%- if volume.type %}
VOLUME_TYPE="{{ volume.type }}"
{%- else %}
VOLUME_TYPE="standard"
{%- endif %}
VOLUME_ID="vol-$(echo {{ volume.name }} | tr ' ' '-')"
echo "✓ Volume {{ volume.name }} created: $VOLUME_ID"
echo " Size: $VOLUME_SIZE GB"
echo " Type: $VOLUME_TYPE"
{%- endif %}
{%- endfor %}
echo ""
echo "=== Volume Creation Complete ==="