Skip to content

[disconnected] Create hook to configure disconnected cluster#3814

Merged
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
drosenfe:disconnectedhook
Jun 17, 2026
Merged

[disconnected] Create hook to configure disconnected cluster#3814
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
drosenfe:disconnectedhook

Conversation

@drosenfe

@drosenfe drosenfe commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

Create a hook to configure openshift cluster for disconnected deployment. The hook should execute after the cluster is deployed but before openstack is deployed.

jira: https://redhat.atlassian.net/browse/OSPRH-21316

Signed-off-by: David Rosenfeld drosenfe@redhat.com

@drosenfe drosenfe marked this pull request as draft March 30, 2026 14:02
@softwarefactory-project-zuul

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/3bfbd3399c6a4ba885dea99111ee34ba

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 13m 20s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 24m 06s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 30m 46s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 00m 26s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 48s
cifmw-pod-pre-commit FAILURE in 8m 03s

Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml Outdated
Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml Outdated
Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml Outdated
Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml Outdated
Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml Outdated
Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml Outdated
Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml Outdated
Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml Outdated
Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml Outdated
@softwarefactory-project-zuul

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/a9418611826d43ccbda9dbdbbe8f99a3

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 10m 37s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 25m 30s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 28m 26s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 1h 57m 28s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 13s
cifmw-pod-pre-commit FAILURE in 8m 01s

@slagle slagle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll also need another task to login the dataplane nodes to the mirror registry. you can add this to edpm_container_registry_logins somewhere.

Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml Outdated
Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml Outdated
@softwarefactory-project-zuul

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/68ec32cda5c9495bb05bbd86f98bb58d

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 17m 30s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 23m 52s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 29m 00s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 03m 13s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 56s
cifmw-pod-pre-commit FAILURE in 8m 16s

@softwarefactory-project-zuul

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/3baa9443fe84436d94eb8f62bc6e270b

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 21m 04s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 25m 53s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 31m 59s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 07m 29s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 10m 41s
cifmw-pod-pre-commit FAILURE in 9m 43s

@softwarefactory-project-zuul

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/b7f6831c3a38441e8b31d359cb133524

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 26m 40s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 32m 06s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 30m 30s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 02m 14s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 34s
cifmw-pod-pre-commit FAILURE in 8m 11s

@softwarefactory-project-zuul

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/749f1d93ae1948dc838dbe448b531af2

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 15m 20s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 24m 12s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 29m 53s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 02m 58s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 45s
cifmw-pod-pre-commit FAILURE in 10m 03s

@softwarefactory-project-zuul

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/79903bc23f894b8b8233fa0880a098ee

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 16m 06s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 27m 24s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 28m 28s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 03m 08s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 42s
cifmw-pod-pre-commit FAILURE in 10m 39s

@softwarefactory-project-zuul

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/d3c2d308a96844728a4c40a91fe44dbe

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 19m 03s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 22m 10s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 28m 19s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 05m 41s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 28s
cifmw-pod-pre-commit FAILURE in 8m 22s

@softwarefactory-project-zuul

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/fa733e9d790e41f1b516d2829414f210

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 06m 55s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 22m 47s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 33m 48s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 1h 53m 49s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 06s
cifmw-pod-pre-commit FAILURE in 8m 15s

@softwarefactory-project-zuul

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/6c682e2aa4c346d1a5abb87786fcb26a

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 20m 44s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 23m 30s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 33m 42s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 07m 53s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 04s
cifmw-pod-pre-commit FAILURE in 5m 10s

@TristanCacqueray

Copy link
Copy Markdown
Contributor

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdo/buildset/31d9170de91241159fc81002c14630eb

✔️ openstack-k8s-operators-content-provider SUCCESS in 13m 32s
podified-multinode-edpm-deployment-crc RETRY_LIMIT in 29s
cifmw-crc-podified-edpm-baremetal RETRY_LIMIT in 29s
cifmw-crc-podified-edpm-baremetal-minor-update RETRY_LIMIT in 29s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 41s
cifmw-pod-pre-commit FAILURE in 7m 51s

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdo/buildset/43c7c605d9314c4dbf5c81c82fec5cd5

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 40m 33s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 27m 33s
cifmw-crc-podified-edpm-baremetal RETRY_LIMIT in 34s
cifmw-crc-podified-edpm-baremetal-minor-update RETRY_LIMIT in 32s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 54s
cifmw-pod-pre-commit FAILURE in 9m 11s

@drosenfe

drosenfe commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

There are a couple of places where you do straightforward operations with the oc command, is it possible to use modules like kubernetes.core.k8s/kubernetes.core.k8s_info instead? I know that not all instances of ansible.builtin.shell + oc ... can be translated as such, but if I'm not mistaken, some of the simpler oc apply/patch/create commands could.

Additionally, do you have a jira you could link here? And if you have run this in a testproject, we would greatly appreciate if that were attached to the jira ticket / in the comments of that jira ticket.

Thanks!

@michburk looked at using module: kubernetes.core.k8s. The only line that was potentially supported was: oc apply -f {{ mirror_location }}/working-dir/cluster-resources. However, that is applying a directory rather than a file which the module kubernetes.core.k8s did not support. I believe all other comments were addressed. Are you OK with review now?

@michburk michburk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a couple of places where you do straightforward operations with the oc command, is it possible to use modules like kubernetes.core.k8s/kubernetes.core.k8s_info instead? I know that not all instances of ansible.builtin.shell + oc ... can be translated as such, but if I'm not mistaken, some of the simpler oc apply/patch/create commands could.
Additionally, do you have a jira you could link here? And if you have run this in a testproject, we would greatly appreciate if that were attached to the jira ticket / in the comments of that jira ticket.
Thanks!

@michburk looked at using module: kubernetes.core.k8s. The only line that was potentially supported was: oc apply -f {{ mirror_location }}/working-dir/cluster-resources. However, that is applying a directory rather than a file which the module kubernetes.core.k8s did not support. I believe all other comments were addressed. Are you OK with review now?

A couple more things, very sorry for not catching them on the first pass. It's generally considered best practice to avoid shell where possible and prefer more specific modules or ansible.builtin.command if we have to use shell-like commands and don't need pipes/&&/||/etc.

I do want to follow-up and ask, is it the case that the tasks
Create update service namespace, Create update service operator group, and Create subscription service for example can't be converted to use kubernetes.core.k8s? Very sorry if I'm missing something obvious here.

I'll keep an eye on this pr to try to be more responsive, sorry for not seeing your comment yesterday.

Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml Outdated
Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml Outdated
Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml Outdated
Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml Outdated
@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/f6e84389dea34ec5a8f0800ca7bf694f

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 17m 41s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 30m 22s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 44m 31s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 03m 44s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 46s
cifmw-pod-pre-commit FAILURE in 9m 16s

Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml
@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/6935b83e48944c4b9320539f389e6f9c

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 19m 06s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 26m 48s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 34m 19s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 06m 19s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 19s
cifmw-pod-pre-commit FAILURE in 8m 36s

@drosenfe

Copy link
Copy Markdown
Contributor Author

There are a couple of places where you do straightforward operations with the oc command, is it possible to use modules like kubernetes.core.k8s/kubernetes.core.k8s_info instead? I know that not all instances of ansible.builtin.shell + oc ... can be translated as such, but if I'm not mistaken, some of the simpler oc apply/patch/create commands could.
Additionally, do you have a jira you could link here? And if you have run this in a testproject, we would greatly appreciate if that were attached to the jira ticket / in the comments of that jira ticket.
Thanks!

@michburk looked at using module: kubernetes.core.k8s. The only line that was potentially supported was: oc apply -f {{ mirror_location }}/working-dir/cluster-resources. However, that is applying a directory rather than a file which the module kubernetes.core.k8s did not support. I believe all other comments were addressed. Are you OK with review now?

A couple more things, very sorry for not catching them on the first pass. It's generally considered best practice to avoid shell where possible and prefer more specific modules or ansible.builtin.command if we have to use shell-like commands and don't need pipes/&&/||/etc.

I do want to follow-up and ask, is it the case that the tasks Create update service namespace, Create update service operator group, and Create subscription service for example can't be converted to use kubernetes.core.k8s? Very sorry if I'm missing something obvious here.

I'll keep an eye on this pr to try to be more responsive, sorry for not seeing your comment yesterday.

Create update service namespace, Create update service operator group, and Create subscription service changed to use kubernetes.core.k8s in latest version.

@michburk michburk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a number of places where you use ansible.builtin.command as with the command string on a new line without a cmd parameter (picking a random example):

    - name: Wait until the OpenShift cluster is stable
      ansible.builtin.command:
        oc adm wait-for-stable-cluster --minimum-stable-period=5s --timeout=30m

where the following is preferred:

    - name: Wait until the OpenShift cluster is stable
      ansible.builtin.command:
        cmd: oc adm wait-for-stable-cluster --minimum-stable-period=5s --timeout=30m

Sorry for not catching this earlier, I suppose the first method has worked in your testing, but style-wise the command should either be on the same line as ansible.builtin.command i.e.

ansible.builtin.command: echo hi

or preceded by cmd: , i.e.

ansible.builtin.command:
  cmd: echo hi

really sorry if I'm dragging this along and not catching everything in earlier reviews, patch is generally looking good to me and I keep catching style nits. Sorry about that.

Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml Outdated
Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml
Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml
Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml
Comment thread hooks/playbooks/config_cluster_for_disconnected_deployment.yml
@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/d46db78c17974203986233c8d8f51f49

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 45m 45s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 31m 06s
cifmw-crc-podified-edpm-baremetal NODE_FAILURE Node(set) request 099-0000121008 failed in 0s
cifmw-crc-podified-edpm-baremetal-minor-update NODE_FAILURE Node(set) request 099-0000121009 failed in 0s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 50s
cifmw-pod-pre-commit FAILURE in 6m 42s

Create a hook to configure openshift cluster for disconnected
deployment. The hook should execute after the cluster is deployed
but before openstack is deployed.

jira: https://redhat.atlassian.net/browse/OSPRH-21316

Signed-off-by: David Rosenfeld drosenfe@redhat.com
@drosenfe

Copy link
Copy Markdown
Contributor Author

There are a number of places where you use ansible.builtin.command as with the command string on a new line without a cmd parameter (picking a random example):

    - name: Wait until the OpenShift cluster is stable
      ansible.builtin.command:
        oc adm wait-for-stable-cluster --minimum-stable-period=5s --timeout=30m

where the following is preferred:

    - name: Wait until the OpenShift cluster is stable
      ansible.builtin.command:
        cmd: oc adm wait-for-stable-cluster --minimum-stable-period=5s --timeout=30m

Sorry for not catching this earlier, I suppose the first method has worked in your testing, but style-wise the command should either be on the same line as ansible.builtin.command i.e.

ansible.builtin.command: echo hi

or preceded by cmd: , i.e.

ansible.builtin.command:
  cmd: echo hi

really sorry if I'm dragging this along and not catching everything in earlier reviews, patch is generally looking good to me and I keep catching style nits. Sorry about that.

cmd: added to all ansible.builtin.command: tasks.

@michburk michburk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@michburk

Copy link
Copy Markdown
Contributor

/approve

@openshift-ci

openshift-ci Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: michburk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot Bot merged commit 6cf0bf4 into openstack-k8s-operators:main Jun 17, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants