containers.podman.podman_containers inventory – Inventory plugin that discovers Podman containers as hosts
Note
This inventory plugin is part of the containers.podman collection (version 1.20.2).
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 containers.podman.
To use it in a playbook, specify: containers.podman.podman_containers.
New in containers.podman 1.18.0
Synopsis
- Discover running (and optionally stopped) Podman containers on the local host and add them as inventory hosts.
- Each discovered host is assigned an Ansible connection plugin so tasks execute inside the container without SSH.
Parameters
Parameter | Comments |
|---|---|
connection_plugin string | Fully-qualified connection plugin to use for discovered hosts. Default: |
executable string | Path to the Default: Configuration:
|
filters dictionary | Include/exclude selection by attributes - Default: |
group_by_image boolean | Add containers to a group derived from image name (e.g., Choices:
|
group_by_label list / elements=string | Label keys to group containers by ( Default: |
groups dictionary | Add hosts to groups based on Jinja2 conditionals. Default: |
include_stopped boolean | Whether to include stopped/exited containers. Choices:
|
keyed_groups list / elements=dictionary | Create groups based on hostvars/labels. Default: |
label_selectors dictionary | Key/value labels that must match (all) for a container to be included. Default: |
name_patterns list / elements=string | Glob patterns to match container names or IDs; empty means include all. Default: |
plugin string / required | Token that ensures this is a source file for the ‘containers.podman.podman_containers’ inventory plugin. Choices:
|
strict boolean | Fail when keyed/composed grouping references missing data. Choices:
|
verbose_output boolean | When true, store raw Choices:
|
Examples
plugin: containers.podman.podman_containers include_stopped: false label_selectors: role: api connection_plugin: containers.podman.podman
Collection links
© 2012–2018 Michael DeHaan
© 2018–2025 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/projects/ansible/latest/collections/containers/podman/podman_containers_inventory.html