Repository navigation
ci: Deploy the OpenStack Assistant #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
openshift-merge-bot
merged 1 commit into
openstack-k8s-operators:main
from
lpiwowar:ci/enable-openstack-assistant
Nov 10, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| --- | ||
| # Copyright Red Hat, Inc. | ||
| # All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
| # not use this file except in compliance with the License. You may obtain | ||
| # a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| # License for the specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| # A playbook that deploys OpenStack Assistant, designed to run as a | ||
| # ci-framework hook. The deployment uses the `make openstack_assistant` | ||
| # target from install_yamls. The prerequisites for successfully deploying | ||
| # OpenStackAssistant with this playbook are: | ||
| # | ||
| # 1. OpenStack is deployed. | ||
| # 2. OpenStack Lightspeed is deployed. | ||
| - name: Deploy OpenStack Assistant | ||
| hosts: "{{ cifmw_target_hook_host | default('localhost') }}" | ||
| connection: local | ||
| vars: | ||
| _openstack_lightspeed_namespace: "{{ cifmw_openstack_lightspeed_namespace | default('openstack-lightspeed') }}" | ||
| _openstack_assistant_namespace: "{{ openstack_assistant_namespace | default('openstack') }}" | ||
| _openstack_assistant_name: "{{ openstack_assistant_name | default('openstack-assistant') }}" | ||
| _openstack_assistant_client_name: "{{ openstack_assistant_client | default('openstackclient') }}" | ||
| _openstack_assistant_image: "{{ openstack_assistant_image | default('quay.io/openstack-s2i-containers/openstack-goose:master-latest') }}" | ||
| _openstack_assistant_model: "{{ openstack_assistant_model | default('') }}" | ||
| _openstack_assistant_lightspeed_url: "{{ openstack_assistant_lightspeed_url | default('https://lightspeed-app-server.' ~ _openstack_lightspeed_namespace ~ '.svc:8443/v1') }}" | ||
| _openstack_assistant_enabled: "{{ openstack_assistant_enabled | default(false) | bool }}" | ||
| _openstack_assistant_ready_retries: "{{ openstack_assistant_ready_retries | default(60) | int }}" | ||
| kubeconfig_path: "{{ cifmw_openshift_kubeconfig | default(ansible_env.HOME ~ '/.crc/machines/crc/kubeconfig') }}" | ||
| environment: | ||
| KUBECONFIG: "{{ kubeconfig_path }}" | ||
|
|
||
| tasks: | ||
| - name: Deploy OpenStack Assistant | ||
| when: _openstack_assistant_enabled | ||
| block: | ||
| - name: Deploy OpenStack Assistant via install_yamls | ||
| vars: | ||
| make_openstack_assistant_env: >- | ||
| {{ cifmw_install_yamls_environment | default({}) | | ||
| combine({ | ||
| 'PATH': cifmw_path | default(ansible_env.PATH), | ||
| 'KUBECONFIG': kubeconfig_path, | ||
| 'NAMESPACE': _openstack_assistant_namespace, | ||
| 'LIGHTSPEED_NAMESPACE': _openstack_lightspeed_namespace, | ||
| 'OPENSTACK_ASSISTANT_NAME': _openstack_assistant_name, | ||
| 'OPENSTACK_ASSISTANT_IMAGE': _openstack_assistant_image, | ||
| 'OPENSTACK_ASSISTANT_MODEL': _openstack_assistant_model, | ||
| 'OPENSTACK_ASSISTANT_CLIENT': _openstack_assistant_client_name, | ||
| 'OPENSTACK_ASSISTANT_LIGHTSPEED_URL': _openstack_assistant_lightspeed_url, | ||
| }) }} | ||
| make_openstack_assistant_retries: 3 | ||
| make_openstack_assistant_delay: 60 | ||
| make_openstack_assistant_until: "make_openstack_assistant_status is not failed" | ||
| ansible.builtin.include_role: | ||
| name: install_yamls_makes | ||
| tasks_from: make_openstack_assistant | ||
|
|
||
| - name: Wait for OpenStackAssistant CR to be ready | ||
| kubernetes.core.k8s_info: | ||
| api_version: assistant.openstack.org/v1beta1 | ||
| kind: OpenStackAssistant | ||
| name: "{{ _openstack_assistant_name }}" | ||
| namespace: "{{ _openstack_assistant_namespace }}" | ||
| register: assistant_status | ||
| until: | ||
| - assistant_status.resources is defined | ||
| - assistant_status.resources | length > 0 | ||
| - assistant_status.resources[0].status is defined | ||
| - assistant_status.resources[0].status.conditions is defined | ||
| - assistant_status.resources[0].status.conditions | selectattr('type', 'equalto', 'Ready') | map(attribute='status') | select('equalto', 'True') | list | | ||
| length > 0 | ||
| retries: "{{ _openstack_assistant_ready_retries }}" | ||
| delay: 10 | ||
|
|
||
| - name: Verify OpenStack Assistant (goose) pod is running | ||
| kubernetes.core.k8s_info: | ||
| api_version: v1 | ||
| kind: Pod | ||
| namespace: "{{ _openstack_assistant_namespace }}" | ||
| label_selectors: | ||
| - "service=openstackassistant" | ||
| register: assistant_pods | ||
| until: | ||
| - assistant_pods.resources is defined | ||
| - assistant_pods.resources | length > 0 | ||
| - assistant_pods.resources | map(attribute='status.phase') | select('equalto', 'Running') | list | length > 0 | ||
| retries: "{{ _openstack_assistant_ready_retries }}" | ||
| delay: 10 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.