Merge "[Queens] Handle ceph service restart during update." into stable/queens

This commit is contained in:
Zuul 2021-01-07 23:44:47 +00:00 committed by Gerrit Code Review
commit b6514f1382
2 changed files with 40 additions and 2 deletions

View File

@ -60,6 +60,35 @@ outputs:
tags: validation
when: step|int == 0
shell: test "nil" == "$(hiera -c /etc/puppet/hiera.yaml ceph::profile::params::osds)"
update_tasks:
- name: Set noout flag
shell: "docker exec -u root ceph-mon-${HOSTNAME%%.*} ceph osd set {{ item }}"
become: true
with_items:
- noout
- norecover
- nobackfill
- norebalance
- nodeep-scrub
when:
- step|int == 1
- docker_rpm_needs_update
run_once: true
delegate_to: "{{ groups['ceph_mon']|first }}"
- name: Unset noout flag
shell: "docker exec -u root ceph-mon-${HOSTNAME%%.*} ceph osd unset {{ item }}"
become: true
with_items:
- noout
- norecover
- nobackfill
- norebalance
- nodeep-scrub
when:
- step|int == 4
- docker_rpm_needs_update
run_once: true
delegate_to: "{{ groups['ceph_mon']|first }}"
puppet_config:
config_image: ''
config_volume: ''

View File

@ -140,6 +140,7 @@ outputs:
when: step|int == 3
yum: name=docker state=latest
update_tasks:
- when: step|int == 0
block:
- name: Detect if puppet on the docker profile would restart the service
# Note that due to https://tickets.puppetlabs.com/browse/PUP-686 --noop
@ -162,6 +163,8 @@ outputs:
set_fact: docker_rpm_needs_update={{ docker_check_update.rc == 100 }}
- name: Set puppet_docker_is_outofsync fact
set_fact: puppet_docker_is_outofsync={{ puppet_docker_noop_output.stdout|trim|int >= 1 }}
- when: step|int == 2
block:
- name: Stop all containers except ceph or neutron side containers
# xargs is preferable to docker stop $(docker ps -q) as that might generate a
# a too long command line
@ -193,4 +196,10 @@ outputs:
register: puppet_docker_apply
failed_when: puppet_docker_apply.rc not in [0, 2]
changed_when: puppet_docker_apply.rc == 2
when: step|int == 2
- name: Ensure all ceph services are started
shell: |
systemctl --plain list-dependencies docker.service --reverse | \
egrep 'ceph|rbd' | xargs systemctl start
ignore_errors: true
when: docker_rpm_needs_update