ctubbsii commented on a change in pull request #274: Updates to enable launch
of EC2 instances via user-defined templates
URL: https://github.com/apache/fluo-muchos/pull/274#discussion_r317797177
##########
File path: lib/muchos/ec2.py
##########
@@ -227,3 +238,21 @@ def terminate(self):
print("Removed hosts file at ", self.config.hosts_path)
else:
print("Aborted termination")
+
+
+class Ec2ClusterTemplate(Ec2Cluster):
+
+ def __init__(self, config):
+ Ec2Cluster.__init__(self, config)
+
+ def launch(self):
+ print("Using cluster template '{0}' to launch
nodes".format(self.config.cluster_template_d['id']))
+ super().launch()
+
+ def init_request(self, hostname, services, sg_id):
+ # the first service in the list denotes the node's target template
+ print("Template '{0}' selected for {1}".format(services[0], hostname))
+ # interpolate any values from the ec2 config section and create request
+ ec2_d = dict(self.config.items('ec2'))
+ ec2_d['security_group_id'] = sg_id
Review comment:
If the security group is specified in the template explicitly, muchos will
still create a new security group and delete it on termination... even though
the template never used it. This probably doesn't matter.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services