containers / ansible-podman

Ansible podman is a package to allow ansible playbooks to manage podman containers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ansible Module for Podman

This module allows Ansible to use Podman to manage container images.

Requirements

  • Python 3.6+
  • Ansible 2.8

Installation

  1. Install Podman
  2. Install Python-podman library on the host you will be running ansible playbooks.
git clone git@github.com:containers/python-podman.git
cd ~/python-podman
python3 setup.py clean -a && python3 setup.py sdist bdist
python3 setup.py install --user
  1. Copy podman_images_v2.py to your directory library
../podman_test/
├── library
│   └── podman_image_v2.py
└── pull_image.yml

Usage Examples

This module will pull the fedora latest image from docker hub.

hosts: localhost
  tasks:
   - name: Pull an image
     podman_image_v2:
       name: fedora
     register: result

   - debug: var=result

Parameters

parameter required default choices comments
name yes
    Set image name
    tag no latest
      Set the tag of the image
      pull no true
        Set the pull option
        force no false
          Set to pull an image forcefully
          state no present
          • present
          • build
          • absent
          Set the state of the image

          About

          Ansible podman is a package to allow ansible playbooks to manage podman containers

          License:Apache License 2.0


          Languages

          Language:Python 100.0%