Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/run-the-playbooks-for-disconnected.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ configurations are mentioned over here.
### Overview

Mirror the ocp platform and other necessary images to the mirror registry. Please run this playbook before you run **6 Create Nodes Playbook** and after
**0 Setup Playbook**.
**5 Setup Bastion**.

### Outcomes

* Download `oc` and `oc-mirror` to the mirror host.
* Template the mirror pull secret to the mirror host.
* Add the ca cert to the mirror host anchors if ca is not trusted.
* Mirror the platform images using `oc adm release mirror` if legacy mirroring is enabled.
* Template the image set to mirror host and then mirror it using `oc-mirror` plogin.
* Template the image set to mirror host and then mirror it using `oc-mirror` plugin.
* Copy the results on the `oc-mirror` to ansible controller to apply to cluster in future steps.

### Notes
Expand Down
4 changes: 4 additions & 0 deletions docs/set-variables-group-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
:--- | :--- | :---
**disconnected.enabled** | True or False, to enable disconnected mode | False
**disconnected.registry.url** | String containing url of disconnected registry with or without port and without protocol | registry.tt.testing:5000
**disconnected.registry.ip** | String containing ip of the registry, which will be used for resolving dns | `192.168.151.1`
**disconnected.registry.pull_secret** | String containing pull secret of the disconnected registry to be applied on the *cluster*. Make sure to enclose pull_secret in 'single quotes' and it has appropriate pull access. | '{"auths":{"registry.tt..testing:5000":{"auth":"b3Blb...4yQQ==","email":"[email protected]"}}}'
**disconnected.registry.mirror_pull_ecret** | String containing pull secret to use for mirroring. Contains Red Hat secret and registry pull secret. Make sure to enclose pull_secret in 'single quotes' and must be able to push to mirror registry. | '{"auths":{"cloud.openshift.com":{"auth":"b3Blb...4yQQ==","email":"[email protected]", "registry.tt..testing:5000":[email protected]"}}}'
**disconnected.registry.ca_trusted** | True or False to indicate that mirror registry CA is implicitly trusted or needs to be made trusted on mirror host and cluster. | False
Expand All @@ -269,11 +270,14 @@
**disconnected.mirroring.legacy.ocp_repo** | The repo part of the repo on the mirror registry where the release image will be pushed | openshift4
**disconnected.mirroring.legacy.ocp_tag** | The tag part of the repo on the mirror registry where the release image will be pushed. Full image would be as below.: disconnected.registry.url/disconnected.mirroring.legacy.ocp_org/disconnected...ocp_repo:disconnected..ocp_tag | v4.13.1
**disconnected.mirroring.oc_mirror.release_image_tag** | The ocp release image tag you want to install the cluster with. Used when legacy platform mirroring is disabled and **disconnected.mirroring.oc_mirror.image_set** contains platform entries. | 4.13.1-multi
**disconnected.mirroring.oc_mirror.release_image_registry** | The Release Image registry like Brew Registry which stores the release images as mirror to **registry.redhat.io** | `brew.registry.redhat.io`
**disconnected.mirroring.oc_mirror.oc_mirror_args.continue_on_error** | True or False to give `--continue-on-error` flag to `oc-mirror` | False
**disconnected.mirroring.oc_mirror.oc_mirror_args.source_skip_tls** | True or False to give `--source-skip-tls` flag to `oc-mirror` | False
**disconnected.mirroring.oc_mirror.post_mirror.mapping.replace.enabled** | True or False to replace values in `mapping.txt` generated by oc-mirror. This also does a manual repush of the images in `mapping.txt`. | False
**disconnected.mirroring.oc_mirror.post_mirror.mapping.replace.list** | List of **regexp** and **replace** where every string/regular expression gets replaced by corresponding *replace* value. | regexp: interal-url.com replace: external-url.com
**disconnected.mirroring.oc_mirror.image_set** | YAML fields containing a standard `oc-mirror` [image set](https://docs.openshift.com/container-platform/latest/installing/disconnected_install/installing-mirroring-disconnected.html#oc-mirror-creating-image-set-config_installing-mirroring-disconnected) with some minor changes to schema. Differences are documented as needed. Used to generate final image set. | see template
**disconnected.mirroring.oc_mirror.image_set.apiVersion** | The API version of the `ImageSetConfiguration` content. | `mirror.openshift.io/v1alpha2`, `mirror.openshift.io/v2alpha1`
**disconnected.mirroring.oc_mirror.image_set.storageConfig.enabled** | True or False to set whether oc-mirror is v1 or v2. As for v2 storageConfig flag is removed completely | `True` or `False`
**disconnected.mirroring.oc_mirror.image_set.storageConfig.registry.enabled** | True or False to use registry storage backend for pushing mirrored content directly to the registry. Currently only this backend is supported.| True
**disconnected.mirroring.oc_mirror.image_set.storageConfig.registry.imageURL.org** | The org part of registry imageURL from standard image set. | mirror
**disconnected.mirroring.oc_mirror.image_set.storageConfig.registry.imageURL.repo** | The repo part of registry imageURL from standard image set. Final imageURL will be as below: disconnected.registry.url/disconnected.mirroring.oc_mirror.image_set.storageConfig .registry.imageURL.org/disconnected...imageURL.repo | oc-mirror-metadata
Expand Down
44 changes: 24 additions & 20 deletions inventories/default/group_vars/disconnected.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Warning: currently, the oc-mirror plugin is officially downloadable to amd64 only.
disconnected:
enabled: False
enabled: false
registry:
url: 'registry url'
ip: 'registry reachable ip'
pull_secret: '' # this is similar to env.redhat.pull_secret but it will only contain secrets to be applied to the cluster in disconnected mode.
mirror_pull_secret: '' # this should contain a pull secret that contains the combination of env.redhat.pull_secret and pull secret with push access to mirror registry for mirroring

Check failure on line 8 in inventories/default/group_vars/disconnected.yaml

View workflow job for this annotation

GitHub Actions / Ansible_Lint

yaml[line-length]

Line too long (185 > 160 characters)
ca_trusted: False
ca_trusted: false
ca_cert: |
-----BEGIN CERTIFICATE-----
if ca_trusted is False, then this ca will be added to mirror host anchors as well as to the install config of cluster
Expand All @@ -16,56 +17,59 @@
ip: x.x.x.x
user: mirroruser # with become access
pass: mirrorpassword
file_server: # in disconnected mode, the client binaries and rhcos will be put on env.file_server and then downloaded to the final destination from there. For now, its only oc-mirror. Rest of artifacts will be downloaded from urls

Check failure on line 20 in inventories/default/group_vars/disconnected.yaml

View workflow job for this annotation

GitHub Actions / Ansible_Lint

yaml[line-length]

Line too long (234 > 160 characters)
clients_dir: 'clients'
oc_mirror_tgz: 'oc-mirror.tar.gz' # name of oc-mirror plugin binary in clients_dir. should be a tar.gz file. You must place this in your ftp server after downloading it yourself from https://console.redhat.com/openshift/downloads for amd64 (or building it yourself if your mirror host is s390x)

Check failure on line 22 in inventories/default/group_vars/disconnected.yaml

View workflow job for this annotation

GitHub Actions / Ansible_Lint

yaml[line-length]

Line too long (300 > 160 characters)
client_download: # this will download oc binary to the mirror host for use on the mirror host for mirroring
ocp_download_url: "https://mirror.openshift.com/pub/openshift-v4/multi/clients/ocp/4.13.1/amd64/"
ocp_client_tgz: 'openshift-client-linux.tar.gz' # name of the oc binary. Should be a tar.gz file
legacy:
platform: False # if true then platform is mirrored in the old way and install config will be patched with the imagecontentsourcepolicy
platform: false # if true then platform is mirrored in the old way and install config will be patched with the imagecontentsourcepolicy
ocp_quay_release_image_tag: '4.13.1-s390x'
ocp_org: 'ocp4'
ocp_repo: 'openshift4'
ocp_tag: 'v4.13.1' # platform images will be pushed to {tegistry_url}/{ocp_org}/{ocp_repo}:{ocp_tag}
oc_mirror:
oc_mirror_args:
continue_on_error: False
source_skip_tls: False
continue_on_error: false
source_skip_tls: false
post_mirror:
mapping:
replace:
enabled: False
enabled: false
list:
- regexp: what
replace: with
- regexp: what
replace: with
release_image_tag: '4.13.1-multi'
release_image_registry: 'brew.registry.redhat.io' # Update the release registry to use it as mirror registry for release operator images
image_set: # this field is a standard image set from oc-mirror documentation. The only exception is the storageConfig which is altered to allow substitution of disconnected.registry.url

Check failure on line 45 in inventories/default/group_vars/disconnected.yaml

View workflow job for this annotation

GitHub Actions / Ansible_Lint

yaml[line-length]

Line too long (191 > 160 characters)
apiVersion: mirror.openshift.io/v2alpha1 # update the version with v2alpha1 for oc-mirror v2 plugin and v1alpha2 for v1 plugin
storageConfig:
enable: false # enable this flag if oc-mirror v1 plugin is used since storageConfig is removed for v2 plugin
registry:
enabled: True # use registry storage backend. Currently only method supproted
enabled: true # use registry storage backend. Currently only method supproted
imageURL: # the final value will be {imageURL: disconnected.registry.url/org/repo}
org: mirror
repo: oc-mirror-metadata
skipTLS: false # standard field form oc-mirror schema
mirror: # this field is also atandard from the oc-mirror schema. It will be substituted as is into the final image set.
platform:
architectures:
- multi # note: while image tags such as `multi-s390x` are also available on quay, we cannot mirror these, so list can only contain pure architecture names such as `s390x` or the multiarch `multi`
- multi # note: while image tags such as `multi-s390x` are also available on quay, we cannot mirror these, so list can only contain pure architecture names such as `s390x` or the multiarch `multi`

Check failure on line 58 in inventories/default/group_vars/disconnected.yaml

View workflow job for this annotation

GitHub Actions / Ansible_Lint

yaml[line-length]

Line too long (210 > 160 characters)
channels:
- name: stable-4.13
full: false
minVersion: 4.13.1
maxVersion: 4.13.1
- name: stable-4.13
full: false
minVersion: 4.13.1
maxVersion: 4.13.1
operators:
- catalog: registry.redhat.io/redhat/redhat-operator-index:v4.13
full: false
packages:
- name: serverless-operator
channels:
- name: stable
#minVersion: '2.4.1-0'
#maxVersion: '2.4.1-0'
- name: serverless-operator
channels:
- name: stable
# minVersion: '2.4.1-0'
# maxVersion: '2.4.1-0'
additionalImages:
- name: registry.redhat.io/ubi8/ubi:latest
- name: registry.redhat.io/ubi8/ubi:latest
helm: {}
4 changes: 3 additions & 1 deletion roles/disconnected_check_vars/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: 'Check mandatory variables are defined for disconnected'
block:
- name: "check mandatory variables for disconnected are set"
assert:
ansible.builtin.assert:
that:
- disconnected.registry.url is defined and disconnected.registry.url != None
- disconnected.registry.pull_secret is defined and disconnected.registry.pull_secret != None
Expand All @@ -17,3 +17,5 @@
- disconnected.mirroring.client_download.ocp_download_url is defined and disconnected.mirroring.client_download.ocp_download_url != None
- disconnected.mirroring.client_download.ocp_client_tgz is defined and disconnected.mirroring.client_download.ocp_client_tgz != None
- disconnected.mirroring.oc_mirror.image_set is defined and disconnected.mirroring.oc_mirror.image_set != None
- disconnected.mirroring.oc_mirror.image_set.apiVersion is defined and disconnected.mirroring.oc_mirror.image_set.apiVersion != None
- disconnected.mirroring.oc_mirror.image_set.storageConfig.registry.enabled is defined and disconnected.mirroring.oc_mirror.image_set.storageConfig.registry.enabled != None

Check failure on line 21 in roles/disconnected_check_vars/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / Ansible_Lint

yaml[line-length]

Line too long (182 > 160 characters)
Loading