Commit 702aa9be authored by Gabriel Monnerat's avatar Gabriel Monnerat

refactor code to create script to run varnish using slapos.recipe.librecipe.execute

parent 3614fd34
...@@ -282,20 +282,26 @@ class Recipe(BaseSlapRecipe): ...@@ -282,20 +282,26 @@ class Recipe(BaseSlapRecipe):
storage="file,%s/storage.bin,%s" % (directory, size)) storage="file,%s/storage.bin,%s" % (directory, size))
config_file = self.createConfigurationFile("%s.conf" % name, config_file = self.createConfigurationFile("%s.conf" % name,
self.substituteTemplate(self.getTemplateFilename('varnish.vcl.in'), self.substituteTemplate(self.getTemplateFilename('varnish.vcl.in'),
dict(backend_host=backend_host,backend_port=backend_port))) dict(backend_host=backend_host, backend_port=backend_port)))
varnish_config["configuration_file"] = config_file varnish_argument_list = [varnish_config['varnishd_binary'].strip(),
self.path_list.append(self.createRunningWrapper('varnishd', "-F", "-n", directory, "-P", varnish_config["pid"], "-f", config_file,
self.substituteTemplate(self.getTemplateFilename('varnishd.in'), "-a", varnish_config["port"], "-T", varnish_config["control_port"],
varnish_config))) "-s", varnish_config["storage"]]
wrapper = zc.buildout.easy_install.scripts([('varnishd',
'slapos.recipe.librecipe.execute', 'execute')], self.ws,
sys.executable, self.wrapper_directory, arguments=varnish_argument_list,
)[0]
self.path_list.append(wrapper)
return varnish_config return varnish_config
def installStunnel(self, service_dict, certificate, def installStunnel(self, service_dict, certificate,
key, ca_crl, ca_path): key, ca_crl, ca_path):
"""Installs stunnel """Installs stunnel
service_dict = service_dict =
{ name: (public_ip, private_ip, public_port, private_port),} { name: (public_ip, private_ip, public_port, private_port),}
""" """
template_filename = self.getTemplateFilename('stunnel.conf.in') template_filename = self.getTemplateFilename('stunnel.conf.in')
......
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