Commit 224c7d98 authored by Marco Mariani's avatar Marco Mariani

add option to enable/disable bully

parent 44a20bdf
...@@ -37,7 +37,7 @@ class Recipe(GenericSlapRecipe): ...@@ -37,7 +37,7 @@ class Recipe(GenericSlapRecipe):
def _install(self): def _install(self):
path_list = [] path_list = []
confpath = os.path.join(self.options['script'], 'bully.conf') confpath = os.path.join(self.options['etc'], 'bully.conf')
ip_list = self.parameter_dict['ip-list'] ip_list = self.parameter_dict['ip-list']
print 'Creating bully configuration with ips : %s\n' % ip_list print 'Creating bully configuration with ips : %s\n' % ip_list
...@@ -54,9 +54,13 @@ class Recipe(GenericSlapRecipe): ...@@ -54,9 +54,13 @@ class Recipe(GenericSlapRecipe):
slap_connection = self.buildout['slap-connection'] slap_connection = self.buildout['slap-connection']
# XXX use the bin directory, do not run automatically yet if self.optionIsTrue('enable-bully-service', default=False):
wrapper_dir = self.options['services']
else:
wrapper_dir = self.options['bin']
wrapper = self.createPythonScript( wrapper = self.createPythonScript(
name=os.path.join(self.options['bin'], self.parameter_dict['wrapper']), name=os.path.join(wrapper_dir, self.parameter_dict['wrapper']),
absolute_function='slapos.recipe.addresiliency.bully.run', absolute_function='slapos.recipe.addresiliency.bully.run',
arguments={ arguments={
'confpath': confpath, 'confpath': confpath,
......
...@@ -22,7 +22,7 @@ parts = ...@@ -22,7 +22,7 @@ parts =
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/pbsready.cfg.in url = ${:_profile_base_location_}/pbsready.cfg.in
output = ${buildout:directory}/pbsready.cfg output = ${buildout:directory}/pbsready.cfg
md5sum = 0e6a383849840419ce767325f5a368a4 md5sum = b6102416d000cae81dd2b06268946ea9
mode = 0644 mode = 0644
[pbsready-import] [pbsready-import]
......
...@@ -24,7 +24,6 @@ parts = ...@@ -24,7 +24,6 @@ parts =
#-- Creation of all needed directories. #-- Creation of all needed directories.
[basedirectory] [basedirectory]
script = $${rootdirectory:etc}/script
services = $${rootdirectory:etc}/run services = $${rootdirectory:etc}/run
cache = $${rootdirectory:var}/cache cache = $${rootdirectory:var}/cache
notifier = $${rootdirectory:etc}/notifier notifier = $${rootdirectory:etc}/notifier
...@@ -35,26 +34,25 @@ ssh = $${rootdirectory:etc}/ssh/ ...@@ -35,26 +34,25 @@ ssh = $${rootdirectory:etc}/ssh/
sshkeys = $${rootdirectory:srv}/sshkeys sshkeys = $${rootdirectory:srv}/sshkeys
notifier-feeds = $${basedirectory:notifier}/feeds notifier-feeds = $${basedirectory:notifier}/feeds
notifier-callbacks = $${basedirectory:notifier}/callbacks notifier-callbacks = $${basedirectory:notifier}/callbacks
script = $${basedirectory:script}
#---------------- #----------------
#-- #--
#-- resiliency script for the bully algorithm #-- Resiliency script for the bully algorithm
[resiliency] [resiliency]
# XXX The bully script is not run automatically, at the moment. # If enable-bully-service is true, the scripts will be run automatically.
# For testing, run bin/bully for all the PBSReady instances. # If false, they can be run with bin/bullly for all the PBSReady instances.
# To enable automatic running, change the recipe and create the wrapper under "script" instead of "bin" enable-bully-service = False
recipe = slapos.cookbook:addresiliency recipe = slapos.cookbook:addresiliency
script = $${basedirectory:script} services = $${basedirectory:services}
run = $${basedirectory:services}
bin = $${rootdirectory:bin} bin = $${rootdirectory:bin}
etc = $${rootdirectory:etc}
#---------------- #----------------
#-- #--
#-- sets up an rdiff-backup server (with a dropbear server for ssh) #-- Sets up an rdiff-backup server (with a dropbear server for ssh)
[urls] [urls]
ssh-public-key = $${sshkeys-dropbear:public-key-value} ssh-public-key = $${sshkeys-dropbear:public-key-value}
......
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