Like this question, I tried to access additional keys in env.roledefs that Fabric provides:
from fabric.api import env
env.roledefs = {
'web': {
'hosts': ['www1', 'www2', 'www3'],
'foo': 'bar'
},
'dns': {
'hosts': ['ns1', 'ns2'],
'foo': 'baz'
}
}
However , the documentation does not explain how to access these foo keys. Super hulks seem to need access to them through:
env.roledefs[env.effective_roles[0]]['foo']
Is there an easy way to access these optional keys provided by Fabric?
source
share