Scott Baker | 5042166 | 2016-06-27 22:09:48 -0700 | [diff] [blame] | 1 | FN=$SETUPDIR/images.yaml |
| 2 | |
| 3 | rm -f $FN |
| 4 | |
| 5 | cat >> $FN <<EOF |
| 6 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 7 | |
| 8 | imports: |
| 9 | - custom_types/xos.yaml |
| 10 | |
| 11 | description: autogenerated nodes file |
| 12 | |
| 13 | topology_template: |
| 14 | node_templates: |
| 15 | mysite: |
| 16 | type: tosca.nodes.Site |
| 17 | |
| 18 | EOF |
| 19 | |
| 20 | IMAGES=$( bash -c "source $SETUPDIR/admin-openrc.sh ; glance image-list" |grep -v ID|grep -v +|awk '{print $4}' ) |
| 21 | I=0 |
| 22 | for IMAGE in $IMAGES; do |
| 23 | echo $IMAGE |
| 24 | cat >> $FN <<EOF |
| 25 | $IMAGE: |
| 26 | type: tosca.nodes.Image |
| 27 | properties: |
| 28 | disk_format: QCOW2 |
| 29 | container_format: BARE |
| 30 | |
| 31 | EOF |
| 32 | done |
| 33 | |
| 34 | cat >> $FN <<EOF |
| 35 | MyDeployment: |
| 36 | type: tosca.nodes.Deployment |
| 37 | properties: |
| 38 | flavors: m1.large, m1.medium, m1.small |
| 39 | requirements: |
| 40 | EOF |
| 41 | |
| 42 | for IMAGE in $IMAGES; do |
| 43 | cat >> $FN <<EOF |
| 44 | - image: |
| 45 | node: $IMAGE |
| 46 | relationship: tosca.relationships.SupportsImage |
| 47 | EOF |
| 48 | done |