rolling_update: fix pre and post osd upgrade play

when using --limit osds, the play before and after osd upgrade are
skipped because we use `hosts: "{{ mon_group_name | default('mons') }}[0]"`
using `hosts: "{{ osds_group_name | default('osds') }}" with
`delegate_to` to the first monitor addresses this issue.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit fc9f87c45f)
pull/6964/head
Guillaume Abrioux 2021-10-25 13:43:25 +02:00
parent e29defef7d
commit efc6979db5
1 changed files with 77 additions and 69 deletions

View File

@ -423,7 +423,7 @@
- name: set osd flags
hosts: "{{ mon_group_name | default('mons') }}[0]"
hosts: "{{ osd_group_name | default('osds') }}"
tags: osds
become: True
gather_facts: false
@ -434,16 +434,20 @@
name: ceph-facts
tasks_from: container_binary.yml
- name: set osd flags, disable autoscaler and balancer
run_once: true
delegate_to: "{{ groups[mon_group_name][0] }}"
block:
- name: get pool list
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool ls detail -f json"
register: pool_list
run_once: true
changed_when: false
check_mode: false
- name: get balancer module status
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer status -f json"
register: balancer_status_update
run_once: true
changed_when: false
check_mode: false
@ -562,7 +566,7 @@
- name: complete osd upgrade
hosts: "{{ mon_group_name|default('mons') }}[0]"
hosts: "{{ osd_group_name | default('osds') }}"
tags: osds
become: True
gather_facts: false
@ -573,6 +577,10 @@
name: ceph-facts
tasks_from: container_binary.yml
- name: unset osd flags, re-enable pg autoscaler and balancer
run_once: true
delegate_to: "{{ groups[mon_group_name][0] }}"
block:
- name: re-enable pg autoscale on pools
ceph_pool:
name: "{{ item.name }}"