|
| 1 | +--- |
| 2 | +# Copyright Red Hat, Inc. |
| 3 | +# All Rights Reserved. |
| 4 | +# |
| 5 | +# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 6 | +# not use this file except in compliance with the License. You may obtain |
| 7 | +# a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | +# License for the specific language governing permissions and limitations |
| 15 | +# under the License. |
| 16 | + |
| 17 | +- name: Get current openstackclient image |
| 18 | + environment: |
| 19 | + KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" |
| 20 | + PATH: "{{ cifmw_path }}" |
| 21 | + ansible.builtin.shell: > |
| 22 | + oc get pod -n {{ cifmw_update_namespace }} openstackclient |
| 23 | + --output=jsonpath='{.spec.containers[0].image}' |
| 24 | + register: cifmw_openstack_client_image |
| 25 | + changed_when: false |
| 26 | + |
| 27 | +- name: Get OpenStackVersion name |
| 28 | + environment: |
| 29 | + KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" |
| 30 | + PATH: "{{ cifmw_path }}" |
| 31 | + ansible.builtin.shell: > |
| 32 | + oc get openstackversion -n {{ cifmw_update_namespace }} |
| 33 | + --output=jsonpath='{.items[0].metadata.name}' |
| 34 | + register: cifmw_openstack_version_name |
| 35 | + changed_when: false |
| 36 | + |
| 37 | +- name: Patch openstackversion CR to keep old openstackclient pod running |
| 38 | + kubernetes.core.k8s: |
| 39 | + state: patched |
| 40 | + kind: OpenStackVersion |
| 41 | + api_version: core.openstack.org/v1beta1 |
| 42 | + kubeconfig: "{{ cifmw_openshift_kubeconfig }}" |
| 43 | + name: "{{ cifmw_openstack_version_name.stdout }}" |
| 44 | + namespace: "{{ cifmw_update_namespace }}" |
| 45 | + definition: |
| 46 | + spec: |
| 47 | + customContainerImages: |
| 48 | + openstackClientImage: "{{ cifmw_openstack_client_image.stdout }}" |
0 commit comments