a ì)g&ã@sdddlmZmZmZeZdZdZdZddl Z ddl m Z ddl m Z ddlmZGd d „d eƒZdS) é)Úabsolute_importÚdivisionÚprint_functionaú name: random_choice author: Michael DeHaan version_added: "1.1" short_description: return random element from list description: - The 'random_choice' feature can be used to pick something at random. While it's not a load balancer (there are modules for those), it can somewhat be used as a poor man's load balancer in a MacGyver like situation. - At a more basic level, they can be used to add chaos and excitement to otherwise predictable automation environments. zÒ - name: Magic 8 ball for MUDs ansible.builtin.debug: msg: "{{ item }}" with_random_choice: - "go through the door" - "drink from the goblet" - "press the red button" - "do nothing" z< _raw: description: - random item type: raw N)Ú AnsibleError)Ú to_native)Ú LookupBasec@seZdZddd„ZdS)Ú LookupModuleNc KsR|}|rNzt |¡g}Wn4tyL}ztdt|ƒƒ‚WYd}~n d}~00|S)Nz Unable to choose random term: %s)ÚrandomÚchoiceÚ Exceptionrr)ÚselfZtermsZinjectÚkwargsÚretÚe©rúH/usr/lib/python3.9/site-packages/ansible/plugins/lookup/random_choice.pyÚrun,s&zLookupModule.run)N)Ú__name__Ú __module__Ú __qualname__rrrrrr*sr)Z __future__rrrÚtypeZ __metaclass__Z DOCUMENTATIONZEXAMPLESZRETURNr Zansible.errorsrZansible.module_utils._textrZansible.plugins.lookuprrrrrrÚs