14장. Managing containers by using RHEL system roles


With the podman RHEL system role, you can manage Podman configuration, containers, and systemd services that run Podman containers.

14.1. Configuring image registry management for Podman and other container tools

With the podman RHEL system role, you can automate the Podman management, including registry configuration, across multiple RHEL systems. Instead of manually editing files, you define your desired registry configuration in an Ansible playbook.

The podman RHEL system role uses the podman_registries_conf variable, which accepts a dictionary containing the registry settings. The role then creates a drop-in file, for example, in the /etc/containers/registries.conf.d/ to apply your configuration, following best practices for managing system configurations.

Prerequisites

Procedure

  1. Create a playbook file, for example, ~/playbook.yml, with the following content:

    ---
    - name: Configure Podman registries with RHEL system roles
      hosts: managed-node-01.example.com
      vars:
        podman_registries_conf:
          unqualified-search-registries:
            - "registry.access.redhat.com"
            - "docker.io"
            - "my-company-registry.com"
          registry:
            - location: "my-company-registry.com"
            - location: "my-local-registry:5000"
              insecure: true
      tasks:
        - name: Include the podman system role
          ansible.builtin.include_role:
            name: redhat.rhel_system_roles.podman

    The settings specified in the example playbook include the following:

    • unqualified-search-registries: Extends the list of registries Podman searches when you use a short image name (for example, podman pull <my-image>). Podman searches for images in my-company-registry.com after the default registries.
    • [registry]: Defines specific properties for a given registry. For example, you can enable an insecure connection by setting insecure=true to a local registry running at my-local-registry:5000.
  2. Validate the playbook syntax:

    $ ansible-playbook --syntax-check ~/playbook.yml

    Note that this command only validates the syntax and does not protect against a wrong but valid configuration.

  3. Run the playbook:

    $ ansible-playbook ~/playbook.yml

    The podman_use_new_toml_formatter variable generates TOML-compliant configuration files that are compatible with Podman. This variable enhances the Podman role by supporting all TOML features, including tables and inline tables, through a true TOML formatter instead of the Jinja template used previously.

    The new formatter is disabled by default to maintain compatibility with the previous formatter’s behavior. To enable the new formatter, set podman_use_new_toml_formatter: true in your configuration:

podman_use_new_toml_formatter: true
podman_containers_conf:
  containers:
    annotations:
      - environment=production
      - status=tier2

Verification

  1. Run the podman info command on the host:

    $ ansible managed-node-01.example.com -m command -a 'podman info'
  2. Verify the registeries section:

    registries:
      my-company-registry.com:
        Blocked: false
        Insecure: false
        Location: my-company-registry.com
        MirrorByDigestOnly: false
        Mirrors: null
        Prefix: my-company-registry.com
        PullFromMirror: ""
      my-local-registry:5000:
        Blocked: false
        Insecure: true
        Location: my-local-registry:5000
        MirrorByDigestOnly: false
        Mirrors: null
        Prefix: my-local-registry:5000
        PullFromMirror: ""
      search:
      - registry.access.redhat.com
      - docker.io
      - my-company-registry.com
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동