-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2-compatible 'roles' or similar #1594
Comments
From the mailing list:
Our use cases are:
|
Thanks @max-arnold! I recognize many of those from my own use cases in the past as well. The reverse mapping bit in particular I remember coming up in v1 a few times, so I added it to the list. |
For Fabric v2 to become useful to me, I would need a way to tell Previously I defined roles and then ran I fail to find an equivalent in Fabric v2, and I also failed to emulate this feature using:
active_hostset: null
hostsets:
myhostset:
- ...
Instead of the expected list of hosts I get |
We map different sets of hosts to each role for each of our environments in fabric v1, and the environment is set by running a In v2 we tried using a custom Task, but the problem is |
Making I prototyped this in my forks: |
Hi, I don't know what happened to this software after many years, but I really missed the "roles" concept in Fabric@1.x, especially when running |
We also use roles to represent the same set of operations across different environments. Perhaps separating the concept of a named role and a named environment would be useful? As in, the web role in the dev environment. |
Synopsis
At time of writing, the v2 branch has a
Group
class that should be capable of serving as the units formerly known as 'roles', aka "a bunch of hosts to do stuff with/on".However, there's no specific way of organizing or labeling
Group
objects yet; it's "done" enough for the pure API use case of advanced users who want to roll their own specific way of creating them, but lacks anything for CLI-oriented users or intermediate folks who want something frameworky to build around.Put another way, unless you're rolling purely with the API, having Group objects lying around somewhere is useless if the CLI or task-calling bits have no way of finding them!
Background
In v1, roles were effectively a single flat namespace mapping simple string labels to what would be Groups in v2, and they could be selected on the CLI at runtime (
fab --roles=web,db
) and/or registered as default targets for tasks (@task('db') \n def migrate():
), much like hosts.Users defined them in
env.roledefs
, a simple dict; any intermediate to advanced functionality revolved around modifying it, usually at runtime (via pre-task or subroutine), sometimes at module load time.Specific use cases / needs / subfeatures
Group
s and/orConnection
s.Lexicon
instead of adict
.db
,web
,lb
, but then a 2nd-tier name calledprod
that is always the union of the other three. I forget if I added that toLexicon
yet. Possible there's other map subclasses out there that already do it too.if cxn in group
would work even ifcxn
is a distinct object from the equal member insidegroup
.db
role"Implementation ideas/concerns
@group
like@task
, and the functions aren't executable units of work, but instead yield Group objects.The text was updated successfully, but these errors were encountered: