question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Additional roledefs keys beyond 'hosts' not loading into env

See original GitHub issue

This snippet from the docs doesn’t make the example keys ‘foo’ available to the user via env, only the ‘hosts’ key is subsequently loaded by Fabric (into env.hosts)

from fabric.api import env

env.roledefs = {
    'web': {
        'hosts': ['www1', 'www2', 'www3'],
        'foo': 'bar'
    },
    'dns': {
        'hosts': ['ns1', 'ns2'],
        'foo': 'baz'
    }
}

Documented further on this stackoverlow question

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:7

github_iconTop GitHub Comments

17reactions
kynancommented, Jul 11, 2016

@bitprophet Why has this been closed? The behavior of additional roledef keys hasn’t changed, so is this a “won’t fix”?

0reactions
chaimpeckcommented, Mar 19, 2015

This is confusing and I think it should be noted in the documentation that these additional variables are not accessible outside of the roledefs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Define per host environment variable using slurp to read file ...
What I have been reading is that if I define env: under a task, it is applicable only to that task and not...
Read more >
Host Checker Troubleshooting Guide - Pulse Secure
Host Checker is a client-side agent that performs endpoint checks on hosts that connect to the IVE. You can invoke Host Checker before...
Read more >
The environment dictionary, env - Fabric documentation
Keys in env are sometimes referred to as “env variables”. ... Fabric will prompt you when necessary if this isn't set or doesn't...
Read more >
Why syncing .env files doesn't scale for secrets management
Using a SecretOps Platform such as Doppler is the key to managing environment variables.
Read more >
Variables - Ansible Documentation
YAML also supports dictionaries which map keys to values. ... However, if you choose to use dot notation be aware that some keys...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found