diff --git a/roles/update/tasks/main.yml b/roles/update/tasks/main.yml index f1d1ba7c3d..8f0a38faa9 100644 --- a/roles/update/tasks/main.yml +++ b/roles/update/tasks/main.yml @@ -17,3 +17,6 @@ - name: Hello World ansible.builtin.debug: msg: "Hello World from update" + +- name: Run update-csv tasks + ansible.builtin.include_tasks: update-csv.yml diff --git a/roles/update/tasks/update-csv.yml b/roles/update/tasks/update-csv.yml new file mode 100644 index 0000000000..e0e399d22d --- /dev/null +++ b/roles/update/tasks/update-csv.yml @@ -0,0 +1,34 @@ +--- +# 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. + +- name: Save current csv for openstack-operator + ansible.builtin.shell: + cmd: >- + oc get csv openstack-operator.v0.0.1 -o yaml -n openstack-operators > csv.yaml + +- name: Get OpenStackVersion + kubernetes.core.k8s_info: + kubeconfig: "{{ cifmw_openshift_kubeconfig }}" + api_key: "{{ cifmw_openshift_token | default(omit) }}" + context: "{{ cifmw_openshift_context | default(omit) }}" + kind: OpenStackVersion + namespace: openstack-operators + register: osv_info + +- name: Print return information from OpenStackVersion + ansible.builtin.debug: + var: osv_info + verbosity: 2