Repository for Ansible content that can include playbooks, roles, modules, and plugins for use with the Podman tool
Go to file
Sergey 15423c0a5a
Fix Ansible sanity issues for new version (#974)
Signed-off-by: Sagi Shnaidman <sshnaidm@redhat.com>
2025-08-29 11:58:20 +03:00
.github Add podman system connection modules (#971) 2025-08-25 09:35:27 +03:00
changelogs Release 1.17.0 (#945) 2025-06-26 13:47:49 +03:00
ci Add podman system connection modules (#971) 2025-08-25 09:35:27 +03:00
contrib Update docs and script (#973) 2025-08-25 11:45:29 +03:00
docs Update docs and script (#973) 2025-08-25 11:45:29 +03:00
meta Add meta/runtime.yml which is required for Galaxy now (#281) 2021-08-02 16:25:23 +03:00
playbooks/examples Add inventory plugins for buildah and podman (#963) 2025-08-13 16:48:50 +03:00
plugins Fix Ansible sanity issues for new version (#974) 2025-08-29 11:58:20 +03:00
tests Add podman system connection modules (#971) 2025-08-25 09:35:27 +03:00
.gitignore Add RPM building scripts (#255) 2021-05-13 14:09:16 +03:00
CHANGELOG.rst Release 1.17.0 (#945) 2025-06-26 13:47:49 +03:00
CODE-OF-CONDUCT.md Rename master branch to main (#634) 2024-11-12 14:11:54 +02:00
CONTRIBUTING.md Improve docs and guides (#958) 2025-08-03 14:22:57 +03:00
COPYING Relicense under GPLv3 and clean up modules (#57) 2020-06-08 17:07:16 +03:00
Makefile Add RPM building scripts (#255) 2021-05-13 14:09:16 +03:00
README.md Fix README (#959) 2025-08-04 12:10:02 +03:00
SECURITY.md Rename master branch to main (#634) 2024-11-12 14:11:54 +02:00
ansible-collection-containers-podman.spec Add option for ansible-core in RPM spec file (#325) 2021-10-13 15:45:02 +03:00
galaxy.yml Update docs and script (#973) 2025-08-25 11:45:29 +03:00
galaxy.yml.in Add build script (#58) 2020-06-08 22:33:26 +03:00
setup.cfg Fix setuptools (#925) 2025-04-21 11:46:44 +03:00
setup.py Run black -l 120 on all Python files to unify the style (#939) 2025-06-15 18:25:48 +03:00
test-requirements.txt Add inventory plugins for buildah and podman (#963) 2025-08-13 16:48:50 +03:00

README.md

Ansible Collection: containers.podman

CI/CD Status Ansible Galaxy License

Manage the full lifecycle of Podman containers, images, pods, networks, and volumes with Ansible.

This collection provides a suite of powerful and flexible Ansible modules to automate the management of your Podman environment. Whether you are running a single container or orchestrating complex, multi-container applications, these modules give you the tools to do it idempotently and efficiently.


Table of Contents


Key Features

  • Comprehensive Management: Control every aspect of Podman, including containers, images, pods, networks, volumes, and secrets.
  • Idempotent Operations: All modules are designed to be idempotent, ensuring predictable and consistent state for your resources.
  • Flexible and Powerful: Exposes a wide range of Podman options, from simple container creation to advanced features like systemd integration and Quadlet file generation.
  • Connection Plugin: Includes a podman connection plugin to execute Ansible tasks directly inside containers.

Requirements

  • Ansible: ansible-core >= 2.12
  • Python: python >= 3.9
  • Podman: A working installation of Podman on the target machine.

Installation

Install the collection from Ansible Galaxy using the ansible-galaxy CLI:

ansible-galaxy collection install containers.podman

You can also include it in a requirements.yml file, which is useful for managing project dependencies:

# requirements.yml
collections:
  - name: containers.podman

Then, install it with:

ansible-galaxy collection install -r requirements.yml

Getting Started: A Simple Example

Here is a quick example of how to ensure a Redis container is running using the podman_container module.

---
- name: Deploy a Redis container with Podman
  hosts: localhost
  connection: local

  tasks:
    - name: Ensure the Redis container is running
      containers.podman.podman_container:
        name: my-redis-cache
        image: docker.io/redis:alpine
        state: started
        ports:
          - "6379:6379"
        restart_policy: "always"

Available Content

This collection includes:

  • Modules:

    • podman_container: Manage Podman containers.
    • podman_image: Build, pull, and manage Podman images.
    • podman_pod: Create and manage Podman pods.
    • podman_network: Manage Podman networks.
    • podman_volume: Manage Podman volumes.
    • podman_secret: Manage Podman secrets.
    • podman_login/podman_logout: Authenticate with container registries.
    • ...and many more!
  • Connection Plugins:

    • podman: Execute Ansible tasks directly within a container.
    • buildah: Execute Ansible tasks directly within a buildah container.
  • Become Plugins:

    • podman_unshare: Execute tasks within a podman unshare environment.

Documentation

  • Official Ansible Docs: For stable, released versions of the collection, see the documentation on the official Ansible documentation site.
  • Latest Development Version: For the most up-to-date documentation based on the main branch of this repository, visit our GitHub Pages site.

Contributing

We welcome contributions from the community! Whether you want to fix a bug, add a new feature, or improve our documentation, your help is valuable.

Please read our Contributing Guide to learn how to get started with development, testing, and submitting pull requests.

License

This collection is licensed under the GNU General Public License v3.0 or later.