Commit 58fcb121 authored by Łukasz Nowak's avatar Łukasz Nowak

Generate tidstorage entry.

parent 98eefa9a
...@@ -71,8 +71,8 @@ class Recipe(GenericSlapRecipe): ...@@ -71,8 +71,8 @@ class Recipe(GenericSlapRecipe):
a(' storage-name=%(storage-name)s zodb-path=%(zodb-path)s' % {'zodb-path': zodb_path, 'storage-name': zeo_slave['storage-name']}) a(' storage-name=%(storage-name)s zodb-path=%(zodb-path)s' % {'zodb-path': zodb_path, 'storage-name': zeo_slave['storage-name']})
known_tid_storage_identifier_dict[ known_tid_storage_identifier_dict[
"((('%(ip)s', %(port)s),), '%(storage_name)s')" % dict( "((('%(ip)s', %(port)s),), '%(storage_name)s')" % dict(
ip='${zeo-instance-%(zeo-id)s:ip}', ip='${zeo-instance-%s:ip}' % zeo_id,
port='${zeo-instance-%(zeo-id)s:port}', port='${zeo-instance-%s:port}' % zeo_id,
storage_name=zeo_slave['storage-name'])] = (zodb_path, '${directory:zodb-backup}/%s/' % zeo_slave['storage-name'], zeo_slave['serialize-path'] % {'site-id': site_id}) storage_name=zeo_slave['storage-name'])] = (zodb_path, '${directory:zodb-backup}/%s/' % zeo_slave['storage-name'], zeo_slave['serialize-path'] % {'site-id': site_id})
current_zeo_port += 1 current_zeo_port += 1
output += snippet_zeo % dict( output += snippet_zeo % dict(
...@@ -145,7 +145,11 @@ class Recipe(GenericSlapRecipe): ...@@ -145,7 +145,11 @@ class Recipe(GenericSlapRecipe):
output += '\n'.join(publish_url_list) output += '\n'.join(publish_url_list)
part_list.append('publish-apache-backend-list') part_list.append('publish-apache-backend-list')
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]),
known_tid_storage_identifier_dict=known_tid_storage_identifier_dict,
site_id=site_id,
haproxy_section="haproxy-%s" % backend_name,
)
output = prepend + output output = prepend + output
with open(self.options['output'], 'w') as f: with open(self.options['output'], 'w') as f:
f.write(output) f.write(output)
......
...@@ -16,12 +16,26 @@ parts = ...@@ -16,12 +16,26 @@ parts =
cron cron
cron-entry-logrotate cron-entry-logrotate
certificate-authority certificate-authority
tidstorage
%(part_list)s %(part_list)s
eggs-directory = ${buildout:eggs-directory} eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory} develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true offline = true
[tidstorage]
recipe = slapos.cookbook:tidstorage
known-tid-storage-identifier-dict = %(known_tid_storage_identifier_dict)s
site-id = %(site_id)s
base_url = 'http://$${%(haproxy_section)s:ip}:$${%(haproxy_section)s:port}/$${:site-id}/serialize'
configuration-path = $${rootdirectory:etc}/tidstorage.py
ip = $${slap-network-information:local-ipv4}
port = 6001
timestamp-file-path = $${directory:tidstorage}/repozo_tidstorage_timestamp.log
logfile-name = $${basedirectory:log}/tidstorage.log
pidfile-name = $${basedirectory:run}/tidstorage.pid
status-file = $${directory:tidstorage}/tidstorage.tid
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
cron-entries = $${rootdirectory:etc}/cron.d/ cron-entries = $${rootdirectory:etc}/cron.d/
...@@ -113,6 +127,7 @@ backup = $${rootdirectory:srv}/backup/ ...@@ -113,6 +127,7 @@ backup = $${rootdirectory:srv}/backup/
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
tidstorage = $${rootdirectory:srv}/tidstorage/
zodb = $${rootdirectory:srv}/zodb/ zodb = $${rootdirectory:srv}/zodb/
zodb-backup = $${basedirectory:backup}/zodb zodb-backup = $${basedirectory:backup}/zodb
instance = $${rootdirectory:srv}/erp5shared/ instance = $${rootdirectory:srv}/erp5shared/
......
...@@ -88,7 +88,7 @@ mode = 0644 ...@@ -88,7 +88,7 @@ mode = 0644
[template-snippet-master] [template-snippet-master]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/snippet-master.cfg url = ${:_profile_base_location_}/snippet-master.cfg
md5sum = 4061555651d15cd050f4e00736877a33 md5sum = d510b8ebbb3325ed7a6a9b6005f78e37
output = ${buildout:directory}/template-snippet-master.cfg output = ${buildout:directory}/template-snippet-master.cfg
mode = 0644 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