Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
6172a79f
Commit
6172a79f
authored
Jan 28, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added create playbook
parent
a5471940
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
12 deletions
+23
-12
nodes.yaml
TOSCA/types/nodes.yaml
+1
-1
install_k8s.yml
ansible_playbooks/install_k8s.yml
+2
-2
drip-deployer.iml
deployer/.idea/drip-deployer.iml
+1
-1
misc.xml
deployer/.idea/misc.xml
+1
-1
ansible_service.py
deployer/service/ansible_service.py
+14
-2
ServiceTests.java
...r/src/test/java/nl/uva/sne/drip/service/ServiceTests.java
+2
-0
CloudStormService.java
...n/java/nl/uva/sne/drip/provisioner/CloudStormService.java
+2
-5
No files found.
TOSCA/types/nodes.yaml
View file @
6172a79f
...
...
@@ -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:
...
...
ansible_playbooks/install_k8s.yml
View file @
6172a79f
...
...
@@ -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:
...
...
deployer/.idea/drip-deployer.iml
View file @
6172a79f
...
...
@@ -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"
>
...
...
deployer/.idea/misc.xml
View file @
6172a79f
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
project-jdk-name=
"Python 3.8 (d
rip-d
eployer)"
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
deployer/service/ansible_service.py
View file @
6172a79f
...
...
@@ -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'
))
...
...
manager/src/test/java/nl/uva/sne/drip/service/ServiceTests.java
View file @
6172a79f
...
...
@@ -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
...
...
provisioner/src/main/java/nl/uva/sne/drip/provisioner/CloudStormService.java
View file @
6172a79f
...
...
@@ -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
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment