community.crypto.parse_serial (2.18.0) — filter

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

| "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

Parses a colon-separated list of hex numbers of the form C(00:11:22:33) and returns the corresponding integer.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Parse serial number
  ansible.builtin.debug:
    msg: "{{ '11:22:33' | community.crypto.parse_serial }}"

Inputs

    
_input:
    description:
    - A serial number represented as a colon-separated list of hex numbers between 0 and
      255.
    - These numbers are interpreted as the byte presentation of an unsigned integer in
      network byte order. That is, C(01:00) is interpreted as the integer 256.
    required: true
    type: string

Outputs

_value:
  description:
  - The serial number as an integer.
  type: int

See also