I am trying to understand how to use nested roledefs
in fabric. It is written,
Role definitions are not necessary configuration of hosts only, but could hold other role specific settings of your choice. This is achieved by defining the roles as dicts and host strings under a hosts key
My config is like,
from fabric.api import env
env.roledefs = {
'prod': {
'hosts': ['prod1', 'prod2', 'prod3'],
'db': ['db1']
},
}
My question is how to access db
for a particular task.
@roles('db') or @roles('prod') #<- not sure what to add here
def migrate():
# migration stuff
pass
My suggestion: