Commit bf3ace62 authored by Alain Takoudjou's avatar Alain Takoudjou

Add redis-server component, software and recipe

parent 5ed5b0c0
[buildout]
parts =
redis
[redis]
recipe = hexagonit.recipe.cmmi
url = https://github.com/teh/redis/archive/unstable.tar.gz
md5sum = b056f48c301004c80c23579ab337494a
configure-command = true
prefix =
make-options =
PREFIX=${buildout:parts-directory}/${:_buildout_section_name_}
V=1
make-targets =
install
test
......@@ -121,6 +121,7 @@ setup(name=name,
'publishurl = slapos.recipe.publishurl:Recipe',
'pwgen = slapos.recipe.pwgen:Recipe',
'pwgen.stable = slapos.recipe.pwgen:StablePasswordGeneratorRecipe',
'redis.server = slapos.recipe.redis:Recipe',
'requestoptional = slapos.recipe.request:RequestOptional',
'request = slapos.recipe.request:Recipe',
'seleniumrunner = slapos.recipe.seleniumrunner:Recipe',
......
##############################################################################
#
# Copyright (c) 2010 Vifib SARL and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import os
from slapos.recipe.librecipe import GenericBaseRecipe
class Recipe(GenericBaseRecipe):
def install(self):
path_list = []
if not self.optionIsTrue('use_passwd', False):
master_passwd = "# masterauth <master-password>"
else:
master_passwd = "masterauth %s" % self.options['passwd']
config_file = self.options['config_file'].strip()
configuration = dict(pid_file=self.options['pid_file'],
port=self.options['port'],
ipv6=self.options['ipv6'],
server_dir=self.options['server_dir'],
log_file=self.options['log_file'],
master_passwd=master_passwd
)
config = self.createFile(config_file,
self.substituteTemplate(self.getTemplateFilename('redis.conf.in'),
configuration))
path_list.append(config)
redis = self.createPythonScript(
self.options['wrapper'],
'slapos.recipe.librecipe.execute.execute',
[self.options['server_bin'], config_file]
)
path_list.append(redis)
return path_list
This diff is collapsed.
[buildout]
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
parts =
publish-connection-informations
redis
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/
srv = $${buildout:directory}/srv/
var = $${buildout:directory}/var/
bin = $${buildout:directory}/bin/
[basedirectory]
recipe = slapos.cookbook:mkdirectory
services = $${rootdirectory:etc}/run/
run = $${rootdirectory:var}/run/
log = $${rootdirectory:var}/log/
[master-passwd]
recipe = slapos.cookbook:generate.password
storage-path = $${rootdirectory:etc}/.passwd
bytes = 4
[redis]
recipe = slapos.cookbook:redis.server
server_bin = ${redis:location}/bin/redis-server
ipv6 = $${slap-network-information:global-ipv6}
port = 6379
use_passwd = $${slap-parameter:use_passwd}
pid_file = $${basedirectory:run}/redis.pid
server_dir = $${rootdirectory:srv}
passwd = $${master-passwd:passwd}
config_file = $${rootdirectory:etc}/redis.conf
log_file = $${basedirectory:log}/redis.log
wrapper = $${basedirectory:services}/redis_server
# Send informations to SlapOS Master
[publish-connection-informations]
recipe = slapos.cookbook:publish
server_url = $${redis:ipv6}
port = $${redis:port}
passwd = $${redis:passwd}
use_master_password = $${redis:use_passwd}
[slap-parameter]
use_passwd = false
\ No newline at end of file
[buildout]
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
parts =
switch-softwaretype
[switch-softwaretype]
recipe = slapos.cookbook:softwaretype
default = ${template-redis:output}
\ No newline at end of file
[buildout]
parts =
slapos-cookbook
redis
template
template-redis
extends =
../../component/redis/buildout.cfg
../../stack/slapos.cfg
[template]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg
output = ${buildout:directory}/template.cfg
mode = 0644
md5sum = 5d2008c96a569c3ce498ddc0933afea3
[template-redis]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-redis.cfg
output = ${buildout:directory}/template-redis.cfg
mode = 0644
md5sum = cadef83b41f95d28ffdfca8801cdc28d
\ No newline at end of file
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