<div dir="ltr">Awesome, thanks! </div><br><div class="gmail_quote"><div dir="ltr">On Tue, Mar 27, 2018 at 4:22 PM Rathnakumar Kayyar <<a href="mailto:rkayyar@lcnpl.com">rkayyar@lcnpl.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div 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</div><div text="#000000" bgcolor="#FFFFFF"><br>
<br>
<div class="m_-253925584345964665moz-cite-prefix">On 3/27/2018 9:01 AM, Sashan Govender
wrote:<br>
</div>
</div><div text="#000000" bgcolor="#FFFFFF"><blockquote type="cite">
<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="m_-253925584345964665mimeAttachmentHeader"></fieldset>
<br>
</blockquote></div><div text="#000000" bgcolor="#FFFFFF"><blockquote type="cite"><pre>_______________________________________________
Mailing list: <a class="m_-253925584345964665moz-txt-link-freetext" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a>
Post to : <a class="m_-253925584345964665moz-txt-link-abbreviated" href="mailto:openstack@lists.openstack.org" target="_blank">openstack@lists.openstack.org</a>
Unsubscribe : <a class="m_-253925584345964665moz-txt-link-freetext" href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack</a>
</pre>
</blockquote></div><div text="#000000" bgcolor="#FFFFFF">
<br>
<pre class="m_-253925584345964665moz-signature" cols="72">--
Rathnakumar Kayyar
LCN
<a class="m_-253925584345964665moz-txt-link-freetext" href="http://www.lcnpl.com" target="_blank">http://www.lcnpl.com</a>
</pre>
<div id="m_-253925584345964665DAB4FAD8-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" style="color:#4453ea" target="_blank">www.avast.com</a>
</td>
</tr>
</table><a href="#m_-253925584345964665_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"> </a></div></div></blockquote></div>