mirror of https://github.com/ceph/ceph-ansible.git
40 lines
1.0 KiB
YAML
40 lines
1.0 KiB
YAML
---
|
|
# This playbook was made to automate Ceph servers maintenance
|
|
# Typical use case: hardware change
|
|
# By running this playbook you will set the 'noout' flag on your
|
|
# cluster, which means that OSD **can't** be marked as out
|
|
# of the CRUSH map, but they will be marked as down.
|
|
# Basically we tell the cluster to don't move any data since
|
|
# the operation won't last for too long.
|
|
|
|
- hosts: <your_host>
|
|
gather_facts: false
|
|
|
|
tasks:
|
|
|
|
- name: Set the noout flag
|
|
ansible.builtin.command: ceph osd set noout
|
|
delegate_to: <your_monitor>
|
|
|
|
- name: Turn off the server
|
|
ansible.builtin.command: poweroff
|
|
|
|
- name: Wait for the server to go down
|
|
local_action:
|
|
module: wait_for
|
|
host: <your_host>
|
|
port: 22
|
|
state: stopped
|
|
|
|
- name: Wait for the server to come up
|
|
local_action:
|
|
module: wait_for
|
|
host: <your_host>
|
|
port: 22
|
|
delay: 10
|
|
timeout: 3600
|
|
|
|
- name: Unset the noout flag
|
|
ansible.builtin.command: ceph osd unset noout
|
|
delegate_to: <your_monitor>
|