community.crypto.to_serial (2.18.0) — filter

Convert an integer to a colon-separated list of hex numbers

| "added in version" 2.18.0 of community.crypto"

Authors: Felix Fontein (@felixfontein)

Install collection

Install with ansible-galaxy collection install community.crypto:==2.18.0


Add to requirements.yml

  collections:
    - name: community.crypto
      version: 2.18.0

Description

Converts an integer to a colon-separated list of hex numbers of the form C(00:11:22:33).

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Convert integer to serial number
  ansible.builtin.debug:
    msg: "{{ 1234567 | community.crypto.to_serial }}"

Inputs

    
_input:
    description:
    - The non-negative integer to convert.
    required: true
    type: int

Outputs

_value:
  description:
  - A colon-separated list of hexadecimal numbers.
  - Letters are upper-case, and all numbers have exactly two digits.
  - The string is never empty. The representation of C(0) is C("00").
  type: string

See also