sr2c.podman.getsubids_ranges filter – Parse the output of getsubids

Note

This filter plugin is part of the sr2c.podman collection (version 0.0.1).

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 sr2c.podman.

To use it in a playbook, specify: sr2c.podman.getsubids_ranges.

Synopsis

  • Parses the output of getsubids <user> or getsubids -g <user> into a list of the user’s subordinate ID ranges, in the order Podman maps them into a container.

  • Unlike sr2c.podman.subid_ranges, this works for users whose ranges come from FreeIPA through SSSD as well as from /etc/subuid and /etc/subgid.

  • Fails if the output has no ranges, or a line it doesn’t recognise.

Input

This describes the input of the filter, the value before | sr2c.podman.getsubids_ranges.

Parameter

Comments

Input

string / required

Output of getsubids.

Positional parameters

This describes positional parameters of the filter. These are the values positional1, positional2 and so on in the following example: input | sr2c.podman.getsubids_ranges(positional1, positional2, ...)

Parameter

Comments

user

string

The user the ranges are for, used in error messages.

Default: "user"

Examples

subuid_ranges: "{{ getsubids_result.stdout | sr2c.podman.getsubids_ranges('link') }}"

Return Value

Key

Description

Return value

list / elements=dictionary

One entry per range, with owner, start, count and end, as from sr2c.podman.subid_ranges.

end is one past the last ID in the range.

Returned: success

Authors