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.18.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 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 |
---|---|
Fully-qualified connection plugin to use for discovered hosts. Default: |
|
Path to the Default: Configuration:
|
|
Include/exclude selection by attributes - Default: |
|
Add containers to a group derived from image name (e.g., Choices:
|
|
Label keys to group containers by ( Default: |
|
Add hosts to groups based on Jinja2 conditionals. Default: |
|
Whether to include stopped/exited containers. Choices:
|
|
Create groups based on hostvars/labels. Default: |
|
Key/value labels that must match (all) for a container to be included. Default: |
|
Glob patterns to match container names or IDs; empty means include all. Default: |
|
Token that ensures this is a source file for the ‘containers.podman.podman_containers’ inventory plugin. Choices:
|
|
Fail when keyed/composed grouping references missing data. Choices:
|
|
When true, store raw Choices:
|
Examples
plugin: containers.podman.podman_containers
include_stopped: false
label_selectors:
role: api
connection_plugin: containers.podman.podman