
    Vh
                     ~    d dl mZmZmZ eZdZdZdZ	 d dl	Z	dZ
d dlmZ d d	lmZ  G d
 de      Zy# e$ r dZ
Y !w xY w)    )absolute_importdivisionprint_functiona  
name: random_pet
author:
  - Abhijeet Kasurde (@Akasurde)
short_description: Generates random pet names
version_added: '3.1.0'
requirements:
  - petname U(https://github.com/dustinkirkland/python-petname)
description:
  - Generates random pet names that can be used as unique identifiers for the resources.
options:
  words:
    description:
      - The number of words in the pet name.
    default: 2
    type: int
  length:
    description:
      - The maximal length of every component of the pet name.
      - Values below 3 will be set to 3 by petname.
    default: 6
    type: int
  prefix:
    description: A string to prefix with the name.
    type: str
  separator:
    description: The character to separate words in the pet name.
    default: "-"
    type: str
ao  
- name: Generate pet name
  ansible.builtin.debug:
    var: lookup('community.general.random_pet')
  # Example result: 'loving-raptor'

- name: Generate pet name with 3 words
  ansible.builtin.debug:
    var: lookup('community.general.random_pet', words=3)
  # Example result: 'fully-fresh-macaw'

- name: Generate pet name with separator
  ansible.builtin.debug:
    var: lookup('community.general.random_pet', separator="_")
  # Example result: 'causal_snipe'

- name: Generate pet name with length
  ansible.builtin.debug:
    var: lookup('community.general.random_pet', length=7)
  # Example result: 'natural-peacock'
zd
_raw:
  description: A one-element list containing a random pet name.
  type: list
  elements: str
NTF)AnsibleError)
LookupBasec                       e Zd ZddZy)LookupModuleNc                    t         st        d      | j                  ||       | j                  d      }| j                  d      }| j                  d      }| j                  d      }t	        j
                  |||      }|r| | | }|gS )NzNPython petname library is required. Please install using "pip install petname")var_optionsdirectwordslengthprefix	separator)r   r   letters)HAS_PETNAMEr   set_options
get_optionpetnameGenerate)	selfterms	variableskwargsr   r   r   r   valuess	            o/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/community/general/plugins/lookup/random_pet.pyrunzLookupModule.runT   s      L M M 	Yv>(**OOK0	!!FSx	{6(3Fx    )N)__name__
__module____qualname__r    r   r   r	   r	   R   s    r   r	   )
__future__r   r   r   type__metaclass__DOCUMENTATIONEXAMPLESRETURNr   r   ImportErroransible.errorsr   ansible.plugins.lookupr   r	   r"   r   r   <module>r,      s_    C B>,
K ( -:   Ks   2 <<