use of org.platformlayer.ops.instances.InstanceBuilder in project platformlayer by platformlayer.
the class TomcatServiceController method addChildren.
@Override
protected void addChildren() throws OpsException {
TomcatService model = OpsContext.get().getInstance(TomcatService.class);
InstanceBuilder instance = InstanceBuilder.build(model.dnsName, this, model.getTags());
instance.minimumMemoryMb = 2048;
addChild(instance);
instance.addChild(JavaVirtualMachine.buildJava6());
instance.addChild(PackageDependency.build("libtcnative-1"));
instance.addChild(PackageDependency.build("tomcat6"));
// tomcat6-admin contains the 'manager' app for remote deploys
instance.addChild(PackageDependency.build("tomcat6-admin"));
instance.addChild(TomcatUsers.build());
instance.addChild(TomcatServerBootstrap.build());
instance.addChild(MetricsInstance.class);
instance.addChild(ManagedService.build("tomcat6"));
}
use of org.platformlayer.ops.instances.InstanceBuilder in project platformlayer by platformlayer.
the class ImageStoreController method addChildrenGlance.
protected void addChildrenGlance(ImageStore model) throws OpsException {
InstanceBuilder instance = InstanceBuilder.build(model.dnsName, this, model.getTags());
addChild(instance);
// We’ll stick with glance using SQLite (for now)
instance.addChild(PackageDependency.build("glance"));
instance.addChild(ManagedService.build("glance"));
instance.addChild(MetricsInstance.class);
}
use of org.platformlayer.ops.instances.InstanceBuilder in project platformlayer by platformlayer.
the class GitServerController method addChildren.
@Override
protected void addChildren() throws OpsException {
GitService model = OpsContext.get().getInstance(GitService.class);
InstanceBuilder vm = InstanceBuilder.build(model.dnsName, this, model.getTags());
addChild(vm);
vm.addChild(PackageDependency.build("apache2"));
// Provides /usr/lib/git-core/git-http-backend
vm.addChild(PackageDependency.build("git"));
vm.addChild(ManagedDirectory.build(new File("/var/git"), "0755"));
vm.addChild(ApacheModule.build("authnz_ldap"));
vm.addChild(ApacheModule.build("ldap"));
File apache2ConfDir = new File("/etc/apache2");
vm.addChild(TemplatedFile.build(this, new File(apache2ConfDir, "conf.d/git")));
vm.addChild(ManagedService.build("apache2"));
vm.addChild(MetricsInstance.class);
{
PublicEndpoint endpoint = injected(PublicEndpoint.class);
// endpoint.network = null;
endpoint.publicPort = PORT;
endpoint.backendPort = PORT;
endpoint.dnsName = model.dnsName;
endpoint.tagItem = model.getKey();
endpoint.parentItem = model.getKey();
vm.addChild(endpoint);
}
}
use of org.platformlayer.ops.instances.InstanceBuilder in project platformlayer by platformlayer.
the class GerritServiceController method addChildren.
@Override
protected void addChildren() throws OpsException {
// GerritInstanceModel template = injected(GerritInstanceModel.class);
// GerritService model = template.getModel();
String dnsName = model.dnsName;
List<Integer> ports = getPorts();
InstanceBuilder vm;
{
vm = InstanceBuilder.build(dnsName, this, model.getTags());
vm.publicPorts.addAll(ports);
vm.hostPolicy.configureCluster(template.getPlacementKey());
// TODO: This needs to be configurable (?)
vm.minimumMemoryMb = 2048;
addChild(vm);
}
{
GerritInstall install = vm.addChild(GerritInstall.class);
}
// Bootstrap depends on configuration file
vm.addChild(ManagedDirectory.build(template.getDataDir(), "700").setOwner(template.getUser()).setGroup(template.getGroup()));
vm.addChild(ManagedDirectory.build(new File(template.getDataDir(), "etc"), "700").setOwner(template.getUser()).setGroup(template.getGroup()));
vm.addChild(GerritConfigurationFile.class);
vm.addChild(GerritBootstrap.class);
vm.addChild(GerritInstance.class);
for (int port : ports) {
PublicEndpoint endpoint = injected(PublicEndpoint.class);
// endpoint.network = null;
endpoint.publicPort = port;
endpoint.backendPort = port;
endpoint.dnsName = dnsName;
endpoint.tagItem = model.getKey();
endpoint.parentItem = model.getKey();
vm.addChild(endpoint);
}
vm.addChild(MetricsInstance.class);
}
use of org.platformlayer.ops.instances.InstanceBuilder in project platformlayer by platformlayer.
the class SystemAuthServiceController method addChildren.
@Override
protected void addChildren() throws OpsException {
// int port = PORT;
// String dnsName = model.dnsName;
InstanceBuilder vm;
{
vm = InstanceBuilder.build(model.dnsName, this, model.getTags());
// vm.publicPorts.add(port);
vm.hostPolicy.configureCluster(template.getPlacementKey());
// TODO: This needs to be configurable (?)
vm.minimumMemoryMb = 2048;
addChild(vm);
}
{
SystemAuthInstall install = vm.addChild(SystemAuthInstall.class);
}
{
SystemAuthInstance service = vm.addChild(SystemAuthInstance.class);
}
{
PublicEndpoint endpoint = vm.addChild(PublicEndpoint.class);
// endpoint.network = null;
endpoint.publicPort = BACKEND_PORT;
endpoint.backendPort = BACKEND_PORT;
// endpoint.dnsName = dnsName;
endpoint.tagItem = model.getKey();
endpoint.parentItem = model.getKey();
endpoint.transport = Transport.Ipv6;
}
loadBalancing.addHttpSite(this, model, model.dnsName, template.getSslKeyPath(), SslMode.Tunnel);
}
Aggregations