Created
October 26, 2016 21:47
-
-
Save samdoran/2264a4ff40b72638b4195ffebc69b372 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| from __future__ import (absolute_import, division, print_function) | |
| __metaclass__ = type | |
| from random import choice | |
| from ansible.plugins.lookup import LookupBase | |
| class LookupModule(LookupBase): | |
| def run(self, terms, **kwargs): | |
| count = terms.pop(0) | |
| ret = [] | |
| for number in range(count): | |
| ret.append( | |
| { | |
| 'data' : choice(terms), | |
| 'count': number | |
| } | |
| ) | |
| return ret |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment