<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>You can use ResourceGroups. Here is a snippet from a resource
file I have created:</p>
<p> my_server_instance:<br>
type: OS::Nova::Server<br>
properties:<br>
image: { get_param: image }<br>
flavor: { get_param: flavor }<br>
# key_name: { get_param: key }<br>
availability_zone: { get_param: [avl_zones, get_param: index
]}<br>
networks:<br>
- port: { get_resource: myport}<br>
<br>
</p>
<p>and the 'deployment' file from where I instantiate the resource
(not complete, removed stuff for simplicity). Note usage of index,
lets you address individual servers.<br>
</p>
<p> my_cluster:<br>
type: OS::Heat::ResourceGroup<br>
properties:<br>
count: { get_param: my_cluster_size }<br>
resource_def:<br>
type: myresource<br>
properties:<br>
image: "someimage"<br>
index: "%index%"<br>
</p>
<p>(Assumed that there is a registry as below:</p>
<p>resource_registry:<br>
myresource: myresourcefile.yaml<br>
<br>
</p>
I know this is patchy, but I think provides all required clues.<br>
rk<br>
<br>
<div class="moz-cite-prefix">On 3/27/2018 9:01 AM, Sashan Govender
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAEJ4JGxdKFkJWh=NzgFyhgdf4y8b37uy5QrOxuMRs6r_jBrDBQ@mail.gmail.com">
<div dir="ltr">Hi
<div><br>
</div>
<div>I have a HOT file that has 4 Nova::Server resources. They
differences between them are minimal and, when I look at the
file, I see a lot of duplication. How can I reduce this. I've
tried fiddling with the 'repeat' intrinsic and
StructuredConfig but with no luck. I basically want to create
a loop like the following in the pseudo code:</div>
<div><br>
</div>
<div>list_of_servers = ["s1", "s2", "s3", "s4"]</div>
<div>for server_name in list_of_servers: </div>
<div> create_server(server_name)</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Mailing list: <a class="moz-txt-link-freetext" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a>
Post to : <a class="moz-txt-link-abbreviated" href="mailto:openstack@lists.openstack.org">openstack@lists.openstack.org</a>
Unsubscribe : <a class="moz-txt-link-freetext" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Rathnakumar Kayyar
LCN
<a class="moz-txt-link-freetext" href="http://www.lcnpl.com">http://www.lcnpl.com</a>
</pre>
<div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br />
<table style="border-top: 1px solid #D3D4DE;">
<tr>
<td style="width: 55px; padding-top: 13px;"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;" /></a></td>
<td style="width: 470px; padding-top: 12px; color: #41424e; font-size: 13px; font-family: Arial, Helvetica, sans-serif; line-height: 18px;">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient" target="_blank" style="color: #4453ea;">www.avast.com</a>
</td>
</tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></body>
</html>