This is a very Fabric specific question, but more experienced python hackers might be able to answer this, even if they don\'t know Fabric.
I am trying to specify differ
The env.roles
will give you the roles specified by -R flag or hardcoded in the script itself. It won't contain the roles specified per task using the command line or using @roles
decorator. There is currently no way of getting this kind of information.
The next release of fabric (1.9 probably) will provide env.effective_roles
attribute with exactly what you want - the roles being used for the currently executed task. The code for that has already been merged into master.
Have a look at this issue.