Andy Bavier | 0566e1d | 2015-12-23 16:10:12 -0500 | [diff] [blame^] | 1 | FN=nodes.yaml |
Scott Baker | 431c1e4 | 2015-09-28 16:43:10 -0700 | [diff] [blame] | 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 | |
Andy Bavier | 0566e1d | 2015-12-23 16:10:12 -0500 | [diff] [blame^] | 11 | description: autogenerated nodes file |
Scott Baker | 381d140 | 2015-09-28 21:29:54 -0700 | [diff] [blame] | 12 | |
Scott Baker | 431c1e4 | 2015-09-28 16:43:10 -0700 | [diff] [blame] | 13 | topology_template: |
| 14 | node_templates: |
| 15 | MyDeployment: |
Scott Baker | 381d140 | 2015-09-28 21:29:54 -0700 | [diff] [blame] | 16 | type: tosca.nodes.Deployment |
Scott Baker | 431c1e4 | 2015-09-28 16:43:10 -0700 | [diff] [blame] | 17 | mysite: |
Scott Baker | 381d140 | 2015-09-28 21:29:54 -0700 | [diff] [blame] | 18 | type: tosca.nodes.Site |
Scott Baker | 431c1e4 | 2015-09-28 16:43:10 -0700 | [diff] [blame] | 19 | EOF |
| 20 | |
Andy Bavier | 42831ac | 2015-12-08 15:30:15 -0500 | [diff] [blame] | 21 | NODES=$( bash -c "source ./admin-openrc.sh ; nova hypervisor-list" |grep enabled|awk '{print $4}' ) |
Scott Baker | 431c1e4 | 2015-09-28 16:43:10 -0700 | [diff] [blame] | 22 | I=0 |
| 23 | for NODE in $NODES; do |
| 24 | echo $NODE |
| 25 | cat >> $FN <<EOF |
| 26 | $NODE: |
| 27 | type: tosca.nodes.Node |
| 28 | requirements: |
| 29 | - site: |
| 30 | node: mysite |
| 31 | relationship: tosca.relationships.MemberOfSite |
| 32 | - deployment: |
| 33 | node: MyDeployment |
| 34 | relationship: tosca.relationships.MemberOfDeployment |
| 35 | EOF |
| 36 | done |