Commit 259d3f9d authored by Spiros Koulouzis's avatar Spiros Koulouzis

added playbook

parent dc226d13
...@@ -71,6 +71,25 @@ node_types: ...@@ -71,6 +71,25 @@ node_types:
description: Kubernetes orchestrator description: Kubernetes orchestrator
interfaces: interfaces:
Standard: Standard:
configure: https://raw.githubusercontent.com/skoulouzis/k8s_cluster_setup/master/install_k8s.yml?token=ACJ3NYOHQHDUUVYRDUHOZZS6DSMQ2
description: Standard lifecycle create operation.
configure:
description: Standard lifecycle configure operation.
start:
description: Standard lifecycle start operation.
stop:
description: Standard lifecycle stop operation.
delete:
description: Standard lifecycle delete operation.
create: interfaces/playbooks/kubernetes_install.yaml create: interfaces/playbooks/kubernetes_install.yaml
#tosca.nodes.ARTICONF.Orchestrator.Swarm: #tosca.nodes.ARTICONF.Orchestrator.Swarm:
......
- hosts: all
become: yes
tasks:
- name: Update and upgrade apt packages
become: true
apt:
upgrade: yes
update_cache: yes
- name: Install aptitude using apt
apt: name=aptitude state=latest update_cache=yes force_apt_get=yes
- name: Install required of packages
apt:
name: "{{ packages }}"
update_cache: yes
vars:
packages:
- ca-certificates
- apt-transport-https
- curl
- gnupg2
- software-properties-common
- python3-pip
- name: Add Docker GPG apt Key
apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
state: present
- name: Add Docker Repository
apt_repository:
repo: deb https://download.docker.com/linux/ubuntu bionic stable
state: present
- name: Update apt and install docker-ce
apt: update_cache=yes name=docker-ce state=latest
- name: Update and upgrade apt packages
become: true
apt:
upgrade: yes
update_cache: yes
- name: Add the Kubernetes signing key
apt_key:
url: https://packages.cloud.google.com/apt/doc/apt-key.gpg
state: present
- name: Add Docker Repository
apt_repository:
repo: deb http://apt.kubernetes.io/ kubernetes-xenial main
state: present
- name: Update apt and install docker-ce
apt: update_cache=yes name=kubeadm state=latest
...@@ -4,14 +4,11 @@ import java.util.Objects; ...@@ -4,14 +4,11 @@ import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.validation.Valid; import javax.validation.Valid;
import javax.validation.constraints.*;
/** /**
* CloudsStormSubTopology * CloudsStormSubTopology
......
...@@ -11,6 +11,10 @@ import org.springframework.web.bind.annotation.PathVariable; ...@@ -11,6 +11,10 @@ import org.springframework.web.bind.annotation.PathVariable;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.logging.Level;
import nl.uva.sne.drip.service.DRIPService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-10-10T17:15:46.465Z") @javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-10-10T17:15:46.465Z")
...@@ -23,6 +27,12 @@ public class DeployerApiController implements DeployerApi { ...@@ -23,6 +27,12 @@ public class DeployerApiController implements DeployerApi {
private final HttpServletRequest request; private final HttpServletRequest request;
@Value("${message.broker.queue.deployer}")
private String queueName;
@Autowired
private DRIPService dripService;
@org.springframework.beans.factory.annotation.Autowired @org.springframework.beans.factory.annotation.Autowired
public DeployerApiController(ObjectMapper objectMapper, HttpServletRequest request) { public DeployerApiController(ObjectMapper objectMapper, HttpServletRequest request) {
this.objectMapper = objectMapper; this.objectMapper = objectMapper;
...@@ -33,12 +43,11 @@ public class DeployerApiController implements DeployerApi { ...@@ -33,12 +43,11 @@ public class DeployerApiController implements DeployerApi {
public ResponseEntity<String> deployProvisionToscaTemplateByID(@ApiParam(value = "ID of topolog template to deploy", required = true) @PathVariable("id") String id) { public ResponseEntity<String> deployProvisionToscaTemplateByID(@ApiParam(value = "ID of topolog template to deploy", required = true) @PathVariable("id") String id) {
String accept = request.getHeader("Accept"); String accept = request.getHeader("Accept");
if (accept != null && accept.contains("")) { if (accept != null && accept.contains("")) {
try {
return new ResponseEntity<>(objectMapper.readValue("", String.class), HttpStatus.NOT_IMPLEMENTED); dripService.setRequestQeueName(queueName);
} catch (IOException e) { String planedYemplateId = dripService.deploy(id);
log.error("Couldn't serialize response for content type ", e); return new ResponseEntity<>(planedYemplateId, HttpStatus.OK);
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
}
} }
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
} }
......
...@@ -157,4 +157,8 @@ public class DRIPService { ...@@ -157,4 +157,8 @@ public class DRIPService {
} }
} }
public String deploy(String id) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment