Commit 20499716 authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis

deploy: Better snf-deploy setup support

Use the setup command to add another Ganeti cluster
to an existing synnefo installation. For instance:

 snf-deploy setup --setup synnefo --cluster ganeti2

For a more fine grained use, try something like:

 snf-deploy setup --setup synnefo --role vmc \
   --node new --cluster ganeti

to setup a specific component/role on a given node of a
given setup and cluster.
Signed-off-by: default avatarDimitris Aragiorgis <>
parent 2c8e2ec9
...@@ -56,6 +56,8 @@ def setup_env(args): ...@@ -56,6 +56,8 @@ def setup_env(args):
env.component = args.component env.component = args.component
env.method = args.method env.method = args.method
env.role = args.role env.role = args.role
env.cluster = args.cluster
env.node = args.node
# Helper methods that are invoked via fabric's execute # Helper methods that are invoked via fabric's execute
...@@ -137,13 +139,17 @@ def setup_qa(ctx=None): ...@@ -137,13 +139,17 @@ def setup_qa(ctx=None):
@with_ctx @with_ctx
def setup(ctx=None): def setup(ctx=None):
if env.component:
target = env.component if env.node:
else: if env.component:
target = env.role C = roles.get(env.component, ctx)
C = roles.get(target, ctx) elif env.role:
if env.method: C = roles.get(env.role, ctx)
fn = getattr(C, env.method) if env.method:
fn() fn = getattr(C, env.method)
else: fn()
C.setup() else:
elif env.cluster:
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