2018-09-27 22:31:22 +08:00
|
|
|
---
|
|
|
|
# This playbook is used to add a new OSD to
|
|
|
|
# an existing cluster without the need for running
|
2018-10-19 23:07:55 +08:00
|
|
|
# the ceph-container-common or ceph-common and ceph-mon role again against all
|
2018-09-27 22:31:22 +08:00
|
|
|
# of the existing monitors.
|
|
|
|
#
|
|
|
|
# It can run from any machine. Even if the fetch directory is not present
|
|
|
|
# it will be created.
|
|
|
|
#
|
|
|
|
# Ensure that all monitors are present in the mons
|
|
|
|
# group in your inventory so that the ceph configuration file
|
|
|
|
# is created correctly for the new OSD(s).
|
|
|
|
#
|
|
|
|
# It is expected to edit your inventory file to only point to the OSD hosts
|
|
|
|
# you want to play the playbook on. So you need to comment already deployed OSD
|
|
|
|
# and let uncommented the new OSDs.
|
|
|
|
#
|
|
|
|
- hosts:
|
|
|
|
- mons
|
|
|
|
- osds
|
|
|
|
|
|
|
|
gather_facts: False
|
2019-03-09 04:15:39 +08:00
|
|
|
become: true
|
2018-09-27 22:31:22 +08:00
|
|
|
|
|
|
|
vars:
|
|
|
|
delegate_facts_host: True
|
|
|
|
|
2018-11-12 20:21:26 +08:00
|
|
|
pre_tasks:
|
2019-11-04 22:04:48 +08:00
|
|
|
- import_tasks: "{{ playbook_dir }}/../raw_install_python.yml"
|
|
|
|
|
2018-09-27 22:31:22 +08:00
|
|
|
- name: gather facts
|
|
|
|
setup:
|
2020-06-30 22:13:42 +08:00
|
|
|
gather_subset:
|
|
|
|
- 'all'
|
|
|
|
- '!facter'
|
|
|
|
- '!ohai'
|
2019-04-01 23:46:15 +08:00
|
|
|
when: not delegate_facts_host | bool
|
2018-09-27 22:31:22 +08:00
|
|
|
|
|
|
|
- name: gather and delegate facts
|
|
|
|
setup:
|
2020-06-30 22:13:42 +08:00
|
|
|
gather_subset:
|
|
|
|
- 'all'
|
|
|
|
- '!facter'
|
|
|
|
- '!ohai'
|
2018-09-27 22:31:22 +08:00
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
delegate_facts: True
|
|
|
|
with_items:
|
|
|
|
- "{{ groups['mons'] }}"
|
|
|
|
- "{{ groups['osds'] }}"
|
|
|
|
run_once: True
|
2019-04-01 23:46:15 +08:00
|
|
|
when: delegate_facts_host | bool
|
2018-09-27 22:31:22 +08:00
|
|
|
|
2018-11-12 20:21:26 +08:00
|
|
|
tasks:
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
|
|
|
|
2018-12-10 22:46:32 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-facts
|
|
|
|
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-validate
|
2018-09-27 22:31:22 +08:00
|
|
|
|
|
|
|
- hosts: osds
|
|
|
|
gather_facts: False
|
|
|
|
become: True
|
|
|
|
|
2019-03-04 16:23:00 +08:00
|
|
|
vars:
|
|
|
|
delegate_facts_host: True
|
|
|
|
|
2018-11-12 20:21:26 +08:00
|
|
|
pre_tasks:
|
2019-03-04 16:23:00 +08:00
|
|
|
|
|
|
|
- name: gather facts
|
|
|
|
setup:
|
2020-06-30 22:13:42 +08:00
|
|
|
gather_subset:
|
|
|
|
- 'all'
|
|
|
|
- '!facter'
|
|
|
|
- '!ohai'
|
2019-04-01 23:46:15 +08:00
|
|
|
when: not delegate_facts_host | bool
|
2019-03-04 16:23:00 +08:00
|
|
|
|
|
|
|
- name: gather and delegate facts
|
|
|
|
setup:
|
2020-06-30 22:13:42 +08:00
|
|
|
gather_subset:
|
|
|
|
- 'all'
|
|
|
|
- '!facter'
|
|
|
|
- '!ohai'
|
2019-03-04 16:23:00 +08:00
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
delegate_facts: True
|
|
|
|
with_items:
|
|
|
|
- "{{ groups['mons'] }}"
|
|
|
|
- "{{ groups['osds'] }}"
|
|
|
|
run_once: True
|
2019-04-01 23:46:15 +08:00
|
|
|
when: delegate_facts_host | bool
|
2019-03-04 16:23:00 +08:00
|
|
|
|
2019-10-24 22:02:10 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-facts
|
|
|
|
- import_role:
|
|
|
|
name: ceph-handler
|
|
|
|
- import_role:
|
|
|
|
name: ceph-infra
|
|
|
|
- import_role:
|
|
|
|
name: ceph-container-engine
|
|
|
|
when: containerized_deployment | bool
|
|
|
|
- import_role:
|
|
|
|
name: ceph-container-common
|
|
|
|
when: containerized_deployment | bool
|
|
|
|
- import_role:
|
|
|
|
name: ceph-common
|
|
|
|
when: not containerized_deployment | bool
|
|
|
|
|
2018-09-27 22:31:22 +08:00
|
|
|
# this task is needed so we can skip the openstack_config.yml include in roles/ceph-osd
|
|
|
|
- name: set_fact add_osd
|
|
|
|
set_fact:
|
|
|
|
add_osd: True
|
|
|
|
|
|
|
|
- name: set noup flag
|
2019-05-14 20:51:32 +08:00
|
|
|
command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd set noup"
|
2018-09-27 22:31:22 +08:00
|
|
|
delegate_to: "{{ groups['mons'][0] }}"
|
|
|
|
run_once: True
|
|
|
|
changed_when: False
|
|
|
|
|
2018-11-12 20:21:26 +08:00
|
|
|
tasks:
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
|
|
|
|
2018-12-10 22:46:32 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-facts
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-handler
|
|
|
|
- import_role:
|
|
|
|
name: ceph-config
|
|
|
|
- import_role:
|
|
|
|
name: ceph-osd
|
|
|
|
|
2018-11-12 20:21:26 +08:00
|
|
|
post_tasks:
|
2018-09-27 22:31:22 +08:00
|
|
|
- name: unset noup flag
|
2019-05-14 20:51:32 +08:00
|
|
|
command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd unset noup"
|
2018-09-27 22:31:22 +08:00
|
|
|
delegate_to: "{{ groups['mons'][0] }}"
|
|
|
|
run_once: True
|
2018-10-01 23:43:24 +08:00
|
|
|
changed_when: False
|
2019-07-09 21:40:47 +08:00
|
|
|
|
|
|
|
- name: warn user about deprecation
|
|
|
|
debug:
|
|
|
|
msg: |
|
|
|
|
Playbook has complete.
|
|
|
|
However, note that it will be deprecated in a future release.
|
|
|
|
You can achieve the same goal using the main playbook with --limit
|