From d224d4150a4d65aff76e9503d1d1830c98b47b50 Mon Sep 17 00:00:00 2001 From: Lukas Bezdicka Date: Thu, 20 Aug 2020 12:37:48 +0200 Subject: [PATCH] [FFWD Ceph] Fix ceph post_upgrade_tasks for osd options Add missing post_upgrade_tasks shared from the ceph-base. Move post_upgrade_tasks that set noout options of ceph to only the ceph osd service as they are targeted for this service. Move the set nooout options out of system_upgrade tags so they run only after full upgrade run with deployment so the podman is already present on the nodes. Resolves: rhbz#1870617 Change-Id: I738d5c8cdd57b02589c147f5891cf8cb0e395d3a (cherry picked from commit a9be4c6a38e297bb9bd35b5ca868cfed6cd0b666) --- deployment/ceph-ansible/ceph-base.yaml | 47 +------------------------- deployment/ceph-ansible/ceph-mds.yaml | 1 + deployment/ceph-ansible/ceph-mon.yaml | 1 + deployment/ceph-ansible/ceph-osd.yaml | 45 ++++++++++++++++++++++++ deployment/ceph-ansible/ceph-rgw.yaml | 1 + 5 files changed, 49 insertions(+), 46 deletions(-) diff --git a/deployment/ceph-ansible/ceph-base.yaml b/deployment/ceph-ansible/ceph-base.yaml index 1a044b130b..1a3a4a029e 100644 --- a/deployment/ceph-ansible/ceph-base.yaml +++ b/deployment/ceph-ansible/ceph-base.yaml @@ -591,52 +591,7 @@ outputs: when: - step|int == 1 - ansible_distribution_major_version == '8' - - - block: - - name: Check for docker cli - stat: - path: "/var/run/docker.sock" - register: check_docker_cli - check_mode: false - - name: Set noout flag - shell: "{{ container_client }} exec -u root ceph-mon-${HOSTNAME} ceph osd set {{ item }}" - become: true - with_items: - - noout - - norecover - - nobackfill - - norebalance - - nodeep-scrub - vars: - container_client: |- - {% set container_client = 'podman' %} - {% if check_docker_cli.stat.exists|bool %} - {% set container_client = 'docker' %} - {% endif %} - {{ container_client }} - delegate_to: "{{ ceph_mon_short_bootstrap_node_name }}" - tags: - - never - - system_upgrade - - system_upgrade_prepare - when: - - step|int == 1 - - upgrade_leapp_enabled - post_upgrade_tasks: - - name: Unset noout flag - shell: "{{ container_cli }} exec -u root ceph-mon-${HOSTNAME} ceph osd unset {{ item }}" - with_items: - - noout - - norecover - - nobackfill - - norebalance - - nodeep-scrub - when: step|int == 2 - become: true - delegate_to: "{{ ceph_mon_short_bootstrap_node_name }}" - tags: - - never - - system_upgrade + post_upgrade_tasks: [] puppet_config: config_image: '' config_volume: '' diff --git a/deployment/ceph-ansible/ceph-mds.yaml b/deployment/ceph-ansible/ceph-mds.yaml index e46fcb5cd4..aefdc1826e 100644 --- a/deployment/ceph-ansible/ceph-mds.yaml +++ b/deployment/ceph-ansible/ceph-mds.yaml @@ -62,6 +62,7 @@ outputs: value: service_name: ceph_mds upgrade_tasks: {get_attr: [CephBase, role_data, upgrade_tasks]} + post_upgrade_tasks: {get_attr: [CephBase, role_data, post_upgrade_tasks]} puppet_config: config_image: '' config_volume: '' diff --git a/deployment/ceph-ansible/ceph-mon.yaml b/deployment/ceph-ansible/ceph-mon.yaml index 4c76158f46..a2c1dbfc9e 100644 --- a/deployment/ceph-ansible/ceph-mon.yaml +++ b/deployment/ceph-ansible/ceph-mon.yaml @@ -70,6 +70,7 @@ outputs: value: service_name: ceph_mon upgrade_tasks: {get_attr: [CephBase, role_data, upgrade_tasks]} + post_upgrade_tasks: {get_attr: [CephBase, role_data, post_upgrade_tasks]} puppet_config: config_image: '' config_volume: '' diff --git a/deployment/ceph-ansible/ceph-osd.yaml b/deployment/ceph-ansible/ceph-osd.yaml index 597663ca47..eabf9f5f3c 100644 --- a/deployment/ceph-ansible/ceph-osd.yaml +++ b/deployment/ceph-ansible/ceph-osd.yaml @@ -76,6 +76,51 @@ outputs: tags: validation when: step|int == 0 shell: test "nil" == "$(hiera -c /etc/puppet/hiera.yaml ceph::profile::params::osds)" + + - block: + - name: Check for docker cli + stat: + path: "/var/run/docker.sock" + register: check_docker_cli + check_mode: false + - name: Set noout flag + shell: "{{ container_client }} exec -u root ceph-mon-${HOSTNAME} ceph osd set {{ item }}" + become: true + with_items: + - noout + - norecover + - nobackfill + - norebalance + - nodeep-scrub + vars: + container_client: |- + {% set container_client = 'podman' %} + {% if check_docker_cli.stat.exists|bool %} + {% set container_client = 'docker' %} + {% endif %} + {{ container_client }} + delegate_to: "{{ ceph_mon_short_bootstrap_node_name }}" + tags: + - never + - system_upgrade + - system_upgrade_prepare + when: + - step|int == 1 + - upgrade_leapp_enabled + post_upgrade_tasks: + list_concat: + - {get_attr: [CephBase, role_data, post_upgrade_tasks]} + - - name: Unset noout flag + shell: "{{ container_cli }} exec -u root ceph-mon-${HOSTNAME} ceph osd unset {{ item }}" + with_items: + - noout + - norecover + - nobackfill + - norebalance + - nodeep-scrub + when: step|int == 2 + become: true + delegate_to: "{{ ceph_mon_short_bootstrap_node_name }}" puppet_config: config_image: '' config_volume: '' diff --git a/deployment/ceph-ansible/ceph-rgw.yaml b/deployment/ceph-ansible/ceph-rgw.yaml index dee67a0649..b49748fb8f 100644 --- a/deployment/ceph-ansible/ceph-rgw.yaml +++ b/deployment/ceph-ansible/ceph-rgw.yaml @@ -121,6 +121,7 @@ outputs: - ResellerAdmin - swiftoperator upgrade_tasks: {get_attr: [CephBase, role_data, upgrade_tasks]} + post_upgrade_tasks: {get_attr: [CephBase, role_data, post_upgrade_tasks]} puppet_config: config_image: '' config_volume: ''