Commit 8804f532 authored by Łukasz Nowak's avatar Łukasz Nowak

Make zope development default (WIP)

It will request all required services. json is in parameter dict.

More: software.cfg does not have to specify a lot of parts, as main template
is driving the choice process.
parent 4a8671fb
......@@ -25,7 +25,7 @@
#
##############################################################################
from slapos.recipe.librecipe import GenericBaseRecipe
import json
import pkg_resources
class Recipe(GenericBaseRecipe):
......@@ -36,7 +36,8 @@ class Recipe(GenericBaseRecipe):
backend = self.options['backend']
key = self.options['key-file']
certificate = self.options['cert-file']
access_control_string = self.options['access-control-string']
access_control_string = json.loads(self.options['json'])[
'access-control-string']
apache_conf = dict()
apache_conf['pid_file'] = self.options['pid-file']
apache_conf['lock_file'] = self.options['lock-file']
......
#############################
#
# Request erp5 development environnment
#
#############################
[buildout]
extends = ${template-zope:output}
parts =
request-mariadb
request-cloudooo
request-memcached
request-kumofs
request-tidstorage
basedirectory
certificate-authority
publish-apache-zope-backend-connection-string
zope-instance
apache-zope-backend-instance
ca-apache-zope-backend
logrotate
logrotate-entry-zope
cron
cron-entry-logrotate
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[request-common]
recipe = slapos.cookbook:request
software-url = $${slap-connection:software-release-url}
sla = computer_guid
sla-computer_guid = $${slap-connection:computer-id}
return = url
server-url = $${slap-connection:server-url}
key-file = $${slap-connection:key-file}
cert-file = $${slap-connection:cert-file}
computer-id = $${slap-connection:computer-id}
partition-id = $${slap-connection:partition-id}
[request-mariadb]
<=request-common
name = MariaDB DataBase
software-type = mariadb
[request-cloudooo]
<=request-common
name = Cloudooo
software-type = cloudooo
[request-memcached]
<=request-common
name = Memcached
software-type = memcached
[request-kumofs]
<=request-common
name = KumoFS
software-type = kumofs
[request-tidstorage]
<=request-common
name = TidStorage
return = url-login
config = json mysql-url memcached-url cloudooo-url kumofs-url
config-json = $${slap-parameter:json}
config-mysql-url = $${request-mariadb:connection-url}
config-memcached-url = $${request-memcached:connection-url}
config-cloudooo-url = $${request-cloudooo:connection-url}
config-kumofs-url = $${request-kumofs:connection-url}
software-type = tidstorage
# rest of parts are candidates for some generic stuff
[basedirectory]
recipe = slapos.cookbook:mkdirectory
services = $${rootdirectory:etc}/run/
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/
......@@ -10,8 +10,6 @@ parts =
cron
cron-entry-logrotate
gzip-binary = ${gzip:location}/bin/gzip
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
......@@ -30,7 +28,7 @@ wrapper = $${rootdirectory:bin}/apache
key-file = $${directory:apache-conf}/apache.key
cert-file = $${directory:apache-conf}/apache.crt
configuration-file = $${directory:apache-conf}/apache.conf
access-control-string = $${slap-parameter:access-control-string}
json = $${slap-parameter:json}
pid-file = $${basedirectory:run}/apache.pid
lock-file = $${basedirectory:run}/apache.lock
error-log = $${basedirectory:log}/apache-error.log
......@@ -85,7 +83,7 @@ runzope-binary = ${buildout:bin-directory}/runzope
recipe = slapos.cookbook:logrotate
# Binaries
logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
gzip-binary = $${buildout:gzip-binary}
gzip-binary = ${gzip:location}/bin/gzip
gunzip-binary = ${gzip:location}/bin/gunzip
# Directories
wrapper = $${rootdirectory:bin}/logrotate
......
......@@ -22,6 +22,7 @@ snippet-backend = ${template-snippet-backend:output}
[switch-softwaretype]
recipe = slapos.cookbook:softwaretype
default = ${template-erp5-development:output}
production = ${template-erp5-production:output}
kumofs = ${template-kumofs:output}
memcached = ${template-memcached:output}
......@@ -38,4 +39,3 @@ server-url = $${slap_connection:server_url}
software-release-url = $${slap_connection:software_release_url}
key-file = $${slap_connection:key_file}
cert-file = $${slap_connection:cert_file}
......@@ -7,11 +7,6 @@ versions = versions
parts +=
# Create instance template
template-memcached
template-kumofs
template-cloudooo
template-zope
template-mariadb
template
validator
......@@ -30,7 +25,7 @@ mode = 0644
[template-zope]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-zope.cfg
md5sum = 090a7923d7d7e1d05f41679bab8042e9
md5sum = 9cbd477e7f4fa12a43de6d109b477969
output = ${buildout:directory}/template-zope.cfg
mode = 0644
......@@ -51,7 +46,7 @@ mode = 0644
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
md5sum = 3292c82fd665264a9710a9cc8e260d64
md5sum = 5a8d8751d715eee6f98102328948f44b
output = ${buildout:directory}/template.cfg
mode = 0644
......@@ -62,6 +57,13 @@ md5sum = 9a1462f3e34b99f384ae47b48a3a733c
output = ${buildout:directory}/template-memcached.cfg
mode = 0644
[template-erp5-development]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-erp5-development.cfg
md5sum = fbbc3d6283164c3500c620dd56ab7bab
output = ${buildout:directory}/template-erp5-development.cfg
mode = 0644
[template-erp5-production]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-erp5-production.cfg
......
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