Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Georgios Dagkakis
slapos
Commits
87ce3a05
Commit
87ce3a05
authored
Mar 18, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM frontend : Send slave connection parameters to master
parent
e64ed370
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
7 deletions
+20
-7
slapos/recipe/generic_kvm_frontend/__init__.py
slapos/recipe/generic_kvm_frontend/__init__.py
+13
-3
software/kvm/instance-kvm.cfg
software/kvm/instance-kvm.cfg
+5
-2
software/kvm/software.cfg
software/kvm/software.cfg
+2
-2
No files found.
slapos/recipe/generic_kvm_frontend/__init__.py
View file @
87ce3a05
...
...
@@ -24,11 +24,11 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from
slapos.recipe.librecipe
import
GenericBaseRecipe
from
slapos.recipe.librecipe
import
GenericBaseRecipe
,
GenericSlapRecipe
import
json
import
zc.buildout
class
Recipe
(
Generic
Base
Recipe
):
class
Recipe
(
Generic
Slap
Recipe
):
"""
kvm frontend instance configuration.
"""
...
...
@@ -82,7 +82,7 @@ class Recipe(GenericBaseRecipe):
proxy_table_content
=
json
.
dumps
(
proxy_table
)
return
proxy_table_content
def
install
(
self
):
def
_
install
(
self
):
# Check for mandatory field
if
self
.
options
.
get
(
'domain'
,
None
)
is
None
:
raise
zc
.
buildout
.
UserError
(
'No domain name specified. Please define '
...
...
@@ -118,4 +118,14 @@ class Recipe(GenericBaseRecipe):
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'nodejs_run.in'
),
config
))
# Send connection parameters of slave instances
site_url
=
"https://%s:%s/"
%
(
self
.
options
[
'domain'
],
self
.
options
[
'port'
])
for
slave
in
rewrite_rule_list
:
self
.
setConnectionDict
(
dict
(
url
=
"%s%s"
%
(
site_url
,
slave
[
'resource'
]),
domainname
=
self
.
options
[
'domain'
],
port
=
self
.
options
[
'port'
],
resource
=
slave
[
'resource'
]),
slave
[
'reference'
])
return
[
map_file
,
conf_file
,
runner_path
]
software/kvm/instance-kvm.cfg
View file @
87ce3a05
...
...
@@ -124,10 +124,13 @@ partition-id = $${slap-connection:partition-id}
name = SlaveFrontend
software-type = frontend
slave = true
return = frontend_url
config = host port
config-host = $${novnc-instance:ip}
config-port = $${novnc-instance:port}
return = url
[publish-kvm-connection-information]
recipe = slapos.cookbook:publish
backend_url = https://[$${novnc-instance:ip}]:$${novnc-instance:port}/vnc_auto.html?host=[$${novnc-instance:ip}]&port=$${novnc-instance:port}&encrypt=1
frontend_url = $${request-slave-frontend:
frontend_
url}
frontend_url = $${request-slave-frontend:
connection-
url}
vnc_passwd = $${kvm-instance:passwd}
software/kvm/software.cfg
View file @
87ce3a05
...
...
@@ -169,7 +169,7 @@ command =
[template-kvm]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-kvm.cfg
md5sum =
ce62abe1edabc78a4baa574a39d7faa0
md5sum =
ef4b95334fd8b4608ec10595aba3df3d
output = ${buildout:directory}/template-kvm.cfg
mode = 0644
...
...
@@ -235,4 +235,4 @@ signature-certificate-list =
b6d3iIyN+wffxz/V9epbKIZVEGJd/6LrTdLiUfJPec7FaxVCWNyKBlCpINBM7cEV
Gn9t8mdVQflNqOlAMkOlUv1ZugCt9rXYQOV7rrEYJBWirn43BOMn9Flp2nibblby
If1a2ZoqHRxoNo2yTmm7TSYRORWVS+vvfjY=
-----END CERTIFICATE-----
\ No newline at end of file
-----END CERTIFICATE-----
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