community / community.general / 8.5.0 / lookup / random_pet Generates random pet names | "added in version" 3.1.0 of community.general" Authors: Abhijeet Kasurde (@Akasurde)community.general.random_pet (8.5.0) — lookup
Install with ansible-galaxy collection install community.general:==8.5.0
collections: - name: community.general version: 8.5.0
Generates random pet names that can be used as unique identifiers for the resources.
- 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)
words: default: 2 description: - The number of words in the pet name. type: int length: default: 6 description: - The maximal length of every component of the pet name. - Values below 3 will be set to 3 by petname. type: int prefix: description: A string to prefix with the name. type: str separator: default: '-' description: The character to separate words in the pet name. type: str
_raw: description: A one-element list containing a random pet name elements: str type: list