Commit 86fbfaad authored by Romain Courteaud's avatar Romain Courteaud

Publish connection twice.

First section publish the backup url.
Second section publish the frontend url if available.
parent 6be9754a
......@@ -5,12 +5,12 @@
#############################
[buildout]
parts =
request-slave-frontend
certificate-authority
publish-kvm-backend-connection-information
publish-kvm-frontend-connection-information
kvm-promise
novnc-promise
frontend-promise
publish-kvm-connection-information
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
......@@ -128,27 +128,17 @@ config-host = $${novnc-instance:ip}
config-port = $${novnc-instance:port}
return = url resource port domainname
# Will generate, if existing, URL to reach KVM using frontend
[get-slave-connection-url]
recipe = slapos.cookbook:generate_output_if_input_not_null
input-list =
frontend-url request-slave-frontend:connection-url
frontend-port request-slave-frontend:connection-port
frontend-resource request-slave-frontend:connection-resource
frontend-domainname request-slave-frontend:connection-domainname
template = %(frontend-url)s/vnc_auto.html?host=%(frontend-domainname)s&port=%(frontend-port)s&encrypt=1&path=%(frontend-resource)s
# This is default output, if slave is not ready yet
output = Not ready yet. Please use backend URL if possible or wait a few minutes.
[publish-kvm-backend-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
password = $${kvm-instance:passwd}
[publish-kvm-frontend-connection-information]
<= publish-kvm-backend-connection-information
url = $${request-slave-frontend:connection-url}/vnc_auto.html?host=$${request-slave-frontend:connection-domainname}&port=$${request-slave-frontend:connection-port}&encrypt=1&path=$${request-slave-frontend:connection-resource}
[frontend-promise]
recipe = slapos.cookbook:check_url_available
path = $${basedirectory:promises}/frontend_promise
url = $${get-slave-connection-url:output}
url = $${publish-kvm-frontend-connection-information:url}
dash_path = ${dash:location}/bin/dash
[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
url = $${get-slave-connection-url:output}
password = $${kvm-instance:passwd}
......@@ -132,7 +132,7 @@ command =
[template-kvm]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-kvm.cfg
md5sum = 8d67a6cabe4fbce2bd44aa006a0d0cf8
md5sum = 0cd59f4911521977026b63b8af23aaba
output = ${buildout:directory}/template-kvm.cfg
mode = 0644
......
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