Search in sources :

Example 16 with InstanceBuilder

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"));
}
Also used : TomcatService(org.platformlayer.service.tomcat.model.TomcatService) InstanceBuilder(org.platformlayer.ops.instances.InstanceBuilder)

Example 17 with InstanceBuilder

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);
}
Also used : InstanceBuilder(org.platformlayer.ops.instances.InstanceBuilder)

Example 18 with InstanceBuilder

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);
    }
}
Also used : GitService(org.platformlayer.service.git.model.GitService) PublicEndpoint(org.platformlayer.ops.networks.PublicEndpoint) TemplatedFile(org.platformlayer.ops.filesystem.TemplatedFile) File(java.io.File) InstanceBuilder(org.platformlayer.ops.instances.InstanceBuilder)

Example 19 with InstanceBuilder

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);
}
Also used : PublicEndpoint(org.platformlayer.ops.networks.PublicEndpoint) File(java.io.File) PublicEndpoint(org.platformlayer.ops.networks.PublicEndpoint) InstanceBuilder(org.platformlayer.ops.instances.InstanceBuilder)

Example 20 with InstanceBuilder

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);
}
Also used : PublicEndpoint(org.platformlayer.ops.networks.PublicEndpoint) InstanceBuilder(org.platformlayer.ops.instances.InstanceBuilder)

Aggregations

InstanceBuilder (org.platformlayer.ops.instances.InstanceBuilder)26 PublicEndpoint (org.platformlayer.ops.networks.PublicEndpoint)19 File (java.io.File)9 TemplatedFile (org.platformlayer.ops.filesystem.TemplatedFile)4 SimpleFile (org.platformlayer.ops.filesystem.SimpleFile)3 PlatformLayerKey (org.platformlayer.core.model.PlatformLayerKey)2 NetworkPoint (org.platformlayer.ops.networks.NetworkPoint)2 PackageDependency (org.platformlayer.ops.packages.PackageDependency)2 NginxService (org.openstack.service.nginx.model.NginxService)1 ManagedItemId (org.platformlayer.ids.ManagedItemId)1 OperatingSystemRecipe (org.platformlayer.images.model.OperatingSystemRecipe)1 Repository (org.platformlayer.images.model.Repository)1 RepositoryKey (org.platformlayer.images.model.RepositoryKey)1 OpsException (org.platformlayer.ops.OpsException)1 BackupDirectory (org.platformlayer.ops.backups.BackupDirectory)1 RecipeOperatingSystem (org.platformlayer.ops.packages.RecipeOperatingSystem)1 PosixGroup (org.platformlayer.ops.users.PosixGroup)1 PosixUser (org.platformlayer.ops.users.PosixUser)1 IpsecForPort (org.platformlayer.ops.vpn.IpsecForPort)1 IpsecPresharedKey (org.platformlayer.ops.vpn.IpsecPresharedKey)1