
    Vh                    ^    d dl mZ dZdZdZd dlZd dlmZ d dlm	Z	 d dl
mZ  G d	 d
e      Zy)    )annotationsa  
    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                      e Zd ZddZy)LookupModuleNc                    |}|r	 t        j                  |      g}|S |S # t        $ r}t        dt	        |      z        d }~ww xY w)Nz Unable to choose random term: %s)secretschoice	Exceptionr   r   )selfterms	variableskwargsretes         T/home/dcms/DCMS/lib/python3.12/site-packages/ansible/plugins/lookup/random_choice.pyrunzLookupModule.run+   sV    V~~e,- 
s
  V"#E	RS#TUUVs     	AA  A)N)__name__
__module____qualname__r        r   r   r   )   s    	r   r   )
__future__r   DOCUMENTATIONEXAMPLESRETURNr
   ansible.errorsr   +ansible.module_utils.common.text.convertersr   ansible.plugins.lookupr   r   r   r   r   <module>r!      s9    #		
  ' A -: r   