Skip to content

An Ansible role that mirrors operators off-line and their companion container images to a local mirror registry.

Notifications You must be signed in to change notification settings

salanisor/role_openshift_disconnected_operators

Repository files navigation

NOTE

This tool can be used for OpenShift versions up to and including 4.5. As of OpenShift 4.6 please use the new OPM tool to create your custom catalogue and mirror your images. See instructions in the OCP docs https://docs.openshift.com/container-platform/4.6/operators/admin/olm-restricted-networks.html

OpenShift Offline Operator Catalog Build and Mirror

This Ansible role will create a custom operator catalogue based on the desired operators and mirror the images to a local registry.

Why create this?

Because the current catalog build and mirror (https://docs.openshift.com/container-platform/4.5/operators/olm-restricted-networks.html) takes 1-5 hours to create and more than 50% of the catalog is not usable offline anyways. This tool allows you to create a custom catalog with only the operators you need.

Requirements

This tool was tested with the following versions of the runtime and utilities.

  1. RHEL 7.8, Centos 8
  2. Python 3.7.6 (with pyyaml,jinja2,jmespath library)
  3. Podman v1.8 (If you use anything below 1.8, you might run into issues with multi-arch manifests)
  4. Skopeo 0.1.41

Please note this only works with operators that meet the following criterea

  1. Have a CSV in the manifest that contains a full list of related images
  2. The related images are tagged with a SHA

For a full list of operators that work offline please see link below https://access.redhat.com/articles/4740011

Role Variables

See all possible variables & how-to.

Dependencies

You can obtain the pull secret for quay.io and registry.redhat.io from the Pull-secret-page

Example Playbook

Run playbook: ansible-playbook -vvv pb_ocp_disconnected_operators.yaml --ask-vault-pass

---
- hosts: bastion
  gather_facts: true
  pre_tasks:
  - include_tasks: pre_tasks.yaml
  roles:
  - role: role_openshift_disconnected_operators

License

BSD

Author Information

@canit00

Project forked from Arvin Amirian

About

An Ansible role that mirrors operators off-line and their companion container images to a local mirror registry.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published