2014-03-04 02:08:51 +08:00
|
|
|
|
---
|
|
|
|
|
# This playbook does a rolling update for all the Ceph services
|
2016-11-21 18:29:05 +08:00
|
|
|
|
#
|
|
|
|
|
# The value of 'serial:' adjusts the number of servers to be updated simultaneously.
|
|
|
|
|
# We recommend a value of 1, which means hosts of a group (e.g: monitor) will be
|
|
|
|
|
# upgraded one by one. It is really crucial for the update process to happen
|
|
|
|
|
# in a serialized fashion. DO NOT CHANGE THIS VALUE.
|
2014-03-04 02:08:51 +08:00
|
|
|
|
#
|
|
|
|
|
#
|
2017-09-14 05:46:29 +08:00
|
|
|
|
# If you run a Ceph community version, you have to change the variable: ceph_stable_release to the new release
|
|
|
|
|
#
|
|
|
|
|
# If you run Red Hat Ceph Storage and are doing a **major** update (e.g: from 2 to 3), you have two options:
|
|
|
|
|
# - if you use a CDN, you have to change the ceph_rhcs_version to a newer one
|
|
|
|
|
# - if you use an ISO, you have to change the ceph_rhcs_iso_path to the directory containing the new Ceph version
|
|
|
|
|
#
|
2014-03-04 02:08:51 +08:00
|
|
|
|
|
2016-06-01 00:13:47 +08:00
|
|
|
|
- name: confirm whether user really meant to upgrade the cluster
|
|
|
|
|
hosts: localhost
|
2017-12-16 00:39:32 +08:00
|
|
|
|
become: false
|
2017-10-19 00:03:30 +08:00
|
|
|
|
vars:
|
|
|
|
|
- mgr_group_name: mgrs
|
2018-01-17 22:18:11 +08:00
|
|
|
|
- jewel_minor_update: False
|
2016-06-01 00:13:47 +08:00
|
|
|
|
|
|
|
|
|
vars_prompt:
|
|
|
|
|
- name: ireallymeanit
|
|
|
|
|
prompt: Are you sure you want to upgrade the cluster?
|
|
|
|
|
default: 'no'
|
|
|
|
|
private: no
|
|
|
|
|
|
|
|
|
|
tasks:
|
2017-10-19 00:03:30 +08:00
|
|
|
|
- name: exit playbook, if user did not mean to upgrade cluster
|
|
|
|
|
fail:
|
|
|
|
|
msg: >
|
|
|
|
|
"Exiting rolling_update.yml playbook, cluster was NOT upgraded.
|
|
|
|
|
To upgrade the cluster, either say 'yes' on the prompt or
|
|
|
|
|
use `-e ireallymeanit=yes` on the command line when
|
|
|
|
|
invoking the playbook"
|
|
|
|
|
when: ireallymeanit != 'yes'
|
|
|
|
|
|
|
|
|
|
- name: fail if no mgr host is present in the inventory
|
|
|
|
|
fail:
|
|
|
|
|
msg: "Please add a mgr host to your inventory."
|
|
|
|
|
when:
|
2018-01-17 22:18:11 +08:00
|
|
|
|
- not jewel_minor_update
|
2017-10-19 00:03:30 +08:00
|
|
|
|
- groups.get(mgr_group_name, []) | length == 0
|
2016-06-01 00:13:47 +08:00
|
|
|
|
|
2016-11-16 16:35:09 +08:00
|
|
|
|
|
2016-10-26 05:56:58 +08:00
|
|
|
|
- name: gather facts and check the init system
|
2016-10-06 19:56:37 +08:00
|
|
|
|
|
2016-10-26 05:56:58 +08:00
|
|
|
|
hosts:
|
2017-03-08 03:16:12 +08:00
|
|
|
|
- "{{ mon_group_name|default('mons') }}"
|
|
|
|
|
- "{{ osd_group_name|default('osds') }}"
|
|
|
|
|
- "{{ mds_group_name|default('mdss') }}"
|
|
|
|
|
- "{{ rgw_group_name|default('rgws') }}"
|
2017-04-11 20:20:11 +08:00
|
|
|
|
- "{{ mgr_group_name|default('mgrs') }}"
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- "{{ rbd_mirror_group_name|default('rbdmirrors') }}"
|
|
|
|
|
- "{{ nfs_group_name|default('nfss') }}"
|
2017-07-29 04:27:02 +08:00
|
|
|
|
- "{{ client_group_name|default('clients') }}"
|
2016-06-15 23:08:15 +08:00
|
|
|
|
|
|
|
|
|
become: True
|
2017-10-19 00:03:30 +08:00
|
|
|
|
gather_facts: False
|
|
|
|
|
vars:
|
|
|
|
|
delegate_facts_host: True
|
2015-04-15 03:50:39 +08:00
|
|
|
|
tasks:
|
2016-06-15 23:08:15 +08:00
|
|
|
|
- debug: msg="gather facts on all Ceph hosts for following reference"
|
2016-11-06 12:15:26 +08:00
|
|
|
|
|
2017-10-19 00:03:30 +08:00
|
|
|
|
- name: gather facts
|
|
|
|
|
setup:
|
|
|
|
|
when:
|
|
|
|
|
- not delegate_facts_host | bool
|
|
|
|
|
|
|
|
|
|
- name: gather and delegate facts
|
|
|
|
|
setup:
|
|
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
|
delegate_facts: True
|
|
|
|
|
with_items: "{{ groups['all'] }}"
|
2018-06-05 22:30:12 +08:00
|
|
|
|
run_once: true
|
2017-10-19 00:03:30 +08:00
|
|
|
|
when:
|
|
|
|
|
- delegate_facts_host | bool
|
|
|
|
|
|
2016-11-06 12:15:26 +08:00
|
|
|
|
- set_fact: rolling_update=true
|
|
|
|
|
|
2016-10-06 19:56:37 +08:00
|
|
|
|
- name: upgrade ceph mon cluster
|
|
|
|
|
|
2016-01-29 23:54:59 +08:00
|
|
|
|
vars:
|
2016-10-03 17:24:59 +08:00
|
|
|
|
health_mon_check_retries: 5
|
2017-06-13 05:07:52 +08:00
|
|
|
|
health_mon_check_delay: 15
|
2016-11-05 00:31:02 +08:00
|
|
|
|
upgrade_ceph_packages: True
|
2015-03-27 01:51:11 +08:00
|
|
|
|
|
2016-10-06 19:56:37 +08:00
|
|
|
|
hosts:
|
2017-03-08 03:16:12 +08:00
|
|
|
|
- "{{ mon_group_name|default('mons') }}"
|
2016-10-06 19:56:37 +08:00
|
|
|
|
|
|
|
|
|
serial: 1
|
|
|
|
|
become: True
|
|
|
|
|
|
2016-11-15 04:40:31 +08:00
|
|
|
|
pre_tasks:
|
2016-11-15 03:04:43 +08:00
|
|
|
|
- name: set mon_host_count
|
2017-03-24 14:40:15 +08:00
|
|
|
|
set_fact: mon_host_count={{ groups[mon_group_name] | length }}
|
2016-11-15 03:04:43 +08:00
|
|
|
|
|
2016-11-16 16:35:09 +08:00
|
|
|
|
- debug: msg="WARNING - upgrading a ceph cluster with only one monitor node ({{ inventory_hostname }})"
|
2016-11-15 03:04:43 +08:00
|
|
|
|
when: mon_host_count | int == 1
|
2016-11-15 04:40:31 +08:00
|
|
|
|
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: fail when single containerized monitor
|
|
|
|
|
fail:
|
|
|
|
|
msg: "Upgrades of a single monitor are not supported, also running 1 monitor is not recommended always use 3."
|
|
|
|
|
when:
|
|
|
|
|
- containerized_deployment
|
|
|
|
|
- mon_host_count | int == 1
|
2016-11-15 04:40:31 +08:00
|
|
|
|
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: stop ceph mon
|
|
|
|
|
systemd:
|
2016-11-15 04:40:31 +08:00
|
|
|
|
name: ceph-mon@{{ ansible_hostname }}
|
|
|
|
|
state: stopped
|
|
|
|
|
enabled: yes
|
2016-11-16 16:35:09 +08:00
|
|
|
|
when:
|
2017-04-13 01:57:33 +08:00
|
|
|
|
- not containerized_deployment
|
2016-11-15 04:40:31 +08:00
|
|
|
|
|
2014-03-04 02:08:51 +08:00
|
|
|
|
roles:
|
2017-07-29 04:27:02 +08:00
|
|
|
|
- ceph-defaults
|
2017-07-29 04:48:13 +08:00
|
|
|
|
- { role: ceph-common, when: not containerized_deployment }
|
|
|
|
|
- { role: ceph-docker-common, when: containerized_deployment }
|
2017-10-19 00:03:30 +08:00
|
|
|
|
- ceph-config
|
2015-03-27 01:51:11 +08:00
|
|
|
|
- ceph-mon
|
|
|
|
|
|
2014-03-04 02:08:51 +08:00
|
|
|
|
post_tasks:
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: start ceph mon
|
|
|
|
|
systemd:
|
2016-06-15 23:08:15 +08:00
|
|
|
|
name: ceph-mon@{{ ansible_hostname }}
|
2016-11-15 04:40:31 +08:00
|
|
|
|
state: started
|
2016-06-15 23:08:15 +08:00
|
|
|
|
enabled: yes
|
2016-11-16 16:35:09 +08:00
|
|
|
|
when:
|
2017-04-13 01:57:33 +08:00
|
|
|
|
- not containerized_deployment
|
2016-11-16 16:35:09 +08:00
|
|
|
|
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: restart containerized ceph mon
|
|
|
|
|
systemd:
|
2016-11-16 16:35:09 +08:00
|
|
|
|
name: ceph-mon@{{ ansible_hostname }}
|
|
|
|
|
state: restarted
|
|
|
|
|
enabled: yes
|
2017-10-16 20:15:43 +08:00
|
|
|
|
daemon_reload: yes
|
2016-11-16 16:35:09 +08:00
|
|
|
|
when:
|
2017-04-13 01:57:33 +08:00
|
|
|
|
- containerized_deployment
|
2015-03-27 01:51:11 +08:00
|
|
|
|
|
2016-11-06 12:15:26 +08:00
|
|
|
|
- name: set mon_host_count
|
2017-03-24 14:40:15 +08:00
|
|
|
|
set_fact: mon_host_count={{ groups[mon_group_name] | length }}
|
2015-03-27 01:51:11 +08:00
|
|
|
|
|
2016-11-06 12:15:26 +08:00
|
|
|
|
- name: select a running monitor if multiple monitors
|
2015-04-17 10:04:52 +08:00
|
|
|
|
set_fact: mon_host={{ item }}
|
2017-03-24 14:40:15 +08:00
|
|
|
|
with_items: "{{ groups[mon_group_name] }}"
|
2016-11-06 12:15:26 +08:00
|
|
|
|
when:
|
|
|
|
|
- mon_host_count | int > 1
|
|
|
|
|
- item != inventory_hostname
|
|
|
|
|
|
|
|
|
|
- name: select first monitor if only one monitor
|
|
|
|
|
set_fact: mon_host={{ item }}
|
2017-03-24 14:40:15 +08:00
|
|
|
|
with_items: "{{ groups[mon_group_name][0] }}"
|
2016-11-06 12:15:26 +08:00
|
|
|
|
when:
|
|
|
|
|
- mon_host_count | int == 1
|
2015-04-17 10:04:52 +08:00
|
|
|
|
|
2017-10-07 06:46:46 +08:00
|
|
|
|
- name: non container | waiting for the monitor to join the quorum...
|
2017-09-29 06:10:57 +08:00
|
|
|
|
command: ceph --cluster "{{ cluster }}" -s --format json
|
|
|
|
|
register: ceph_health_raw
|
|
|
|
|
until: >
|
2018-02-16 20:45:26 +08:00
|
|
|
|
hostvars[mon_host]['ansible_hostname'] in (ceph_health_raw.stdout | from_json)["quorum_names"] or
|
|
|
|
|
hostvars[mon_host]['ansible_fqdn'] in (ceph_health_raw.stdout | from_json)["quorum_names"]
|
2016-10-03 17:24:59 +08:00
|
|
|
|
retries: "{{ health_mon_check_retries }}"
|
|
|
|
|
delay: "{{ health_mon_check_delay }}"
|
2015-04-17 10:04:52 +08:00
|
|
|
|
delegate_to: "{{ mon_host }}"
|
2017-09-29 06:10:57 +08:00
|
|
|
|
when:
|
|
|
|
|
- not containerized_deployment
|
2016-11-06 12:15:26 +08:00
|
|
|
|
|
2017-10-07 06:46:46 +08:00
|
|
|
|
- name: container | waiting for the containerized monitor to join the quorum...
|
2017-09-29 06:10:57 +08:00
|
|
|
|
command: docker exec ceph-mon-{{ hostvars[mon_host]['ansible_hostname'] }} ceph --cluster "{{ cluster }}" -s --format json
|
|
|
|
|
register: ceph_health_raw
|
|
|
|
|
until: >
|
2018-02-16 20:45:26 +08:00
|
|
|
|
hostvars[mon_host]['ansible_hostname'] in (ceph_health_raw.stdout | from_json)["quorum_names"] or
|
|
|
|
|
hostvars[mon_host]['ansible_fqdn'] in (ceph_health_raw.stdout | from_json)["quorum_names"]
|
2016-10-03 17:24:59 +08:00
|
|
|
|
retries: "{{ health_mon_check_retries }}"
|
|
|
|
|
delay: "{{ health_mon_check_delay }}"
|
2015-04-17 10:04:52 +08:00
|
|
|
|
delegate_to: "{{ mon_host }}"
|
2017-09-29 06:10:57 +08:00
|
|
|
|
when:
|
|
|
|
|
- containerized_deployment
|
2015-03-27 01:51:11 +08:00
|
|
|
|
|
2018-05-16 22:02:41 +08:00
|
|
|
|
- name: set osd flags
|
|
|
|
|
command: ceph --cluster {{ cluster }} osd set {{ item }}
|
|
|
|
|
with_items:
|
|
|
|
|
- noout
|
2018-05-30 15:55:18 +08:00
|
|
|
|
- norebalance
|
2018-05-16 22:02:41 +08:00
|
|
|
|
- noscrub
|
|
|
|
|
- nodeep-scrub
|
|
|
|
|
delegate_to: "{{ mon_host }}"
|
|
|
|
|
when: not containerized_deployment
|
|
|
|
|
|
|
|
|
|
- name: set containerized osd flags
|
|
|
|
|
command: |
|
|
|
|
|
docker exec ceph-mon-{{ hostvars[mon_host]['ansible_hostname'] }} ceph --cluster {{ cluster }} osd set {{ item }}
|
|
|
|
|
with_items:
|
|
|
|
|
- noout
|
2018-05-30 15:55:18 +08:00
|
|
|
|
- norebalance
|
2018-05-16 22:02:41 +08:00
|
|
|
|
- noscrub
|
|
|
|
|
- nodeep-scrub
|
|
|
|
|
delegate_to: "{{ mon_host }}"
|
|
|
|
|
when: containerized_deployment
|
|
|
|
|
|
2017-10-16 20:15:43 +08:00
|
|
|
|
|
|
|
|
|
- name: upgrade ceph mgr node
|
|
|
|
|
|
|
|
|
|
vars:
|
|
|
|
|
upgrade_ceph_packages: True
|
|
|
|
|
|
|
|
|
|
hosts:
|
|
|
|
|
- "{{ mgr_group_name|default('mgrs') }}"
|
|
|
|
|
|
|
|
|
|
serial: 1
|
|
|
|
|
become: True
|
|
|
|
|
|
|
|
|
|
pre_tasks:
|
2018-05-23 07:52:40 +08:00
|
|
|
|
- name: non container - get current fsid
|
2018-05-11 14:05:11 +08:00
|
|
|
|
command: "ceph --cluster {{ cluster }} fsid"
|
2018-05-23 07:52:40 +08:00
|
|
|
|
register: cluster_uuid_non_container
|
2018-05-11 14:05:11 +08:00
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2018-05-23 07:52:40 +08:00
|
|
|
|
when:
|
|
|
|
|
- not containerized_deployment
|
|
|
|
|
|
|
|
|
|
- name: container - get current fsid
|
|
|
|
|
command: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} fsid"
|
|
|
|
|
register: cluster_uuid_container
|
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
|
when:
|
|
|
|
|
- containerized_deployment
|
|
|
|
|
|
|
|
|
|
- name: set_fact ceph_cluster_fsid
|
|
|
|
|
set_fact:
|
|
|
|
|
ceph_cluster_fsid: "{{ cluster_uuid_container.stdout if containerized_deployment else cluster_uuid_non_container.stdout }}"
|
2018-05-11 14:05:11 +08:00
|
|
|
|
|
2018-05-11 01:38:55 +08:00
|
|
|
|
- name: non container | create ceph mgr keyring(s)
|
|
|
|
|
command: "ceph --cluster {{ cluster }} auth get-or-create mgr.{{ hostvars[item]['ansible_hostname'] }} mon 'allow profile mgr' osd 'allow *' mds 'allow *' -o /etc/ceph/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring"
|
|
|
|
|
args:
|
|
|
|
|
creates: "{{ ceph_conf_key_directory }}/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring"
|
|
|
|
|
changed_when: false
|
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
|
with_items:
|
|
|
|
|
- "{{ groups.get(mgr_group_name, []) }}"
|
|
|
|
|
when:
|
|
|
|
|
- not containerized_deployment
|
|
|
|
|
- "{{ groups.get(mgr_group_name, []) | length > 0 }}"
|
|
|
|
|
|
|
|
|
|
- name: container | create ceph mgr keyring(s)
|
|
|
|
|
command: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }} ceph --cluster {{ cluster }} auth get-or-create mgr.{{ hostvars[item]['ansible_hostname'] }} mon 'allow profile mgr' osd 'allow *' mds 'allow *' -o /etc/ceph/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring"
|
|
|
|
|
args:
|
|
|
|
|
creates: "{{ ceph_conf_key_directory }}/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring"
|
|
|
|
|
changed_when: false
|
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
|
with_items:
|
|
|
|
|
- "{{ groups.get(mgr_group_name, []) }}"
|
|
|
|
|
when:
|
|
|
|
|
- containerized_deployment
|
|
|
|
|
- "{{ groups.get(mgr_group_name, []) | length > 0 }}"
|
|
|
|
|
|
|
|
|
|
- name: fetch ceph mgr key(s)
|
|
|
|
|
fetch:
|
|
|
|
|
src: "{{ ceph_conf_key_directory }}/{{ cluster }}.mgr.{{ hostvars[item]['ansible_hostname'] }}.keyring"
|
2018-05-23 07:52:40 +08:00
|
|
|
|
dest: "{{ fetch_directory }}/{{ ceph_cluster_fsid }}/{{ ceph_conf_key_directory }}/"
|
2018-05-11 01:38:55 +08:00
|
|
|
|
flat: yes
|
|
|
|
|
fail_on_missing: no
|
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
|
with_items:
|
|
|
|
|
- "{{ groups.get(mgr_group_name, []) }}"
|
|
|
|
|
|
|
|
|
|
# The following task has a failed_when: false
|
|
|
|
|
# to handle the scenario where no mgr existed before the upgrade
|
|
|
|
|
# or if we run a Ceph cluster before Luminous
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: stop ceph mgr
|
|
|
|
|
systemd:
|
|
|
|
|
name: ceph-mgr@{{ ansible_hostname }}
|
|
|
|
|
state: stopped
|
|
|
|
|
enabled: yes
|
|
|
|
|
failed_when: false
|
|
|
|
|
when:
|
|
|
|
|
- not containerized_deployment
|
|
|
|
|
|
|
|
|
|
roles:
|
|
|
|
|
- ceph-defaults
|
|
|
|
|
- { role: ceph-common, when: not containerized_deployment }
|
|
|
|
|
- { role: ceph-docker-common, when: containerized_deployment }
|
2017-10-19 21:07:58 +08:00
|
|
|
|
- ceph-config
|
|
|
|
|
- { role: ceph-mgr,
|
|
|
|
|
when: "(ceph_release_num[ceph_release] >= ceph_release_num.luminous) or
|
|
|
|
|
(ceph_release_num[ceph_release] < ceph_release_num.luminous and rolling_update)" }
|
2017-10-16 20:15:43 +08:00
|
|
|
|
|
|
|
|
|
post_tasks:
|
|
|
|
|
- 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
|
|
|
|
|
|
2017-05-12 21:59:52 +08:00
|
|
|
|
|
|
|
|
|
- name: upgrade ceph osds cluster
|
|
|
|
|
|
|
|
|
|
vars:
|
|
|
|
|
health_osd_check_retries: 40
|
|
|
|
|
health_osd_check_delay: 30
|
|
|
|
|
upgrade_ceph_packages: True
|
|
|
|
|
|
|
|
|
|
hosts:
|
|
|
|
|
- "{{ osd_group_name|default('osds') }}"
|
|
|
|
|
|
|
|
|
|
serial: 1
|
|
|
|
|
become: True
|
|
|
|
|
|
|
|
|
|
pre_tasks:
|
2016-11-15 04:25:46 +08:00
|
|
|
|
- name: get osd numbers
|
2017-03-30 17:51:38 +08:00
|
|
|
|
shell: "if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | sed 's/.*-//' ; fi"
|
2016-11-15 04:25:46 +08:00
|
|
|
|
register: osd_ids
|
|
|
|
|
changed_when: false
|
2017-04-13 01:57:33 +08:00
|
|
|
|
when: not containerized_deployment
|
2016-11-15 04:25:46 +08:00
|
|
|
|
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: stop ceph osd
|
|
|
|
|
systemd:
|
|
|
|
|
name: ceph-osd@{{ item }}
|
2016-11-15 04:25:46 +08:00
|
|
|
|
state: stopped
|
|
|
|
|
enabled: yes
|
|
|
|
|
with_items: "{{ osd_ids.stdout_lines }}"
|
2016-11-06 12:15:26 +08:00
|
|
|
|
when:
|
2017-04-13 01:57:33 +08:00
|
|
|
|
- not containerized_deployment
|
2016-11-15 04:25:46 +08:00
|
|
|
|
|
2014-03-04 02:08:51 +08:00
|
|
|
|
roles:
|
2017-07-29 04:27:02 +08:00
|
|
|
|
- ceph-defaults
|
2017-07-29 04:48:13 +08:00
|
|
|
|
- { role: ceph-common, when: not containerized_deployment }
|
|
|
|
|
- { role: ceph-docker-common, when: containerized_deployment }
|
2017-10-19 00:03:30 +08:00
|
|
|
|
- ceph-config
|
2015-03-27 01:51:11 +08:00
|
|
|
|
- ceph-osd
|
|
|
|
|
|
2014-03-04 02:08:51 +08:00
|
|
|
|
post_tasks:
|
2016-06-15 23:08:15 +08:00
|
|
|
|
- name: get osd numbers
|
2017-03-30 17:51:38 +08:00
|
|
|
|
shell: "if [ -d /var/lib/ceph/osd ] ; then ls /var/lib/ceph/osd | sed 's/.*-//' ; fi"
|
2016-06-15 23:08:15 +08:00
|
|
|
|
register: osd_ids
|
|
|
|
|
changed_when: false
|
2017-04-13 01:57:33 +08:00
|
|
|
|
when: not containerized_deployment
|
2015-03-27 01:51:11 +08:00
|
|
|
|
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: start ceph osd
|
|
|
|
|
systemd:
|
|
|
|
|
name: ceph-osd@{{ item }}
|
2016-11-15 04:25:46 +08:00
|
|
|
|
state: started
|
2016-06-15 23:08:15 +08:00
|
|
|
|
enabled: yes
|
|
|
|
|
with_items: "{{ osd_ids.stdout_lines }}"
|
2016-11-06 12:15:26 +08:00
|
|
|
|
when:
|
2017-04-13 01:57:33 +08:00
|
|
|
|
- not containerized_deployment
|
2016-11-06 12:15:26 +08:00
|
|
|
|
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: restart containerized ceph osd
|
|
|
|
|
systemd:
|
2016-11-06 12:15:26 +08:00
|
|
|
|
name: ceph-osd@{{ item | basename }}
|
|
|
|
|
state: restarted
|
|
|
|
|
enabled: yes
|
2017-10-16 20:15:43 +08:00
|
|
|
|
daemon_reload: yes
|
2017-07-25 23:54:26 +08:00
|
|
|
|
with_items: "{{ devices }}"
|
2016-11-06 12:15:26 +08:00
|
|
|
|
when:
|
2017-04-13 01:57:33 +08:00
|
|
|
|
- containerized_deployment
|
2015-03-27 01:51:11 +08:00
|
|
|
|
|
2017-10-08 20:45:48 +08:00
|
|
|
|
- name: set_fact docker_exec_cmd_osd
|
|
|
|
|
set_fact:
|
|
|
|
|
docker_exec_cmd_update_osd: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
|
2017-08-23 18:31:15 +08:00
|
|
|
|
when:
|
2017-10-08 20:45:48 +08:00
|
|
|
|
- containerized_deployment
|
|
|
|
|
|
|
|
|
|
- name: get num_pgs - non container
|
|
|
|
|
command: "{{ docker_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} -s --format json"
|
|
|
|
|
register: ceph_pgs
|
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2016-11-06 12:15:26 +08:00
|
|
|
|
|
2017-10-08 20:45:48 +08:00
|
|
|
|
- name: waiting for clean pgs...
|
|
|
|
|
command: "{{ docker_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} -s --format json"
|
2017-09-28 20:46:26 +08:00
|
|
|
|
register: ceph_health_post
|
|
|
|
|
until: >
|
|
|
|
|
((ceph_health_post.stdout | from_json).pgmap.pgs_by_state | length) == 1
|
|
|
|
|
and
|
|
|
|
|
(ceph_health_post.stdout | from_json).pgmap.pgs_by_state.0.state_name == "active+clean"
|
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2016-11-06 12:15:26 +08:00
|
|
|
|
retries: "{{ health_osd_check_retries }}"
|
|
|
|
|
delay: "{{ health_osd_check_delay }}"
|
2017-08-23 18:31:15 +08:00
|
|
|
|
when:
|
2017-10-08 20:45:48 +08:00
|
|
|
|
- (ceph_pgs.stdout | from_json).pgmap.num_pgs != 0
|
|
|
|
|
|
2017-05-12 21:59:52 +08:00
|
|
|
|
|
|
|
|
|
- name: unset osd flags
|
2018-02-13 04:52:27 +08:00
|
|
|
|
vars:
|
|
|
|
|
- jewel_minor_update: False
|
2017-05-12 21:59:52 +08:00
|
|
|
|
|
|
|
|
|
hosts:
|
|
|
|
|
- "{{ mon_group_name|default('mons') }}"
|
|
|
|
|
|
|
|
|
|
become: True
|
|
|
|
|
|
|
|
|
|
roles:
|
|
|
|
|
- ceph-defaults
|
|
|
|
|
|
|
|
|
|
tasks:
|
2017-09-29 18:05:43 +08:00
|
|
|
|
- name: set_fact docker_exec_cmd_osd
|
|
|
|
|
set_fact:
|
|
|
|
|
docker_exec_cmd_update_osd: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
|
|
|
|
|
when:
|
|
|
|
|
- containerized_deployment
|
2016-11-06 12:15:26 +08:00
|
|
|
|
|
2017-09-29 18:05:43 +08:00
|
|
|
|
- name: unset osd flags
|
|
|
|
|
command: "{{ docker_exec_cmd_update_osd|default('') }} ceph osd unset {{ item }} --cluster {{ cluster }}"
|
2016-11-06 12:15:26 +08:00
|
|
|
|
with_items:
|
|
|
|
|
- noout
|
2018-05-30 15:55:18 +08:00
|
|
|
|
- norebalance
|
2016-11-06 12:15:26 +08:00
|
|
|
|
- noscrub
|
|
|
|
|
- nodeep-scrub
|
2017-03-24 14:40:15 +08:00
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2015-03-27 01:51:11 +08:00
|
|
|
|
|
2017-09-28 21:27:27 +08:00
|
|
|
|
- name: get osd versions
|
2017-09-29 18:05:43 +08:00
|
|
|
|
command: "{{ docker_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} versions"
|
2017-09-28 21:27:27 +08:00
|
|
|
|
register: ceph_versions
|
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2018-01-25 23:57:45 +08:00
|
|
|
|
when:
|
|
|
|
|
- not jewel_minor_update
|
2017-09-28 21:27:27 +08:00
|
|
|
|
|
|
|
|
|
- name: set_fact ceph_versions_osd
|
|
|
|
|
set_fact:
|
|
|
|
|
ceph_versions_osd: "{{ (ceph_versions.stdout|from_json).osd }}"
|
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2018-01-25 23:57:45 +08:00
|
|
|
|
when:
|
|
|
|
|
- not jewel_minor_update
|
2017-09-28 21:27:27 +08:00
|
|
|
|
|
|
|
|
|
# length == 1 means there is a single osds versions entry
|
|
|
|
|
# thus all the osds are running the same version
|
|
|
|
|
- name: complete osds upgrade
|
2017-09-29 18:05:43 +08:00
|
|
|
|
command: "{{ docker_exec_cmd_update_osd|default('') }} ceph --cluster {{ cluster }} osd require-osd-release luminous"
|
2017-09-28 21:27:27 +08:00
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
|
when:
|
2018-01-25 23:57:45 +08:00
|
|
|
|
- (ceph_versions.get('stdout', '{}')|from_json).get('osd', {}) | length == 1
|
2017-09-28 21:27:27 +08:00
|
|
|
|
- ceph_versions_osd | string | search("ceph version 12")
|
2018-01-25 23:57:45 +08:00
|
|
|
|
- not jewel_minor_update
|
2017-09-28 21:27:27 +08:00
|
|
|
|
|
2014-03-04 02:08:51 +08:00
|
|
|
|
|
2016-10-06 19:56:37 +08:00
|
|
|
|
- name: upgrade ceph mdss cluster
|
|
|
|
|
|
2016-01-29 23:54:59 +08:00
|
|
|
|
vars:
|
2016-11-05 00:31:02 +08:00
|
|
|
|
upgrade_ceph_packages: True
|
2015-03-27 01:51:11 +08:00
|
|
|
|
|
2016-10-06 19:56:37 +08:00
|
|
|
|
hosts:
|
2017-03-08 03:16:12 +08:00
|
|
|
|
- "{{ mds_group_name|default('mdss') }}"
|
2016-10-06 19:56:37 +08:00
|
|
|
|
|
|
|
|
|
serial: 1
|
|
|
|
|
become: True
|
|
|
|
|
|
2016-11-15 04:42:52 +08:00
|
|
|
|
pre_tasks:
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: stop ceph mds
|
|
|
|
|
systemd:
|
2016-11-15 04:42:52 +08:00
|
|
|
|
name: ceph-mds@{{ ansible_hostname }}
|
|
|
|
|
state: stopped
|
|
|
|
|
enabled: yes
|
2016-11-16 16:35:09 +08:00
|
|
|
|
when:
|
2017-04-13 01:57:33 +08:00
|
|
|
|
- not containerized_deployment
|
2016-11-15 04:42:52 +08:00
|
|
|
|
|
2014-03-04 02:08:51 +08:00
|
|
|
|
roles:
|
2017-07-29 04:27:02 +08:00
|
|
|
|
- ceph-defaults
|
2017-07-29 04:48:13 +08:00
|
|
|
|
- { role: ceph-common, when: not containerized_deployment }
|
|
|
|
|
- { role: ceph-docker-common, when: containerized_deployment }
|
2017-10-19 00:03:30 +08:00
|
|
|
|
- ceph-config
|
2015-03-27 01:51:11 +08:00
|
|
|
|
- ceph-mds
|
|
|
|
|
|
2014-03-04 02:08:51 +08:00
|
|
|
|
post_tasks:
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: start ceph mds
|
|
|
|
|
systemd:
|
2016-06-15 23:08:15 +08:00
|
|
|
|
name: ceph-mds@{{ ansible_hostname }}
|
2016-11-15 04:42:52 +08:00
|
|
|
|
state: started
|
2016-06-15 23:08:15 +08:00
|
|
|
|
enabled: yes
|
2016-11-16 16:35:09 +08:00
|
|
|
|
when:
|
2017-04-13 01:57:33 +08:00
|
|
|
|
- not containerized_deployment
|
2016-11-16 16:35:09 +08:00
|
|
|
|
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: restart ceph mds
|
|
|
|
|
systemd:
|
2016-11-16 16:35:09 +08:00
|
|
|
|
name: ceph-mds@{{ ansible_hostname }}
|
|
|
|
|
state: restarted
|
|
|
|
|
enabled: yes
|
2017-10-16 20:15:43 +08:00
|
|
|
|
daemon_reload: yes
|
2016-11-16 16:35:09 +08:00
|
|
|
|
when:
|
2017-04-13 01:57:33 +08:00
|
|
|
|
- containerized_deployment
|
2015-03-27 01:51:11 +08:00
|
|
|
|
|
2016-10-06 19:56:37 +08:00
|
|
|
|
|
|
|
|
|
- name: upgrade ceph rgws cluster
|
|
|
|
|
|
2016-01-29 23:54:59 +08:00
|
|
|
|
vars:
|
2016-11-05 00:31:02 +08:00
|
|
|
|
upgrade_ceph_packages: True
|
2015-03-27 01:51:11 +08:00
|
|
|
|
|
2016-10-06 19:56:37 +08:00
|
|
|
|
hosts:
|
2017-03-08 03:16:12 +08:00
|
|
|
|
- "{{ rgw_group_name|default('rgws') }}"
|
2016-10-06 19:56:37 +08:00
|
|
|
|
|
|
|
|
|
serial: 1
|
|
|
|
|
become: True
|
|
|
|
|
|
2016-11-15 04:44:55 +08:00
|
|
|
|
pre_tasks:
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: stop ceph rgw
|
|
|
|
|
systemd:
|
2016-11-06 12:15:26 +08:00
|
|
|
|
name: ceph-radosgw@rgw.{{ ansible_hostname }}
|
2016-11-15 04:44:55 +08:00
|
|
|
|
state: stopped
|
2016-11-06 12:15:26 +08:00
|
|
|
|
enabled: yes
|
|
|
|
|
when:
|
2017-04-13 01:57:33 +08:00
|
|
|
|
- not containerized_deployment
|
2016-11-15 04:44:55 +08:00
|
|
|
|
|
2015-03-27 01:51:11 +08:00
|
|
|
|
roles:
|
2017-07-29 04:27:02 +08:00
|
|
|
|
- ceph-defaults
|
2017-07-29 04:48:13 +08:00
|
|
|
|
- { role: ceph-common, when: not containerized_deployment }
|
|
|
|
|
- { role: ceph-docker-common, when: containerized_deployment }
|
2017-10-19 00:03:30 +08:00
|
|
|
|
- ceph-config
|
2015-07-25 00:14:59 +08:00
|
|
|
|
- ceph-rgw
|
2015-03-27 01:51:11 +08:00
|
|
|
|
|
|
|
|
|
post_tasks:
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: start ceph rgw
|
|
|
|
|
systemd:
|
2016-11-06 12:15:26 +08:00
|
|
|
|
name: ceph-radosgw@rgw.{{ ansible_hostname }}
|
2016-11-15 04:44:55 +08:00
|
|
|
|
state: started
|
2016-11-06 12:15:26 +08:00
|
|
|
|
enabled: yes
|
|
|
|
|
when:
|
2017-04-13 01:57:33 +08:00
|
|
|
|
- not containerized_deployment
|
2016-11-06 12:15:26 +08:00
|
|
|
|
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: restart containerized ceph rgw
|
|
|
|
|
systemd:
|
2017-09-24 10:52:51 +08:00
|
|
|
|
name: ceph-radosgw@rgw.{{ ansible_hostname }}
|
2016-11-06 12:15:26 +08:00
|
|
|
|
state: restarted
|
|
|
|
|
enabled: yes
|
2017-10-16 20:15:43 +08:00
|
|
|
|
daemon_reload: yes
|
2016-11-06 12:15:26 +08:00
|
|
|
|
when:
|
2017-04-13 01:57:33 +08:00
|
|
|
|
- containerized_deployment
|
2017-07-29 04:27:02 +08:00
|
|
|
|
|
|
|
|
|
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: upgrade ceph rbd mirror node
|
2017-07-29 04:27:02 +08:00
|
|
|
|
|
|
|
|
|
vars:
|
|
|
|
|
upgrade_ceph_packages: True
|
|
|
|
|
|
|
|
|
|
hosts:
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- "{{ rbd_mirror_group_name|default('rbdmirrors') }}"
|
2017-07-29 04:27:02 +08:00
|
|
|
|
|
|
|
|
|
serial: 1
|
|
|
|
|
become: True
|
|
|
|
|
|
2017-10-16 20:15:43 +08:00
|
|
|
|
pre_tasks:
|
|
|
|
|
# NOTE(leseb): these tasks have a 'failed_when: false'
|
|
|
|
|
# in case we run before luminous or after
|
|
|
|
|
- name: stop ceph rbd mirror before luminous
|
|
|
|
|
systemd:
|
|
|
|
|
name: "ceph-rbd-mirror@{{ ceph_rbd_mirror_local_user }}"
|
|
|
|
|
state: stopped
|
|
|
|
|
enabled: no
|
|
|
|
|
failed_when: false
|
|
|
|
|
|
|
|
|
|
- name: stop ceph rbd mirror for and after luminous
|
|
|
|
|
systemd:
|
|
|
|
|
name: "ceph-rbd-mirror@rbd-mirror.{{ ansible_hostname }}"
|
|
|
|
|
state: stopped
|
|
|
|
|
enabled: yes
|
|
|
|
|
failed_when: false
|
|
|
|
|
|
2017-07-29 04:27:02 +08:00
|
|
|
|
roles:
|
|
|
|
|
- ceph-defaults
|
2017-10-03 18:25:12 +08:00
|
|
|
|
- { role: ceph-common, when: not containerized_deployment }
|
|
|
|
|
- { role: ceph-docker-common, when: containerized_deployment }
|
2017-10-19 00:03:30 +08:00
|
|
|
|
- ceph-config
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- ceph-rbd-mirror
|
2017-10-03 18:25:12 +08:00
|
|
|
|
|
2017-10-16 20:15:43 +08:00
|
|
|
|
post_tasks:
|
|
|
|
|
- name: start ceph rbd mirror
|
|
|
|
|
systemd:
|
|
|
|
|
name: "ceph-rbd-mirror@rbd-mirror.{{ ansible_hostname }}"
|
|
|
|
|
state: started
|
|
|
|
|
enabled: yes
|
|
|
|
|
when:
|
|
|
|
|
- not containerized_deployment
|
|
|
|
|
|
|
|
|
|
- name: restart containerized ceph rbd mirror
|
|
|
|
|
systemd:
|
|
|
|
|
name: ceph-rbd-mirror@rbd-mirror.{{ ansible_hostname }}
|
|
|
|
|
state: restarted
|
|
|
|
|
enabled: yes
|
|
|
|
|
daemon_reload: yes
|
|
|
|
|
when:
|
|
|
|
|
- containerized_deployment
|
2017-10-03 18:25:12 +08:00
|
|
|
|
|
2017-10-16 20:15:43 +08:00
|
|
|
|
|
|
|
|
|
- name: upgrade ceph nfs node
|
2017-10-03 18:25:12 +08:00
|
|
|
|
|
|
|
|
|
vars:
|
|
|
|
|
upgrade_ceph_packages: True
|
|
|
|
|
|
|
|
|
|
hosts:
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- "{{ nfs_group_name|default('nfss') }}"
|
2017-10-03 18:25:12 +08:00
|
|
|
|
|
|
|
|
|
serial: 1
|
|
|
|
|
become: True
|
|
|
|
|
|
|
|
|
|
pre_tasks:
|
2018-01-06 00:06:53 +08:00
|
|
|
|
# failed_when: false is here so that if we upgrade
|
|
|
|
|
# from a version of ceph that does not have nfs-ganesha
|
|
|
|
|
# then this task will not fail
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: stop ceph nfs
|
|
|
|
|
systemd:
|
|
|
|
|
name: nfs-ganesha
|
2017-10-03 18:25:12 +08:00
|
|
|
|
state: stopped
|
|
|
|
|
enabled: yes
|
2018-01-06 00:06:53 +08:00
|
|
|
|
failed_when: false
|
2017-10-03 18:25:12 +08:00
|
|
|
|
when:
|
|
|
|
|
- not containerized_deployment
|
|
|
|
|
|
|
|
|
|
roles:
|
|
|
|
|
- ceph-defaults
|
|
|
|
|
- { role: ceph-common, when: not containerized_deployment }
|
|
|
|
|
- { role: ceph-docker-common, when: containerized_deployment }
|
2017-10-20 00:30:08 +08:00
|
|
|
|
- ceph-config
|
|
|
|
|
- { role: ceph-nfs,
|
|
|
|
|
when: "(ceph_release_num[ceph_release] >= ceph_release_num.luminous) or
|
|
|
|
|
(ceph_release_num[ceph_release] < ceph_release_num.luminous and rolling_update)" }
|
2017-10-03 18:25:12 +08:00
|
|
|
|
|
|
|
|
|
post_tasks:
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: start nfs gateway
|
|
|
|
|
systemd:
|
|
|
|
|
name: nfs-ganesha
|
2017-10-03 18:25:12 +08:00
|
|
|
|
state: started
|
|
|
|
|
enabled: yes
|
|
|
|
|
when:
|
|
|
|
|
- not containerized_deployment
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- ceph_nfs_enable_service
|
2017-10-03 18:25:12 +08:00
|
|
|
|
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: systemd restart nfs container
|
|
|
|
|
systemd:
|
|
|
|
|
name: ceph-nfs@{{ ceph_nfs_service_suffix | default(ansible_hostname) }}
|
2017-10-03 18:25:12 +08:00
|
|
|
|
state: restarted
|
|
|
|
|
enabled: yes
|
2017-10-16 20:15:43 +08:00
|
|
|
|
daemon_reload: yes
|
2017-10-03 18:25:12 +08:00
|
|
|
|
when:
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- ceph_nfs_enable_service
|
2017-10-03 18:25:12 +08:00
|
|
|
|
- containerized_deployment
|
|
|
|
|
|
|
|
|
|
|
2018-05-11 06:57:59 +08:00
|
|
|
|
- name: upgrade ceph iscsi gateway node
|
|
|
|
|
|
|
|
|
|
vars:
|
|
|
|
|
upgrade_ceph_packages: True
|
|
|
|
|
|
|
|
|
|
hosts:
|
|
|
|
|
- "{{ iscsi_gw_group_name|default('iscsi-gws') }}"
|
|
|
|
|
|
|
|
|
|
serial: 1
|
|
|
|
|
become: True
|
|
|
|
|
|
|
|
|
|
pre_tasks:
|
|
|
|
|
# failed_when: false is here so that if we upgrade
|
|
|
|
|
# from a version of ceph that does not have iscsi gws
|
|
|
|
|
# then this task will not fail
|
|
|
|
|
- name: stop rbd-target-gw
|
|
|
|
|
systemd:
|
|
|
|
|
name: rbd-target-gw
|
|
|
|
|
state: stopped
|
|
|
|
|
enabled: yes
|
|
|
|
|
failed_when: false
|
|
|
|
|
when:
|
|
|
|
|
- not containerized_deployment
|
|
|
|
|
|
|
|
|
|
roles:
|
|
|
|
|
- ceph-defaults
|
|
|
|
|
- { role: ceph-common, when: not containerized_deployment }
|
|
|
|
|
- { role: ceph-docker-common, when: containerized_deployment }
|
|
|
|
|
- ceph-config
|
|
|
|
|
- { role: ceph-iscsi-gw,
|
|
|
|
|
when: "(ceph_release_num[ceph_release] >= ceph_release_num.luminous) or
|
|
|
|
|
(ceph_release_num[ceph_release] < ceph_release_num.luminous and rolling_update)" }
|
|
|
|
|
|
|
|
|
|
post_tasks:
|
|
|
|
|
- name: start rbd-target-gw
|
|
|
|
|
systemd:
|
|
|
|
|
name: rbd-target-gw
|
|
|
|
|
state: started
|
|
|
|
|
enabled: yes
|
|
|
|
|
when:
|
|
|
|
|
- not containerized_deployment
|
|
|
|
|
|
|
|
|
|
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- name: upgrade ceph client node
|
|
|
|
|
|
|
|
|
|
vars:
|
|
|
|
|
upgrade_ceph_packages: True
|
|
|
|
|
|
|
|
|
|
hosts:
|
|
|
|
|
- "{{ client_group_name|default('clients') }}"
|
|
|
|
|
|
|
|
|
|
serial: 1
|
|
|
|
|
become: True
|
|
|
|
|
|
|
|
|
|
roles:
|
|
|
|
|
- ceph-defaults
|
|
|
|
|
- { role: ceph-common, when: not containerized_deployment }
|
|
|
|
|
- { role: ceph-docker-common, when: containerized_deployment }
|
2017-10-19 00:03:30 +08:00
|
|
|
|
- ceph-config
|
2017-10-16 20:15:43 +08:00
|
|
|
|
- ceph-client
|
|
|
|
|
|
|
|
|
|
|
2017-10-03 18:25:12 +08:00
|
|
|
|
- name: show ceph status
|
|
|
|
|
|
|
|
|
|
hosts:
|
|
|
|
|
- "{{ mon_group_name|default('mons') }}"
|
|
|
|
|
|
|
|
|
|
become: True
|
|
|
|
|
|
|
|
|
|
roles:
|
|
|
|
|
- ceph-defaults
|
|
|
|
|
|
|
|
|
|
tasks:
|
|
|
|
|
- name: set_fact docker_exec_cmd_status
|
|
|
|
|
set_fact:
|
|
|
|
|
docker_exec_cmd_status: "docker exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_hostname'] }}"
|
|
|
|
|
when:
|
|
|
|
|
- containerized_deployment
|
|
|
|
|
|
|
|
|
|
- name: show ceph status
|
|
|
|
|
command: "{{ docker_exec_cmd_status|default('') }} ceph --cluster {{ cluster }} -s"
|
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|