-
Notifications
You must be signed in to change notification settings - Fork 197
-
Notifications
You must be signed in to change notification settings - Fork 197
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
Make strategy_plugins obsolete #568
Comments
Hi :) The simplest solution is to avoid installing via pip. The installation steps avoid pip for this very reason -- the package directory can be placed in any path (e.g. in the same dir as ansible.cfg), and the first loaded plugin fixes the Python path up internally to cope with the install location. Can't you ship the extension and say, place it in the same directory as ansible.cfg? That way, 'strategy_plugins = mitogen-1.2.3/ansible_mitogen/plugins/strategy' "should" always succeed. There are a bunch more hooks where it might be possible to trick it on to the Ansible loader path, but I'd need to understand more about your project first in order to suggest one |
Sure, we can do that, it's just that we already ship a |
Totes understand the desire to use pip :) The trouble is that Ansible's plugin loader paths are completely separate. There is at least one interpreter-level hack that is possible to cure this "once and for all", but making global changes to the interpreter config is a very nasty thing for any Python package to do. |
Ok, it's not a big deal, I wanted to check if this would be easily solveable. We'll probably ship ansible_mitogen for now, until this has been implemented. Thx for the quick response! |
Thanks for reporting it anyway -- this is a known usability issue and there wasn't an existing ticket for it |
@dw @varac we had similar challenges getting users to configure the ARA callback plugin :) Once upon a time, we had users do something like this:
In a script it's not too bad but we needed something better for humans. We now have python modules that try to be helpful:
(More info in docs: https://ara.readthedocs.io/en/stable/configuration.html) The approach is super simple and it's open source 🔥 https://github.com/openstack/ara/tree/master/ara/setup Somewhere in my to-do list, I need to experiment with putting things in ~/.ansible. Apparently you can put stuff there. |
@dmsimard I keep forgetting we have the same problem! My main gripe with a wrapper script is that it kicks the bucket down the road.. installation is no longer a one-step process, but something that impacts the interface to the tool, something the Ansible extension works very hard to avoid everywhere else. I also wonder how ARA's procedure works with AWX. Does it require a different procedure? Options seem to be:
Problem with the magic setup.py scripts is that the user has no idea some venv-specific extension version just updated their homedir or the whole system What I'd really love is for |
Enabling ARA on AWX is a bit more involved because of a bug around the default virtualenv inheriting from an Ansible installed by RPM: ansible/awx#1737. I never got to the bottom of it but the workaround is:
Re: options
I actually recommend users to install by pip inside a virtualenv. Can you expand on what is confusing with pypi ?
To clarify, do you mean something like
I'll report back if I get the chance to experiment on ~/.ansible
Let me know if you end up figuring that out, I'm interested :D |
I've noticed this role on galaxy, could this be what you're looking for? https://github.com/robertdebock/ansible-role-mitogen I for one, would also love to have Mitogen somewhere easily installable (e.g on pypi) for easier installation on machines that will run the ansible playbooks... |
|
@dmsimard it looks like the final word on this is Mazer, but I think I've quickly played around twice now and failed to make a working package. It's possible Ansible 2.8 doesn't quite implement the design intent of collections yet. At least, you can see from the Mazer docs that strategy plugins appear in the example collection layout, but I'm probably just noobing collections, but it looks like at least in principle the right answer to this ticket |
I'm super impressed by the speedup of ansible_mitogen !
However, there's one thing blocking the rollout in our opensource project, and this is the fact that you need to specify the location of the ansible_mitogen strategy plugin in
ansible.cfg
.The location will veary depending of the type of installation, i.e. some will install it under
~/.local/lib/python3.6
, some under/user/local/lib/python3.7
, some in a virtualenv etc.We like to ship a
ansibile.cfg
that doesn't need to get modified manually, so I wonder if there's any change that ansible will try to find the plugin path by itself ? That would make it even easier for the user.The text was updated successfully, but these errors were encountered: