Hi all,
I have a fabfile that I use for deployment (using Fabric 1.4.2) to a few
different clusters, some of which have certain roles that need action on
and others don't. My fabfile is something like this, with one cluster than
has a database role and another that doesn't.
def cluster_one():
env.roledefs = {'web': ['www1', 'www2'], 'db': ['db']}
def cluster_without_a_db():
env.roledefs = {'web': ['www3'], 'db': []}
@roles('web')
def operate_on_web():
run('....')
@roles('db')
def operate_on_db():
run('....')
def deploy():
execute(operate_on_web)
execute(operate_on_db)
Now, when I run "fab cluster_one deploy" things happen as expected, with
the operate_on_web running on the web roles, and operate_on_db runnign on
the db role. But when I run "fab cluster_without_db deploy", it still
executes operate_on_db, even though there are no hosts in the 'db' roledef.
I had expected it to not execute at all. Am I doing something wrong, or is
this the way it's supposed to work?
Thanks,
Dan
_______________________________________________
Fab-user mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/fab-user