diff --git a/playbooks/update.yml b/playbooks/update.yml index 4aac37ccf7..8b318c4b41 100644 --- a/playbooks/update.yml +++ b/playbooks/update.yml @@ -11,11 +11,12 @@ ansible.builtin.include_role: name: repo_setup - - name: Update all openstack services containers env vars in meta operator with tag from delorean + - name: Update all openstack services containers env vars in meta operator with tag from delorean and update OPENSTACK_RELEASE_VERSION vars: cifmw_set_openstack_containers_dlrn_md5_path: "{{ cifmw_basedir }}/artifacts/repositories/delorean.repo.md5" cifmw_set_openstack_containers_tag_from_md5: true cifmw_set_openstack_containers_extra_vars: "{{ cifmw_edpm_prepare_extra_vars }}" + cifmw_set_openstack_containers_openstack_version_change: true ansible.builtin.include_role: name: set_openstack_containers diff --git a/roles/repo_setup/tasks/configure.yml b/roles/repo_setup/tasks/configure.yml index f61a0445c3..9bd9936da5 100644 --- a/roles/repo_setup/tasks/configure.yml +++ b/roles/repo_setup/tasks/configure.yml @@ -5,6 +5,7 @@ when: - content_provider_dlrn_md5_hash is defined - content_provider_dlrn_md5_hash | length > 0 + - (not cifmw_run_update|default(false)) or (update_playbook_run is defined and cifmw_run_update|default(false)) - name: Run repo-setup become: "{{ not cifmw_repo_setup_output.startswith(ansible_user_dir) }}" diff --git a/roles/update/README.md b/roles/update/README.md index 206ec78b16..4489c70341 100644 --- a/roles/update/README.md +++ b/roles/update/README.md @@ -3,5 +3,7 @@ Role to run update ## Parameters * ``cifmw_update_extras`: (hash) Hold job variable that get set when running the update playbook. +* ``cifmw_update_openstack_update_run_operators_updated`: (Bool) Set if openstack_update_run make target should not modify openstack-operator csv to fake openstack services container change. Default to true. +* ``cifmw_update_openstack_update_run_target_version`: (String) Define openstack target version to run update to. -## Examples +## Example diff --git a/roles/update/defaults/main.yml b/roles/update/defaults/main.yml index fcd6a64cdf..e0ccf80923 100644 --- a/roles/update/defaults/main.yml +++ b/roles/update/defaults/main.yml @@ -17,3 +17,8 @@ # All variables intended for modification should be placed in this file. # All variables within this role should have a prefix of "cifmw_update" + +cifmw_update_openstack_update_run_target_version: "0.0.2" +cifmw_update_openstack_update_run_operators_updated: true +cifmw_update_openstack_update_run_containers_namespace: "podified-antelope-centos9" +cifmw_update_openstack_update_run_containers_target_tag: "current-podified" diff --git a/roles/update/tasks/main.yml b/roles/update/tasks/main.yml index 8f0a38faa9..481bf009a2 100644 --- a/roles/update/tasks/main.yml +++ b/roles/update/tasks/main.yml @@ -14,9 +14,24 @@ # License for the specific language governing permissions and limitations # under the License. -- name: Hello World - ansible.builtin.debug: - msg: "Hello World from update" +- name: Set openstack_update_run Makefile environment variables + tags: + - always + ansible.builtin.set_fact: + _make_openstack_update_run_params: | + {% if not cifmw_update_openstack_update_run_operators_updated -%} + FAKE_UPDATE: true + CONTAINERS_NAMESPACE: {{ cifmw_update_openstack_update_run_containers_namespace }} + CONTAINERS_TARGET_TAG: {{ cifmw_update_openstack_update_run_containers_target_tag }} + OPENSTACK_VERSION: {{ cifmw_update_openstack_update_run_target_version }} + {% else -%} + OPENSTACK_VERSION: {{ cifmw_update_openstack_update_run_target_version }} + {% endif -%} -- name: Run update-csv tasks - ansible.builtin.include_tasks: update-csv.yml +- name: Run make openstack_update_run + vars: + make_openstack_update_run_env: "{{ cifmw_install_yamls_environment | combine({'PATH': cifmw_path }) }}" + make_openstack_update_run_params: "{{ _make_openstack_update_run_params | from_yaml }}" + ansible.builtin.include_role: + name: 'install_yamls_makes' + tasks_from: 'make_openstack_update_run' diff --git a/roles/update/tasks/update-csv.yml b/roles/update/tasks/update-csv.yml deleted file mode 100644 index e0e399d22d..0000000000 --- a/roles/update/tasks/update-csv.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -# 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