community.crypto.to_serial filter – Convert an integer to a colon-separated list of hex numbers

Note

This filter plugin is part of the community.crypto collection (version 2.19.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.crypto.

To use it in a playbook, specify: community.crypto.to_serial.

New in community.crypto 2.18.0

Synopsis

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

Input

This describes the input of the filter, the value before | community.crypto.to_serial.

Parameter

Comments

Input

integer / required

The non-negative integer to convert.

See Also

See also

community.crypto.to_serial filter plugin

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

Examples

- name: Convert integer to serial number
  ansible.builtin.debug:
    msg: "{{ 1234567 | community.crypto.to_serial }}"

Return Value

Key

Description

Return value

string

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 0 is "00".

Returned: success

Authors

  • Felix Fontein (@felixfontein)

Hint

Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.