Skip to content

Instantly share code, notes, and snippets.

@abitrolly
Created October 25, 2017 20:01
Show Gist options
  • Save abitrolly/3766b17b5440453884342cd2f478ba7a to your computer and use it in GitHub Desktop.
Save abitrolly/3766b17b5440453884342cd2f478ba7a to your computer and use it in GitHub Desktop.
List ansible modules
#!/usr/bin/env python
from ansible.plugins.loader import module_loader
import os
# fill up module cache by looking for non-existing plugin
module_loader.find_plugin('cryptobiosis')
cache = module_loader._plugin_path_cache['']
names = set()
for name in sorted(cache):
if name[0] == '_': # deprecated plugin
name = name[1:]
# strip extension
name = os.path.splitext(name)[0]
names.add(name)
for name in sorted(names):
print(name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment