sr2c.podman.subid_host_id filter – Map a rootless container’s user or group ID to the host

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.subid_host_id.

Synopsis

  • Returns the host ID that a user or group ID inside a rootless Podman container maps to, with Podman’s default mapping.

  • ID 0 in the container is the rootless user’s own UID or GID on the host. IDs from 1 up are the user’s subordinate ranges, joined in order.

  • Fails if the ID is outside the IDs mapped into the container.

Input

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

Parameter

Comments

Input

integer / required

The ID inside the container.

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.subid_host_id(positional1, positional2, ...)

Parameter

Comments

ranges

list / elements=dictionary / required

The user’s subordinate ranges, from sr2c.podman.getsubids_ranges.

own_id

integer / required

The rootless user’s own UID, or GID for a group ID, on the host.

Examples

# UID 1000 inside the container, owner on the host
owner: "{{ 1000 | sr2c.podman.subid_host_id(subuid_ranges, rootless_uid) }}"

Return Value

Key

Description

Return value

integer

The ID on the host.

Returned: success

Authors