Commit 249e014b authored by Łukasz Nowak's avatar Łukasz Nowak

Start backend templating.

parent 558106ee
...@@ -101,12 +101,18 @@ class Recipe(GenericSlapRecipe): ...@@ -101,12 +101,18 @@ class Recipe(GenericSlapRecipe):
output += snippet_zope % dict(zope_thread_amount=1, zope_id=part_name, zope_port=current_zope_port, output += snippet_zope % dict(zope_thread_amount=1, zope_id=part_name, zope_port=current_zope_port,
**zope_dict) **zope_dict)
# handle backend key # handle backend key
snippet_backend = open(self.options['snippet-backend']).read()
for backend_type, backend_configuration in json_data['backend'].iteritems(): for backend_type, backend_configuration in json_data['backend'].iteritems():
for q in range(1, backend_configuration['zopecount'] + 1): for q in range(1, backend_configuration['zopecount'] + 1):
current_zope_port += 1 current_zope_port += 1
part_name = 'zope-%s-%s' % (backend_type, q) part_name = 'zope-%s-%s' % (backend_type, q)
part_list.append(part_name) part_list.append(part_name)
output += snippet_zope % dict(zope_thread_amount=backend_configuration['thread-amount'], zope_id=part_name, zope_port=current_zope_port, **zope_dict) output += snippet_zope % dict(zope_thread_amount=backend_configuration['thread-amount'], zope_id=part_name, zope_port=current_zope_port, **zope_dict)
# now generate backend access
part_list.append('apache-%(backend_name)s ca-apache-%(backend_name)s logrotate-entry-apache-%(backend_name)s haproxy-%(backend_name)s' % dict(backend_name=backend_type))
backend_dict = dict(
)
output += snippet_backend % backend_dict
prepend = open(self.options['snippet-master']).read() % dict( prepend = open(self.options['snippet-master']).read() % dict(
part_list=' \n'.join([' '+q for q in part_list])) part_list=' \n'.join([' '+q for q in part_list]))
output = prepend + output output = prepend + output
......
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