set_fact:
mon_host: "{{ groups[mon_group_name] | difference([inventory_hostname]) | last }}"
+ # NOTE: we mask the service so the RPM can't restart it
+ # after the package gets upgraded
- name: stop ceph mon - shortname
systemd:
name: ceph-mon@{{ ansible_hostname }}
state: stopped
- enabled: yes
+ enabled: no
+ masked: yes
ignore_errors: True
when:
- not containerized_deployment
+ # NOTE: we mask the service so the RPM can't restart it
+ # after the package gets upgraded
- name: stop ceph mon - fqdn
systemd:
name: ceph-mon@{{ ansible_fqdn }}
state: stopped
- enabled: yes
+ enabled: no
+ masked: yes
ignore_errors: True
when:
- not containerized_deployment
- - name: stop ceph mgr
+ # only mask the service for mgr because it must be upgraded
+ # after ALL monitors, even when collocated
+ - name: mask the mgr service
systemd:
name: ceph-mgr@{{ ansible_hostname }}
- state: stopped
- enabled: yes
- ignore_errors: True # if no mgr collocated with mons
+ masked: yes
when:
- - not containerized_deployment
+ - inventory_hostname in groups[mgr_group_name]
+ or groups[mgr_group_name] | length == 0
- import_role:
name: ceph-defaults
when:
- containerized_deployment
- - name: restart containerized ceph mgr
- systemd:
- name: ceph-mgr@{{ monitor_name }}
- state: restarted
- enabled: yes
- daemon_reload: yes
- ignore_errors: True # if no mgr collocated with mons
- when:
- - containerized_deployment
-
- name: non container | waiting for the monitor to join the quorum...
command: ceph --cluster "{{ cluster }}" -s --format json
register: ceph_health_raw
systemd:
name: ceph-mgr@{{ ansible_hostname }}
state: stopped
- enabled: yes
+ enabled: no
+ masked: yes
failed_when: false
when:
- not containerized_deployment
- import_role:
name: ceph-mgr
- - name: start ceph mgr
- systemd:
- name: ceph-mgr@{{ ansible_hostname }}
- state: started
- enabled: yes
- when:
- - not containerized_deployment
-
- - name: restart containerized ceph mgr
- systemd:
- name: ceph-mgr@{{ ansible_hostname }}
- state: restarted
- enabled: yes
- daemon_reload: yes
- when:
- - containerized_deployment
-
- name: upgrade ceph osds cluster
vars:
systemd:
name: ceph-osd@{{ item }}
state: stopped
- enabled: yes
+ enabled: no
+ masked: yes
with_items: "{{ osd_ids.stdout_lines }}"
when:
- not containerized_deployment
name: ceph-osd@{{ item }}
state: started
enabled: yes
+ masked: no
with_items: "{{ osd_ids.stdout_lines }}"
when:
- not containerized_deployment
name: "{{ item }}"
state: restarted
enabled: yes
+ masked: no
daemon_reload: yes
with_items: "{{ osd_names.stdout_lines }}"
when:
systemd:
name: ceph-mds@{{ ansible_hostname }}
state: stopped
- enabled: yes
+ enabled: no
+ masked: yes
when:
- not containerized_deployment
name: ceph-mds@{{ ansible_hostname }}
state: started
enabled: yes
+ masked: no
when:
- not containerized_deployment
name: ceph-mds@{{ ansible_hostname }}
state: restarted
enabled: yes
+ masked: no
daemon_reload: yes
when:
- containerized_deployment
systemd:
name: ceph-radosgw@rgw.{{ ansible_hostname }}
state: stopped
- enabled: yes
+ enabled: no
+ masked: yes
when:
- not containerized_deployment
name: ceph-radosgw@rgw.{{ ansible_hostname }}
state: started
enabled: yes
+ masked: no
when:
- not containerized_deployment
name: ceph-radosgw@rgw.{{ ansible_hostname }}.{{ item.instance_name }}
state: restarted
enabled: yes
+ masked: no
daemon_reload: yes
with_items: "{{ rgw_instances }}"
when:
systemd:
name: "ceph-rbd-mirror@rbd-mirror.{{ ansible_hostname }}"
state: stopped
- enabled: yes
+ enabled: no
+ masked: yes
failed_when: false
- import_role:
name: "ceph-rbd-mirror@rbd-mirror.{{ ansible_hostname }}"
state: started
enabled: yes
+ masked: no
when:
- not containerized_deployment
name: ceph-rbd-mirror@rbd-mirror.{{ ansible_hostname }}
state: restarted
enabled: yes
+ masked: no
daemon_reload: yes
when:
- containerized_deployment
systemd:
name: nfs-ganesha
state: stopped
- enabled: yes
+ enabled: no
+ masked: yes
failed_when: false
when:
- not containerized_deployment
name: nfs-ganesha
state: started
enabled: yes
+ masked: no
when:
- not containerized_deployment
- ceph_nfs_enable_service
name: ceph-nfs@{{ ceph_nfs_service_suffix | default(ansible_hostname) }}
state: restarted
enabled: yes
+ masked: no
daemon_reload: yes
when:
- ceph_nfs_enable_service
systemd:
name: rbd-target-gw
state: stopped
- enabled: yes
+ enabled: no
+ masked: yes
failed_when: false
when:
- not containerized_deployment
name: rbd-target-gw
state: started
enabled: yes
+ masked: no
when:
- not containerized_deployment