Created
October 25, 2017 20:01
-
-
Save abitrolly/3766b17b5440453884342cd2f478ba7a to your computer and use it in GitHub Desktop.
List ansible modules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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