rolling_update: fix upgrade when using fqdn

CLusters that were deployed using 'mon_use_fqdn' have a different unit
name, so during the upgrade this must be used otherwise the upgrade will
fail, looking for a unit that does not exist.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1597516
Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 44d0da0dd4)
pull/3266/head v3.1.10
Sébastien Han 2018-08-09 11:32:53 +02:00 committed by mergify[bot]
parent 7c9699ad51
commit d814644c4a
1 changed files with 13 additions and 3 deletions

View File

@ -107,11 +107,21 @@
- containerized_deployment - containerized_deployment
- mon_host_count | int == 1 - mon_host_count | int == 1
- name: stop ceph mon - name: stop ceph mon - shortname
systemd: systemd:
name: ceph-mon@{{ ansible_hostname }} name: ceph-mon@{{ ansible_hostname }}
state: stopped state: stopped
enabled: yes enabled: yes
ignore_errors: True
when:
- not containerized_deployment
- name: stop ceph mon - fqdn
systemd:
name: ceph-mon@{{ ansible_fqdn }}
state: stopped
enabled: yes
ignore_errors: True
when: when:
- not containerized_deployment - not containerized_deployment
@ -125,7 +135,7 @@
post_tasks: post_tasks:
- name: start ceph mon - name: start ceph mon
systemd: systemd:
name: ceph-mon@{{ ansible_hostname }} name: ceph-mon@{{ monitor_name }}
state: started state: started
enabled: yes enabled: yes
when: when:
@ -133,7 +143,7 @@
- name: restart containerized ceph mon - name: restart containerized ceph mon
systemd: systemd:
name: ceph-mon@{{ ansible_hostname }} name: ceph-mon@{{ monitor_name }}
state: restarted state: restarted
enabled: yes enabled: yes
daemon_reload: yes daemon_reload: yes