plugin deprecation and aliasing

So I have a branch with an update to the plugin loader, this should now enable renaming and deprecating plugins.

https://github.com/bcoca/ansible/tree/load_aliases

To deprecate a module just rename it with a leading underscore:

git mv stats.py _stats.py

to rename a module, do:

git mv stats.py fileinfos.py
ln -s fileinfos.py _stats.py
git add _stats.py

This makes the ‘current’ module “fileinfos”, it also keeps “stats” as an alias to the new module name for backwards compatibility. Modules with a preceding underscore only get loaded if the name was unmatched to avoid collisions and confusion.

feedback encouraged!

Thanks Brian!

As I mentioned on another thread (we, as in Brian) is working on making this capability show up on the docsite soon.

This will among other things allow better names for modules, like starting all the Google Cloud stuff with, say, gc, and the AWS stuff with aws, and openstack stuff with os_

This will happen as soon as we get the doc site wired up and I’m super excited about it.

So. Exciting.

Another thing we just talked about is having subdirs, like

cloud/openstack/*

we will definitely want them to be namespaced, like “os_compute”, with aliases, but this will allow the individual doc lists to be categorized better too.

What about doing python-like modules - so that if there was:

cloud/openstack/compute.py

you could do:

  • openstack.compute:

Or were you thinking still have:

cloud/openstack/os_compute.py

and then have an alias of some sort? (happy to help hack on that feature if I know how you want it to look when it’s done)

Or were you thinking more like:

cloud/openstack/os_compute.py

Yeah, I’m not really wanting to require new namespacing rules at this time, as ‘compute’ would be otherwise ambiguous.

Thus I think it’s

cloud/openstack/os_*

In AWS we will have most things still starting with ec2 and some starting with just aws_ with some aliases for their old forms.

Also in the modules lists will have icons beside core and deprecated modules in each subcategory.

Sweet.