]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-deploy: implement keep_running
authorLoic Dachary <ldachary@redhat.com>
Thu, 27 Aug 2015 21:20:25 +0000 (23:20 +0200)
committerLoic Dachary <ldachary@redhat.com>
Thu, 27 Aug 2015 21:20:25 +0000 (23:20 +0200)
When keep_running is true, do not shutdown the cluster, leave it as it
is for other workunits or tasks to use. This effectively allows the
ceph-deploy task to be used as a helper to deploy clusters.

The call to build_ceph_cluster is simplified by giving it the whole
configuration dictionary instead of re-building one with selected arguments.

Signed-off-by: Loic Dachary <loic@dachary.org>
tasks/ceph_deploy.py

index f6a365f75af1e086244b7b763d2e1fd04eee743b..25234f7e1ca39294d7a2649d1af1e723649f700a 100644 (file)
@@ -371,6 +371,8 @@ def build_ceph_cluster(ctx, config):
         log.info(traceback.format_exc())
         raise
     finally:
+        if config.get('keep_running'):
+            return
         log.info('Stopping ceph...')
         ctx.cluster.run(args=['sudo', 'stop', 'ceph-all', run.Raw('||'),
                               'sudo', 'service', 'ceph', 'stop' ])
@@ -613,6 +615,7 @@ def task(ctx, config):
              branch:
                 stable: bobtail
              mon_initial_members: 1
+             keep_running: true
 
         tasks:
         - install:
@@ -651,13 +654,6 @@ def task(ctx, config):
     with contextutil.nested(
          lambda: install_fn.ship_utilities(ctx=ctx, config=None),
          lambda: download_ceph_deploy(ctx=ctx, config=config),
-         lambda: build_ceph_cluster(ctx=ctx, config=dict(
-                 conf=config.get('conf', {}),
-                 branch=config.get('branch',{}),
-                 dmcrypt=config.get('dmcrypt',None),
-                 separate_journal_disk=config.get('separate_journal_disk',None),
-                 mon_initial_members=config.get('mon_initial_members', None),
-                 test_mon_destroy=config.get('test_mon_destroy', None),
-                 )),
+         lambda: build_ceph_cluster(ctx=ctx, config=config),
         ):
         yield