From 99ecafd3cee2ce4593105129241285c295e4484a Mon Sep 17 00:00:00 2001 From: Marius Cornea Date: Tue, 29 May 2018 12:35:29 -0400 Subject: [PATCH] Add ceph minor update step This change adds the step required for running ceph minor update with ceph-ansible during the minor update workflow. Change-Id: I6503f146e31836ed38bf5220149edd73c7f3297a --- tasks/update/ceph_update_run.yml | 15 ++++++++++++ .../create-overcloud-update-scripts.yaml | 7 ++++++ tasks/update/main.yml | 4 ++++ templates/ceph-update-run.sh.j2 | 24 +++++++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 tasks/update/ceph_update_run.yml create mode 100644 templates/ceph-update-run.sh.j2 diff --git a/tasks/update/ceph_update_run.yml b/tasks/update/ceph_update_run.yml new file mode 100644 index 00000000..3c1e2d57 --- /dev/null +++ b/tasks/update/ceph_update_run.yml @@ -0,0 +1,15 @@ +--- +- name: run Ceph minor update + shell: | + {{ working_dir }}/ceph-update-run.sh &> {{ working_dir }}/ceph-update-run.log + ignore_errors: true + register: ceph_update_status + +- block: + - name: print Ceph update failures + command: tail {{ working_dir }}/ceph-update-run.log + + - name: fail Ceph update + fail: + msg: Ceph minor update failed + when: ceph_update_status|failed diff --git a/tasks/update/create-overcloud-update-scripts.yaml b/tasks/update/create-overcloud-update-scripts.yaml index e92e01eb..fd84e20f 100644 --- a/tasks/update/create-overcloud-update-scripts.yaml +++ b/tasks/update/create-overcloud-update-scripts.yaml @@ -68,5 +68,12 @@ mode: 0755 force: true +- name: create ceph update script + template: + src: "ceph-update-run.sh.j2" + dest: "{{ working_dir }}/ceph-update-run.sh" + mode: 0755 + force: true + - name: create nova actions check script include: ../common/create_nova_actions_check_script.yml diff --git a/tasks/update/main.yml b/tasks/update/main.yml index bbc3a1e9..f0ca9049 100644 --- a/tasks/update/main.yml +++ b/tasks/update/main.yml @@ -72,6 +72,10 @@ bash {{ post_overcloud_update_run_workarounds_script }} &> {{ working_dir }}/post_overcloud_update_run_workarounds.log when: updates_workarounds|bool + - name: update Ceph + include: ceph_update_run.yml + when: ceph_osd_enabled|bool + - name: apply pre overcloud update converge workarounds command: "{{working_dir}}/pre_overcloud_update_converge_workarounds.sh" when: updates_workarounds diff --git a/templates/ceph-update-run.sh.j2 b/templates/ceph-update-run.sh.j2 new file mode 100644 index 00000000..28f520da --- /dev/null +++ b/templates/ceph-update-run.sh.j2 @@ -0,0 +1,24 @@ +#!/bin/env bash +set -euo pipefail + +source {{ undercloud_rc }} + +echo "[$(date)] Started Ceph minor update step" + +openstack overcloud ceph-upgrade run \ + --templates {{ tht_directory }} \ + --stack {{ overcloud_stack_name }} \ + {% if initial_env_file is defined and initial_env_file.stdout_lines|length > 0 %} + {% for _env in initial_env_file.stdout_lines %} + -e {{ _env }} \ + {% endfor %} + {% endif %} + {% if cli_converted_options|default(false)|bool %} + -e {{working_dir}}/cli_opts_params.yaml \ + {% endif %} + {% if tripleo_upgrade_validations_non_fatal|bool %} + --validation-errors-nonfatal \ + {% endif %} + --container-registry-file {{ working_dir }}/{{ container_registry_file }} \ + +echo "[$(date)] Finished CEPH minor update"