- set_fact: rolling_update=true
- - name: check if sysvinit
- stat:
- path: /etc/rc?.d/S??ceph
- follow: yes
- register: is_sysvinit
-
- - name: check if upstart
- stat:
- path: /var/lib/ceph/mon/ceph-{{ ansible_hostname }}/upstart
- register: is_upstart
-
- - name: check if systemd
- command: grep -sq systemd /proc/1/comm
- register: is_systemd
-
-
- name: upgrade ceph mon cluster
vars:
name: ceph-mon
state: stopped
args: id={{ ansible_hostname }}
- when: is_upstart.stat.exists == True
+ when: ansible_service_mgr == 'systemd'
- name: stop ceph mons with sysvinit
service:
name: ceph
state: stopped
- when: is_sysvinit.stat.exists == True
+ when: ansible_service_mgr == 'sysvinit'
- name: stop ceph mons with systemd
service:
state: stopped
enabled: yes
when:
- - is_systemd
+ - ansible_service_mgr == 'systemd'
- not mon_containerized_deployment
roles:
name: ceph-mon
state: started
args: id={{ ansible_hostname }}
- when: is_upstart.stat.exists == True
+ when: ansible_service_mgr == 'upstart'
- name: start ceph mons with sysvinit
service:
name: ceph
state: started
- when: is_sysvinit.stat.exists == True
+ when: ansible_service_mgr == 'sysvinit'
- name: start ceph mons with systemd
service:
state: started
enabled: yes
when:
- - is_systemd
+ - ansible_service_mgr == 'systemd'
- not mon_containerized_deployment
- name: restart containerized ceph mons with systemd
state: restarted
enabled: yes
when:
- - is_systemd
+ - ansible_service_mgr == 'systemd'
- mon_containerized_deployment
- name: set mon_host_count
service:
name: ceph-osd-all
state: stopped
- when: is_upstart.stat.exists == True
+ when: ansible_service_mgr == 'upstart'
- name: stop ceph osds with sysvinit
service:
name: ceph
state: stopped
- when: is_sysvinit.stat.exists == True
+ when: ansible_service_mgr == 'sysvinit'
- name: stop ceph osds with systemd
service:
enabled: yes
with_items: "{{ osd_ids.stdout_lines }}"
when:
- - is_systemd
+ - ansible_service_mgr == 'systemd'
- not osd_containerized_deployment
roles:
service:
name: ceph-osd-all
state: started
- when: is_upstart.stat.exists == True
+ when: ansible_service_mgr == 'upstart'
- name: start ceph osds with sysvinit
service:
name: ceph
state: started
- when: is_sysvinit.stat.exists == True
+ when: ansible_service_mgr == 'sysvinit'
- name: start ceph osds with systemd
service:
enabled: yes
with_items: "{{ osd_ids.stdout_lines }}"
when:
- - is_systemd
+ - ansible_service_mgr == 'systemd'
- not osd_containerized_deployment
- name: restart containerized ceph osds with systemd
enabled: yes
with_items: "{{ ceph_osd_docker_devices }}"
when:
- - is_systemd
+ - ansible_service_mgr == 'systemd'
- osd_containerized_deployment
- name: waiting for clean pgs...
name: ceph-mds
state: stopped
args: id={{ ansible_hostname }}
- when: is_upstart.stat.exists == True
+ when: ansible_service_mgr == 'upstart'
- name: stop ceph mdss with sysvinit
service:
name: ceph
state: stopped
args: mds
- when: is_sysvinit.stat.exists == True
+ when: ansible_service_mgr == 'sysvinit'
- name: stop ceph mdss with systemd
service:
state: stopped
enabled: yes
when:
- - is_systemd
+ - ansible_service_mgr == 'systemd'
- not mds_containerized_deployment
roles:
name: ceph-mds
state: started
args: id={{ ansible_hostname }}
- when: is_upstart.stat.exists == True
+ when: ansible_service_mgr == 'upstart'
- name: start ceph mdss with sysvinit
service:
name: ceph
state: started
args: mds
- when: is_sysvinit.stat.exists == True
+ when: ansible_service_mgr == 'sysvinit'
- name: start ceph mdss with systemd
service:
state: started
enabled: yes
when:
- - is_systemd
+ - ansible_service_mgr == 'systemd'
- not mds_containerized_deployment
- name: restart ceph mdss
state: restarted
enabled: yes
when:
- - is_systemd
+ - ansible_service_mgr == 'systemd'
- mds_containerized_deployment
service:
name: ceph-radosgw
state: stopped
- when: is_upstart.stat.exists == True
+ when: ansible_service_mgr == 'upstart'
- name: stop ceph rgws with sysvinit
service:
name: radosgw
state: stopped
- when: is_sysvinit.stat.exists == True
+ when: ansible_service_mgr == 'sysvinit'
- name: stop ceph rgws with systemd
service:
state: stopped
enabled: yes
when:
- - is_systemd
+ - ansible_service_mgr == 'systemd'
- not rgw_containerized_deployment
roles:
service:
name: ceph-radosgw
state: started
- when: is_upstart.stat.exists == True
+ when: ansible_service_mgr == 'upstart'
- name: start ceph rgws with sysvinit
service:
name: radosgw
state: started
- when: is_sysvinit.stat.exists == True
+ when: ansible_service_mgr == 'sysvinit'
- name: start ceph rgws with systemd
service:
state: started
enabled: yes
when:
- - is_systemd
+ - ansible_service_mgr == 'systemd'
- not rgw_containerized_deployment
- name: restart containerized ceph rgws with systemd
state: restarted
enabled: yes
when:
- - is_systemd
+ - ansible_service_mgr == 'systemd'
- rgw_containerized_deployment