ibm-mas/ansible-airgap

Support ibm-pak in place of cloudctl

Closed this issue · 0 comments

Ref: https://github.com/IBM/ibm-pak-plugin#overview

There'll be changes in case_prepare and case_mirror to achieve this, and at this point, we may even fold them into a single role perhaps seeing as ibm-pak is doing much of the prep for us now.

ibm-pak doesn't offer a built-in replacement for the excluded_images capability in our automation, so we'll need to retain some post-processing.

This should be a relatively straight-forward change. If we keep the roles as they are today it would be only a patch change, as we're not really changing anything about how the user interacts, if we go for a bigger change and consolidate the roles then it needs to be a major.

Example

Install

curl -L https://github.com/IBM/ibm-pak-plugin/releases/download/v1.2.0/oc-ibm_pak-linux-amd64.tar.gz -o oc-ibm_pak-linux-amd64.tar.gz
tar -xvf oc-ibm_pak-linux-amd64.tar.gz
mv oc-ibm_pak-linux-amd64 ~/bin/oc-ibm_pak

Prepare For Mirror

oc ibm-pak get ibm-mas --version 8.8.0
oc ibm-pak generate mirror-manifests ibm-mas $TARGET_REGISTRY --version 8.8.0

Mirror

Maybe we could do this in a loop in ansible (processing the same file) for better feedback to the user instead of launching a command that basically offers no status (in ansible) until it finishes, which could be hours!

oc image mirror \
  -f ~/.ibm-pak/data/mirror/$CASE_NAME/$CASE_VERSION/images-mapping.txt \
  --filter-by-os '.*'  \
  -a $REGISTRY_AUTH_FILE \
  --insecure  \
  --skip-multiple-scopes \
  --max-per-registry=1

When we do this, maybe we also look at supporting the mirror to filesystem / mirror from filesystem paradigm as well, we are focused on the bastion model for our initial Air gap launch