community.general.random_pet (8.5.0) — lookup

Generates random pet names

| "added in version" 3.1.0 of community.general"

Authors: Abhijeet Kasurde (@Akasurde)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Generates random pet names that can be used as unique identifiers for the resources.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Generate pet name
  ansible.builtin.debug:
    var: lookup('community.general.random_pet')
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  # Example result: 'loving-raptor'

- name: Generate pet name with 3 words
  ansible.builtin.debug:
    var: lookup('community.general.random_pet', words=3)
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  # Example result: 'fully-fresh-macaw'

- name: Generate pet name with separator
  ansible.builtin.debug:
    var: lookup('community.general.random_pet', separator="_")
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
  # Example result: 'causal_snipe'

- name: Generate pet name with length
  ansible.builtin.debug:
    var: lookup('community.general.random_pet', length=7)

Inputs

    
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

Outputs

_raw:
  description: A one-element list containing a random pet name
  elements: str
  type: list