Commit 6172a79f authored by Spiros Koulouzis's avatar Spiros Koulouzis

added create playbook

parent a5471940
......@@ -77,7 +77,7 @@ node_types:
playbook: https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/ansible_playbooks/install_k8s.yml
create:
inputs:
playbook: https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/ansible_playbooks/install_k8s.yml
playbook: https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/ansible_playbooks/create_k8s.yml
#tosca.nodes.ARTICONF.Orchestrator.Swarm:
......
......@@ -2,8 +2,8 @@
become: yes
tasks:
- name: replace DNS
shell: sed -i "s/nameserver.*/nameserver 8.8.8.8/g" /etc/resolv.conf
#- name: replace DNS
#shell: sed -i "s/nameserver.*/nameserver 8.8.8.8/g" /etc/resolv.conf
#- name: replace DNS
#lineinfile:
......
......@@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Python 3.8 (deployer)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (drip-deployer)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (deployer)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
......@@ -66,7 +66,12 @@ def write_ansible_files(vms, interfaces, tmp_path):
image_url = interfaces['Kubernetes']['install']['inputs']['playbook']
r = requests.get(image_url)
with open(tmp_path + "/playbook.yml", 'wb') as f:
with open(tmp_path + "/install.yml", 'wb') as f:
f.write(r.content)
image_url = interfaces['Kubernetes']['create']['inputs']['playbook']
r = requests.get(image_url)
with open(tmp_path + "/create.yml", 'wb') as f:
f.write(r.content)
return tmp_path
......@@ -75,7 +80,14 @@ def run(interfaces, vms):
tmp_path = tempfile.mkdtemp()
write_ansible_files(vms, interfaces, tmp_path)
p = Popen(["ansible-playbook", "-i", tmp_path + "/k8s_hosts", tmp_path + "/playbook.yml"], stdin=PIPE, stdout=PIPE,
p = Popen(["ansible-playbook", "-i", tmp_path + "/k8s_hosts", tmp_path + "/install.yml"], stdin=PIPE, stdout=PIPE,
stderr=PIPE)
output, err = p.communicate()
print(output.decode('utf-8'))
print(err.decode('utf-8'))
rc = p.returncode
p = Popen(["ansible-playbook", "-i", tmp_path + "/k8s_hosts", tmp_path + "/create.yml"], stdin=PIPE, stdout=PIPE,
stderr=PIPE)
output, err = p.communicate()
print(output.decode('utf-8'))
......
......@@ -238,6 +238,7 @@ public class ServiceTests {
/**
* Test of getAllIds method, of class ToscaTemplateService.
*
* @throws java.lang.Exception
*/
@Test
......@@ -322,6 +323,7 @@ public class ServiceTests {
/**
* Test of deleteByID method, of class CredentialService.
*
* @throws com.fasterxml.jackson.core.JsonProcessingException
*/
@Test
......
......@@ -25,11 +25,8 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Properties;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import nl.uva.sne.drip.commons.utils.Converter;
import nl.uva.sne.drip.commons.utils.ToscaHelper;
import nl.uva.sne.drip.model.cloud.storm.CloudsStormVM;
......@@ -296,8 +293,8 @@ class CloudStormService {
private ToscaTemplate runCloudStorm(String tempInputDirPath) throws IOException, ApiException {
String[] args = new String[]{"run", tempInputDirPath};
// standalone.MainAsTool.main(args);
tempInputDirPath = "/tmp/Input-26386504078656";
standalone.MainAsTool.main(args);
// tempInputDirPath = "/tmp/Input-26386504078656";
CloudsStormTopTopology _top = objectMapper.readValue(new File(tempInputDirPath + TOPOLOGY_RELATIVE_PATH
+ TOP_TOPOLOGY_FILE_NAME),
......
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