blob: eafab4a835acfee72def424a17e99ffee15591fc [file] [log] [blame]
Andy Bavier0566e1d2015-12-23 16:10:12 -05001FN=nodes.yaml
Scott Baker431c1e42015-09-28 16:43:10 -07002
3rm -f $FN
4
5cat >> $FN <<EOF
6tosca_definitions_version: tosca_simple_yaml_1_0
7
8imports:
9 - custom_types/xos.yaml
10
Andy Bavier0566e1d2015-12-23 16:10:12 -050011description: autogenerated nodes file
Scott Baker381d1402015-09-28 21:29:54 -070012
Scott Baker431c1e42015-09-28 16:43:10 -070013topology_template:
14 node_templates:
15 MyDeployment:
Scott Baker381d1402015-09-28 21:29:54 -070016 type: tosca.nodes.Deployment
Scott Baker431c1e42015-09-28 16:43:10 -070017 mysite:
Scott Baker381d1402015-09-28 21:29:54 -070018 type: tosca.nodes.Site
Scott Baker431c1e42015-09-28 16:43:10 -070019EOF
20
Andy Bavier42831ac2015-12-08 15:30:15 -050021NODES=$( bash -c "source ./admin-openrc.sh ; nova hypervisor-list" |grep enabled|awk '{print $4}' )
Scott Baker431c1e42015-09-28 16:43:10 -070022I=0
23for 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
35EOF
36done