2016-09-14 23:53:30 +08:00
|
|
|
---
|
|
|
|
# This playbook switches from non-containerized to containerized Ceph daemons
|
|
|
|
|
|
|
|
- name: confirm whether user really meant to switch from non-containerized to containerized ceph daemons
|
|
|
|
|
2019-04-01 23:46:15 +08:00
|
|
|
hosts: localhost
|
2016-09-14 23:53:30 +08:00
|
|
|
|
|
|
|
gather_facts: false
|
2022-02-22 00:12:06 +08:00
|
|
|
any_errors_fatal: true
|
2016-09-14 23:53:30 +08:00
|
|
|
vars_prompt:
|
|
|
|
- name: ireallymeanit
|
|
|
|
prompt: Are you sure you want to switch from non-containerized to containerized ceph daemons?
|
|
|
|
default: 'no'
|
|
|
|
private: no
|
|
|
|
|
|
|
|
tasks:
|
2022-02-22 00:12:06 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
|
|
|
|
|
|
|
- name: fail when less than three monitors
|
|
|
|
fail:
|
|
|
|
msg: "This playbook requires at least three monitors."
|
|
|
|
when: groups[mon_group_name] | length | int < 3
|
|
|
|
|
2017-08-22 22:43:01 +08:00
|
|
|
- name: exit playbook, if user did not mean to switch from non-containerized to containerized daemons?
|
|
|
|
fail:
|
|
|
|
msg: >
|
|
|
|
"Exiting switch-from-non-containerized-to-containerized-ceph-daemons.yml playbook,
|
|
|
|
cluster did not switch from non-containerized to containerized ceph daemons.
|
|
|
|
To switch from non-containerized to containerized ceph daemons, either say 'yes' on the prompt or
|
|
|
|
or use `-e ireallymeanit=yes` on the command line when
|
|
|
|
invoking the playbook"
|
|
|
|
when: ireallymeanit != 'yes'
|
2016-09-14 23:53:30 +08:00
|
|
|
|
|
|
|
|
2018-11-20 00:13:37 +08:00
|
|
|
- name: gather facts
|
2016-09-14 23:53:30 +08:00
|
|
|
|
|
|
|
hosts:
|
2017-03-08 03:32:57 +08:00
|
|
|
- "{{ mon_group_name|default('mons') }}"
|
2017-09-05 21:18:01 +08:00
|
|
|
- "{{ mgr_group_name|default('mgrs') }}"
|
2017-03-08 03:32:57 +08:00
|
|
|
- "{{ osd_group_name|default('osds') }}"
|
|
|
|
- "{{ mds_group_name|default('mdss') }}"
|
|
|
|
- "{{ rgw_group_name|default('rgws') }}"
|
|
|
|
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
|
|
|
|
- "{{ nfs_group_name|default('nfss') }}"
|
2016-09-14 23:53:30 +08:00
|
|
|
|
|
|
|
become: true
|
|
|
|
|
2019-12-09 21:20:42 +08:00
|
|
|
vars:
|
|
|
|
delegate_facts_host: True
|
|
|
|
|
2016-09-14 23:53:30 +08:00
|
|
|
tasks:
|
2019-12-09 21:20:42 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
|
|
|
|
2017-08-25 20:36:07 +08:00
|
|
|
- name: gather and delegate facts
|
|
|
|
setup:
|
2020-06-30 22:13:42 +08:00
|
|
|
gather_subset:
|
|
|
|
- 'all'
|
|
|
|
- '!facter'
|
|
|
|
- '!ohai'
|
2017-08-25 20:36:07 +08:00
|
|
|
delegate_to: "{{ item }}"
|
|
|
|
delegate_facts: True
|
2019-12-09 21:20:42 +08:00
|
|
|
with_items: "{{ groups['all'] | difference(groups.get(client_group_name, [])) }}"
|
|
|
|
run_once: true
|
|
|
|
when: delegate_facts_host | bool
|
|
|
|
tags: always
|
2017-08-25 20:36:07 +08:00
|
|
|
|
2021-06-28 22:46:40 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-facts
|
|
|
|
- import_role:
|
|
|
|
name: ceph-validate
|
|
|
|
|
2016-09-14 23:53:30 +08:00
|
|
|
- name: switching from non-containerized to containerized ceph mon
|
|
|
|
vars:
|
2017-08-22 22:43:01 +08:00
|
|
|
containerized_deployment: true
|
2019-02-08 15:52:03 +08:00
|
|
|
switch_to_containers: True
|
2016-11-03 17:16:33 +08:00
|
|
|
mon_group_name: mons
|
2019-04-01 23:46:15 +08:00
|
|
|
hosts: "{{ mon_group_name|default('mons') }}"
|
2016-09-14 23:53:30 +08:00
|
|
|
serial: 1
|
|
|
|
become: true
|
2018-11-12 20:21:26 +08:00
|
|
|
pre_tasks:
|
2017-08-22 22:43:01 +08:00
|
|
|
- name: select a running monitor
|
|
|
|
set_fact: mon_host={{ item }}
|
|
|
|
with_items: "{{ groups[mon_group_name] }}"
|
|
|
|
when: item != inventory_hostname
|
|
|
|
|
|
|
|
- name: stop non-containerized ceph mon
|
|
|
|
service:
|
2021-03-03 22:43:50 +08:00
|
|
|
name: "ceph-mon@{{ ansible_facts['hostname'] }}"
|
2017-08-22 22:43:01 +08:00
|
|
|
state: stopped
|
|
|
|
enabled: no
|
|
|
|
|
2019-02-12 17:56:28 +08:00
|
|
|
- name: remove old systemd unit files
|
|
|
|
file:
|
2020-09-15 21:46:30 +08:00
|
|
|
path: "{{ item }}"
|
2019-02-12 17:56:28 +08:00
|
|
|
state: absent
|
|
|
|
with_items:
|
2020-09-15 21:46:30 +08:00
|
|
|
- /usr/lib/systemd/system/ceph-mon@.service
|
|
|
|
- /usr/lib/systemd/system/ceph-mon.target
|
|
|
|
- /lib/systemd/system/ceph-mon@.service
|
|
|
|
- /lib/systemd/system/ceph-mon.target
|
2019-02-12 17:56:28 +08:00
|
|
|
|
2019-10-07 17:08:44 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
2018-04-19 16:28:56 +08:00
|
|
|
|
2019-10-07 17:08:44 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-facts
|
2017-08-22 22:43:01 +08:00
|
|
|
|
2019-10-07 15:19:50 +08:00
|
|
|
# NOTE: changed from file module to raw find command for performance reasons
|
2019-08-11 03:44:32 +08:00
|
|
|
# The file module has to run checks on current ownership of all directories and files. This is unnecessary
|
|
|
|
# as in this case we know we want all owned by ceph user
|
2017-08-22 22:43:01 +08:00
|
|
|
- name: set proper ownership on ceph directories
|
2021-04-09 15:24:05 +08:00
|
|
|
command: "find /var/lib/ceph/mon /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown -h {{ ceph_uid }}:{{ ceph_uid }} {} +"
|
2019-08-11 03:44:32 +08:00
|
|
|
changed_when: false
|
2017-08-22 22:43:01 +08:00
|
|
|
|
|
|
|
- name: check for existing old leveldb file extension (ldb)
|
|
|
|
shell: stat /var/lib/ceph/mon/*/store.db/*.ldb
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
register: ldb_files
|
|
|
|
|
|
|
|
- name: rename leveldb extension from ldb to sst
|
|
|
|
shell: rename -v .ldb .sst /var/lib/ceph/mon/*/store.db/*.ldb
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
when: ldb_files.rc == 0
|
|
|
|
|
2018-10-19 23:07:55 +08:00
|
|
|
- name: copy mon initial keyring in /etc/ceph to satisfy fetch config task in ceph-container-common
|
2021-03-03 22:43:50 +08:00
|
|
|
command: cp /var/lib/ceph/mon/{{ cluster }}-{{ ansible_facts['hostname'] }}/keyring /etc/ceph/{{ cluster }}.mon.keyring
|
2018-10-03 19:39:35 +08:00
|
|
|
args:
|
|
|
|
creates: /etc/ceph/{{ cluster }}.mon.keyring
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
|
2018-11-12 20:21:26 +08:00
|
|
|
tasks:
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-handler
|
2018-12-10 22:46:32 +08:00
|
|
|
|
2019-05-20 15:46:10 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-container-engine
|
|
|
|
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
2018-10-19 23:07:55 +08:00
|
|
|
name: ceph-container-common
|
2018-12-10 22:46:32 +08:00
|
|
|
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-mon
|
|
|
|
|
2018-10-19 23:07:55 +08:00
|
|
|
post_tasks:
|
2019-02-11 18:20:30 +08:00
|
|
|
- name: waiting for the monitor to join the quorum...
|
2020-12-18 17:33:44 +08:00
|
|
|
command: "{{ container_binary }} run --rm -v /etc/ceph:/etc/ceph:z --entrypoint=ceph {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} --cluster {{ cluster }} quorum_status --format json"
|
2017-10-16 20:27:57 +08:00
|
|
|
register: ceph_health_raw
|
2020-10-02 18:55:53 +08:00
|
|
|
changed_when: false
|
2021-08-10 03:41:40 +08:00
|
|
|
until: ansible_facts['hostname'] in (ceph_health_raw.stdout | trim | from_json)["quorum_names"]
|
2017-08-22 22:43:01 +08:00
|
|
|
retries: "{{ health_mon_check_retries }}"
|
|
|
|
delay: "{{ health_mon_check_delay }}"
|
2016-09-14 23:53:30 +08:00
|
|
|
|
2017-09-05 21:18:01 +08:00
|
|
|
- name: switching from non-containerized to containerized ceph mgr
|
|
|
|
|
2019-04-01 23:46:15 +08:00
|
|
|
hosts: "{{ mgr_group_name|default('mgrs') }}"
|
2017-09-05 21:18:01 +08:00
|
|
|
|
|
|
|
vars:
|
|
|
|
containerized_deployment: true
|
|
|
|
mgr_group_name: mgrs
|
|
|
|
|
|
|
|
serial: 1
|
|
|
|
become: true
|
2018-11-12 20:21:26 +08:00
|
|
|
pre_tasks:
|
2018-01-06 02:37:36 +08:00
|
|
|
# failed_when: false is here because if we're
|
|
|
|
# working with a jewel cluster then ceph mgr
|
|
|
|
# will not exist
|
2017-09-05 21:18:01 +08:00
|
|
|
- name: stop non-containerized ceph mgr(s)
|
|
|
|
service:
|
2021-03-03 22:43:50 +08:00
|
|
|
name: "ceph-mgr@{{ ansible_facts['hostname'] }}"
|
2017-09-05 21:18:01 +08:00
|
|
|
state: stopped
|
|
|
|
enabled: no
|
2018-01-06 02:37:36 +08:00
|
|
|
failed_when: false
|
2017-09-05 21:18:01 +08:00
|
|
|
|
2019-02-12 17:56:28 +08:00
|
|
|
- name: remove old systemd unit files
|
|
|
|
file:
|
2020-09-15 21:46:30 +08:00
|
|
|
path: "{{ item }}"
|
2019-02-12 17:56:28 +08:00
|
|
|
state: absent
|
|
|
|
with_items:
|
2020-09-15 21:46:30 +08:00
|
|
|
- /usr/lib/systemd/system/ceph-mgr@.service
|
|
|
|
- /usr/lib/systemd/system/ceph-mgr.target
|
|
|
|
- /lib/systemd/system/ceph-mgr@.service
|
|
|
|
- /lib/systemd/system/ceph-mgr.target
|
2019-02-12 17:56:28 +08:00
|
|
|
|
2019-10-07 17:08:44 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
2017-09-05 21:18:01 +08:00
|
|
|
|
2019-10-07 17:08:44 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-facts
|
2017-09-05 21:18:01 +08:00
|
|
|
|
2019-10-07 15:19:50 +08:00
|
|
|
# NOTE: changed from file module to raw find command for performance reasons
|
2019-08-11 03:44:32 +08:00
|
|
|
# The file module has to run checks on current ownership of all directories and files. This is unnecessary
|
|
|
|
# as in this case we know we want all owned by ceph user
|
2017-09-05 21:18:01 +08:00
|
|
|
- name: set proper ownership on ceph directories
|
2021-04-09 15:24:05 +08:00
|
|
|
command: "find /var/lib/ceph/mgr /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown -h {{ ceph_uid }}:{{ ceph_uid }} {} +"
|
2019-08-11 03:44:32 +08:00
|
|
|
changed_when: false
|
2017-09-05 21:18:01 +08:00
|
|
|
|
2018-11-12 20:21:26 +08:00
|
|
|
tasks:
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-handler
|
|
|
|
|
2019-05-20 15:46:10 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-container-engine
|
|
|
|
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
2018-10-19 23:07:55 +08:00
|
|
|
name: ceph-container-common
|
2018-10-01 23:43:24 +08:00
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-mgr
|
2017-09-05 21:18:01 +08:00
|
|
|
|
|
|
|
|
2020-04-03 21:36:23 +08:00
|
|
|
- name: set osd flags
|
|
|
|
hosts: "{{ mon_group_name | default('mons') }}[0]"
|
|
|
|
become: True
|
|
|
|
tasks:
|
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
|
|
|
- import_role:
|
|
|
|
name: ceph-facts
|
|
|
|
|
2021-06-15 00:01:41 +08:00
|
|
|
- name: get pool list
|
2021-07-29 02:54:15 +08:00
|
|
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool ls detail -f json"
|
2021-06-15 00:01:41 +08:00
|
|
|
register: pool_list
|
|
|
|
changed_when: false
|
2021-07-26 23:10:19 +08:00
|
|
|
check_mode: false
|
2021-06-15 00:01:41 +08:00
|
|
|
|
|
|
|
- name: get balancer module status
|
|
|
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer status -f json"
|
2021-08-03 23:58:49 +08:00
|
|
|
register: balancer_status_switch
|
2021-06-15 00:01:41 +08:00
|
|
|
changed_when: false
|
2021-07-26 23:10:19 +08:00
|
|
|
check_mode: false
|
2021-06-15 00:01:41 +08:00
|
|
|
|
|
|
|
- name: set_fact pools_pgautoscaler_mode
|
|
|
|
set_fact:
|
|
|
|
pools_pgautoscaler_mode: "{{ pools_pgautoscaler_mode | default([]) | union([{'name': item.pool_name, 'mode': item.pg_autoscale_mode}]) }}"
|
2021-07-29 02:54:15 +08:00
|
|
|
with_items: "{{ pool_list.stdout | default('{}') | from_json }}"
|
2021-06-15 00:01:41 +08:00
|
|
|
|
|
|
|
- name: disable balancer
|
|
|
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer off"
|
|
|
|
changed_when: false
|
2021-08-03 23:58:49 +08:00
|
|
|
when: (balancer_status_switch.stdout | from_json)['active'] | bool
|
2021-06-15 00:01:41 +08:00
|
|
|
|
|
|
|
- name: disable pg autoscale on pools
|
|
|
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode off"
|
|
|
|
with_items: "{{ pools_pgautoscaler_mode }}"
|
|
|
|
when:
|
|
|
|
- pools_pgautoscaler_mode is defined
|
|
|
|
- item.mode == 'on'
|
|
|
|
|
2020-04-03 21:36:23 +08:00
|
|
|
- name: set osd flags
|
2020-11-04 05:44:58 +08:00
|
|
|
ceph_osd_flag:
|
|
|
|
name: "{{ item }}"
|
|
|
|
cluster: "{{ cluster }}"
|
|
|
|
environment:
|
|
|
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
|
|
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
2020-04-03 21:36:23 +08:00
|
|
|
with_items:
|
|
|
|
- noout
|
|
|
|
- nodeep-scrub
|
|
|
|
|
|
|
|
|
2016-09-14 23:53:30 +08:00
|
|
|
- name: switching from non-containerized to containerized ceph osd
|
|
|
|
|
|
|
|
vars:
|
2017-08-22 22:43:01 +08:00
|
|
|
containerized_deployment: true
|
2016-09-14 23:53:30 +08:00
|
|
|
osd_group_name: osds
|
2020-06-16 23:43:13 +08:00
|
|
|
switch_to_containers: True
|
2016-09-14 23:53:30 +08:00
|
|
|
|
2019-04-01 23:46:15 +08:00
|
|
|
hosts: "{{ osd_group_name|default('osds') }}"
|
2016-09-14 23:53:30 +08:00
|
|
|
|
|
|
|
serial: 1
|
|
|
|
become: true
|
2018-11-12 20:21:26 +08:00
|
|
|
pre_tasks:
|
2016-09-14 23:53:30 +08:00
|
|
|
|
2018-11-20 00:13:37 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
|
|
|
|
2019-04-12 04:20:41 +08:00
|
|
|
- name: collect running osds
|
|
|
|
shell: |
|
2020-10-02 17:23:42 +08:00
|
|
|
set -o pipefail;
|
2020-11-26 17:11:36 +08:00
|
|
|
systemctl list-units | grep -E "loaded * active" | grep -Eo 'ceph-osd@[0-9]+.service|ceph-volume'
|
2019-04-12 04:20:41 +08:00
|
|
|
register: running_osds
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
|
2020-10-20 05:22:31 +08:00
|
|
|
# systemd module does not support --runtime option
|
|
|
|
- name: disable ceph-osd@.service runtime-enabled
|
2020-11-18 17:13:45 +08:00
|
|
|
command: "systemctl disable --runtime {{ item }}" # noqa 303
|
2020-10-20 05:22:31 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2020-10-02 19:05:01 +08:00
|
|
|
with_items: "{{ running_osds.stdout_lines | default([]) }}"
|
2020-10-20 05:22:31 +08:00
|
|
|
when: item.startswith('ceph-osd@')
|
|
|
|
|
2019-04-12 04:20:41 +08:00
|
|
|
- name: stop/disable/mask non-containerized ceph osd(s) (if any)
|
|
|
|
systemd:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: stopped
|
|
|
|
enabled: no
|
2020-10-02 19:05:01 +08:00
|
|
|
with_items: "{{ running_osds.stdout_lines | default([]) }}"
|
2019-04-12 04:20:41 +08:00
|
|
|
when: running_osds != []
|
|
|
|
|
2020-11-26 17:11:36 +08:00
|
|
|
- name: disable ceph.target
|
|
|
|
systemd:
|
|
|
|
name: ceph.target
|
|
|
|
enabled: no
|
|
|
|
|
2018-11-16 23:15:24 +08:00
|
|
|
- name: remove old ceph-osd systemd units
|
|
|
|
file:
|
|
|
|
path: "{{ item }}"
|
|
|
|
state: absent
|
|
|
|
with_items:
|
|
|
|
- /usr/lib/systemd/system/ceph-osd.target
|
|
|
|
- /usr/lib/systemd/system/ceph-osd@.service
|
|
|
|
- /usr/lib/systemd/system/ceph-volume@.service
|
2020-09-15 21:46:30 +08:00
|
|
|
- /lib/systemd/system/ceph-osd.target
|
|
|
|
- /lib/systemd/system/ceph-osd@.service
|
|
|
|
- /lib/systemd/system/ceph-volume@.service
|
2018-11-16 23:15:24 +08:00
|
|
|
|
2019-10-07 17:08:44 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-facts
|
2017-08-22 22:43:01 +08:00
|
|
|
|
2019-10-07 15:19:50 +08:00
|
|
|
# NOTE: changed from file module to raw find command for performance reasons
|
2019-08-11 03:44:32 +08:00
|
|
|
# The file module has to run checks on current ownership of all directories and files. This is unnecessary
|
|
|
|
# as in this case we know we want all owned by ceph user
|
2017-08-22 22:43:01 +08:00
|
|
|
- name: set proper ownership on ceph directories
|
2021-04-09 15:24:05 +08:00
|
|
|
command: "find /var/lib/ceph/osd /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown -h {{ ceph_uid }}:{{ ceph_uid }} {} +"
|
2019-08-11 03:44:32 +08:00
|
|
|
changed_when: false
|
2017-08-22 22:43:01 +08:00
|
|
|
|
|
|
|
- name: check for existing old leveldb file extension (ldb)
|
|
|
|
shell: stat /var/lib/ceph/osd/*/current/omap/*.ldb
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
register: ldb_files
|
|
|
|
|
|
|
|
- name: rename leveldb extension from ldb to sst
|
|
|
|
shell: rename -v .ldb .sst /var/lib/ceph/osd/*/current/omap/*.ldb
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2019-04-01 23:46:15 +08:00
|
|
|
when: ldb_files.rc == 0
|
2017-08-22 22:43:01 +08:00
|
|
|
|
|
|
|
- name: check if containerized osds are already running
|
2018-11-19 21:58:03 +08:00
|
|
|
command: >
|
2019-11-28 00:27:09 +08:00
|
|
|
{{ container_binary }} ps -q --filter='name=ceph-osd'
|
2017-08-22 22:43:01 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
register: osd_running
|
|
|
|
|
2018-11-19 21:58:03 +08:00
|
|
|
- name: get osd directories
|
|
|
|
command: >
|
2019-10-08 03:47:52 +08:00
|
|
|
find /var/lib/ceph/osd {% if dmcrypt | bool %}/var/lib/ceph/osd-lockbox{% endif %} -maxdepth 1 -mindepth 1 -type d
|
2018-11-19 21:58:03 +08:00
|
|
|
register: osd_dirs
|
2018-04-19 20:45:03 +08:00
|
|
|
changed_when: false
|
2019-11-28 00:27:09 +08:00
|
|
|
failed_when: false
|
2018-04-19 20:45:03 +08:00
|
|
|
|
2017-08-22 22:43:01 +08:00
|
|
|
- name: unmount all the osd directories
|
2018-11-19 21:58:03 +08:00
|
|
|
command: >
|
2019-10-08 03:47:52 +08:00
|
|
|
umount {{ item }}
|
2017-08-22 22:43:01 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2019-04-01 23:46:15 +08:00
|
|
|
with_items: "{{ osd_dirs.stdout_lines }}"
|
2019-11-28 00:27:09 +08:00
|
|
|
when: osd_running.rc != 0 or osd_running.stdout_lines | length == 0
|
2017-08-22 22:43:01 +08:00
|
|
|
|
2018-11-12 20:21:26 +08:00
|
|
|
tasks:
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-handler
|
|
|
|
|
2019-05-20 15:46:10 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-container-engine
|
|
|
|
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
2018-10-19 23:07:55 +08:00
|
|
|
name: ceph-container-common
|
2018-10-01 23:43:24 +08:00
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-osd
|
|
|
|
|
2018-11-12 20:21:26 +08:00
|
|
|
post_tasks:
|
2017-10-07 09:42:09 +08:00
|
|
|
- name: get num_pgs
|
2018-11-20 00:13:37 +08:00
|
|
|
command: >
|
2021-03-03 22:43:50 +08:00
|
|
|
{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }} ceph --cluster {{ cluster }} pg stat --format json
|
2017-10-07 09:42:09 +08:00
|
|
|
register: ceph_pgs
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2020-10-02 18:55:53 +08:00
|
|
|
changed_when: false
|
2017-10-07 09:42:09 +08:00
|
|
|
|
2017-10-07 01:52:05 +08:00
|
|
|
- name: container - waiting for clean pgs...
|
2018-11-20 00:13:37 +08:00
|
|
|
command: >
|
2021-03-03 22:43:50 +08:00
|
|
|
{{ container_binary }} exec ceph-mon-{{ hostvars[groups[mon_group_name][0]]['ansible_facts']['hostname'] }} ceph --cluster {{ cluster }} pg stat --format json
|
2017-10-07 01:52:05 +08:00
|
|
|
register: ceph_health_post
|
|
|
|
until: >
|
2020-10-26 23:23:01 +08:00
|
|
|
(((ceph_health_post.stdout | from_json).pg_summary.num_pg_by_state | length) > 0)
|
2017-10-07 01:52:05 +08:00
|
|
|
and
|
2020-10-26 23:23:01 +08:00
|
|
|
(((ceph_health_post.stdout | from_json).pg_summary.num_pg_by_state | selectattr('name', 'search', '^active\\+clean') | map(attribute='num') | list | sum) == (ceph_pgs.stdout | from_json).pg_summary.num_pgs)
|
2017-10-07 01:52:05 +08:00
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
2017-08-22 22:43:01 +08:00
|
|
|
retries: "{{ health_osd_check_retries }}"
|
|
|
|
delay: "{{ health_osd_check_delay }}"
|
2020-10-26 23:23:01 +08:00
|
|
|
when: (ceph_pgs.stdout | from_json).pg_summary.num_pgs != 0
|
2020-10-02 18:55:53 +08:00
|
|
|
changed_when: false
|
2016-09-14 23:53:30 +08:00
|
|
|
|
|
|
|
|
2020-04-03 21:36:23 +08:00
|
|
|
- name: unset osd flags
|
|
|
|
hosts: "{{ mon_group_name | default('mons') }}[0]"
|
|
|
|
become: True
|
|
|
|
tasks:
|
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
|
|
|
- import_role:
|
|
|
|
name: ceph-facts
|
|
|
|
|
2021-06-15 00:01:41 +08:00
|
|
|
- name: re-enable pg autoscale on pools
|
|
|
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} osd pool set {{ item.name }} pg_autoscale_mode on"
|
|
|
|
with_items: "{{ pools_pgautoscaler_mode }}"
|
|
|
|
when:
|
|
|
|
- pools_pgautoscaler_mode is defined
|
|
|
|
- item.mode == 'on'
|
|
|
|
|
|
|
|
- name: unset osd flags
|
2020-11-04 05:44:58 +08:00
|
|
|
ceph_osd_flag:
|
|
|
|
name: "{{ item }}"
|
|
|
|
cluster: "{{ cluster }}"
|
|
|
|
state: absent
|
|
|
|
environment:
|
|
|
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
|
|
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
2020-04-03 21:36:23 +08:00
|
|
|
with_items:
|
|
|
|
- noout
|
|
|
|
- nodeep-scrub
|
|
|
|
|
2021-06-15 00:01:41 +08:00
|
|
|
- name: re-enable balancer
|
|
|
|
command: "{{ ceph_cmd }} --cluster {{ cluster }} balancer on"
|
|
|
|
changed_when: false
|
2021-08-03 23:58:49 +08:00
|
|
|
when: (balancer_status_switch.stdout | from_json)['active'] | bool
|
2021-06-15 00:01:41 +08:00
|
|
|
|
|
|
|
|
2016-09-14 23:53:30 +08:00
|
|
|
- name: switching from non-containerized to containerized ceph mds
|
|
|
|
|
2019-04-01 23:46:15 +08:00
|
|
|
hosts: "{{ mds_group_name|default('mdss') }}"
|
2016-09-14 23:53:30 +08:00
|
|
|
|
2017-08-25 20:36:07 +08:00
|
|
|
vars:
|
|
|
|
containerized_deployment: true
|
|
|
|
mds_group_name: mdss
|
|
|
|
|
2016-09-14 23:53:30 +08:00
|
|
|
serial: 1
|
|
|
|
become: true
|
2018-11-12 20:21:26 +08:00
|
|
|
pre_tasks:
|
2016-09-14 23:53:30 +08:00
|
|
|
|
2017-08-22 22:43:01 +08:00
|
|
|
- name: stop non-containerized ceph mds(s)
|
|
|
|
service:
|
2021-03-03 22:43:50 +08:00
|
|
|
name: "ceph-mds@{{ ansible_facts['hostname'] }}"
|
2017-08-22 22:43:01 +08:00
|
|
|
state: stopped
|
|
|
|
enabled: no
|
2016-09-14 23:53:30 +08:00
|
|
|
|
2019-02-12 17:56:28 +08:00
|
|
|
- name: remove old systemd unit files
|
|
|
|
file:
|
2020-09-15 21:46:30 +08:00
|
|
|
path: "{{ item }}"
|
2019-02-12 17:56:28 +08:00
|
|
|
state: absent
|
|
|
|
with_items:
|
2020-09-15 21:46:30 +08:00
|
|
|
- /usr/lib/systemd/system/ceph-mds@.service
|
|
|
|
- /usr/lib/systemd/system/ceph-mds.target
|
|
|
|
- /lib/systemd/system/ceph-mds@.service
|
|
|
|
- /lib/systemd/system/ceph-mds.target
|
2019-02-12 17:56:28 +08:00
|
|
|
|
2019-10-07 17:08:44 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
2017-08-22 22:43:01 +08:00
|
|
|
|
2019-10-07 17:08:44 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-facts
|
2017-08-22 22:43:01 +08:00
|
|
|
|
2019-10-07 15:19:50 +08:00
|
|
|
# NOTE: changed from file module to raw find command for performance reasons
|
2019-08-11 03:44:32 +08:00
|
|
|
# The file module has to run checks on current ownership of all directories and files. This is unnecessary
|
|
|
|
# as in this case we know we want all owned by ceph user
|
2017-08-22 22:43:01 +08:00
|
|
|
- name: set proper ownership on ceph directories
|
2021-04-09 15:24:05 +08:00
|
|
|
command: "find /var/lib/ceph/mds /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown {{ ceph_uid }}:{{ ceph_uid }} {} +"
|
2019-08-11 03:44:32 +08:00
|
|
|
changed_when: false
|
2017-08-22 22:43:01 +08:00
|
|
|
|
2018-11-12 20:21:26 +08:00
|
|
|
tasks:
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-handler
|
|
|
|
|
2019-05-20 15:46:10 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-container-engine
|
|
|
|
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
2018-10-19 23:07:55 +08:00
|
|
|
name: ceph-container-common
|
2018-10-01 23:43:24 +08:00
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-mds
|
2016-09-14 23:53:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
- name: switching from non-containerized to containerized ceph rgw
|
|
|
|
|
2019-04-01 23:46:15 +08:00
|
|
|
hosts: "{{ rgw_group_name|default('rgws') }}"
|
2016-09-14 23:53:30 +08:00
|
|
|
|
2017-08-25 20:36:07 +08:00
|
|
|
vars:
|
|
|
|
containerized_deployment: true
|
|
|
|
rgw_group_name: rgws
|
|
|
|
|
2016-09-14 23:53:30 +08:00
|
|
|
serial: 1
|
|
|
|
become: true
|
2018-11-12 20:21:26 +08:00
|
|
|
pre_tasks:
|
2019-10-07 17:08:44 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
2017-08-22 22:43:01 +08:00
|
|
|
|
2019-10-07 17:08:44 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-facts
|
2017-08-22 22:43:01 +08:00
|
|
|
|
2020-07-01 16:47:45 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-config
|
|
|
|
tasks_from: rgw_systemd_environment_file.yml
|
|
|
|
|
2019-10-07 15:19:50 +08:00
|
|
|
# NOTE: changed from file module to raw find command for performance reasons
|
2019-08-11 03:44:32 +08:00
|
|
|
# The file module has to run checks on current ownership of all directories and files. This is unnecessary
|
|
|
|
# as in this case we know we want all owned by ceph user
|
2017-08-22 22:43:01 +08:00
|
|
|
- name: set proper ownership on ceph directories
|
2021-04-09 15:24:05 +08:00
|
|
|
command: "find /var/lib/ceph/radosgw /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown {{ ceph_uid }}:{{ ceph_uid }} {} +"
|
2019-08-11 03:44:32 +08:00
|
|
|
changed_when: false
|
2017-08-22 22:43:01 +08:00
|
|
|
|
2018-11-12 20:21:26 +08:00
|
|
|
tasks:
|
2019-02-12 21:03:39 +08:00
|
|
|
- name: stop non-containerized ceph rgw(s)
|
|
|
|
service:
|
2021-03-03 22:43:50 +08:00
|
|
|
name: "ceph-radosgw@rgw.{{ ansible_facts['hostname'] }}.{{ item.instance_name }}"
|
2019-02-12 21:03:39 +08:00
|
|
|
state: stopped
|
|
|
|
enabled: no
|
|
|
|
with_items: "{{ rgw_instances }}"
|
|
|
|
|
2020-08-04 01:03:34 +08:00
|
|
|
- name: remove old systemd unit files
|
2019-02-12 21:03:39 +08:00
|
|
|
file:
|
2020-09-15 21:46:30 +08:00
|
|
|
path: "{{ item }}"
|
2019-02-12 21:03:39 +08:00
|
|
|
state: absent
|
2020-08-04 01:03:34 +08:00
|
|
|
with_items:
|
2020-09-15 21:46:30 +08:00
|
|
|
- /usr/lib/systemd/system/ceph-radosgw@.service
|
|
|
|
- /usr/lib/systemd/system/ceph-radosgw.target
|
|
|
|
- /lib/systemd/system/ceph-radosgw@.service
|
|
|
|
- /lib/systemd/system/ceph-radosgw.target
|
2019-02-12 21:03:39 +08:00
|
|
|
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-handler
|
|
|
|
|
2019-05-20 15:46:10 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-container-engine
|
|
|
|
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
2018-10-19 23:07:55 +08:00
|
|
|
name: ceph-container-common
|
2018-10-01 23:43:24 +08:00
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-rgw
|
2016-09-14 23:53:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
- name: switching from non-containerized to containerized ceph rbd-mirror
|
|
|
|
|
2019-04-01 23:46:15 +08:00
|
|
|
hosts: "{{ rbdmirror_group_name|default('rbdmirrors') }}"
|
2016-09-14 23:53:30 +08:00
|
|
|
|
2017-08-25 20:36:07 +08:00
|
|
|
vars:
|
|
|
|
containerized_deployment: true
|
|
|
|
rbdmirror_group_name: rbdmirrors
|
|
|
|
|
2016-09-14 23:53:30 +08:00
|
|
|
serial: 1
|
|
|
|
become: true
|
2018-11-12 20:21:26 +08:00
|
|
|
pre_tasks:
|
2022-08-02 02:18:50 +08:00
|
|
|
- name: check for ceph rbd mirror services
|
2022-10-15 01:33:26 +08:00
|
|
|
command: systemctl show --no-pager --property=Id ceph-rbd-mirror@* # noqa 303
|
2022-08-02 02:18:50 +08:00
|
|
|
changed_when: false
|
|
|
|
register: rbdmirror_services
|
|
|
|
|
2017-08-22 22:43:01 +08:00
|
|
|
- name: stop non-containerized ceph rbd mirror(s)
|
|
|
|
service:
|
2022-08-02 02:18:50 +08:00
|
|
|
name: "{{ item.split('=')[1] }}"
|
2017-08-22 22:43:01 +08:00
|
|
|
state: stopped
|
|
|
|
enabled: no
|
2022-10-17 16:20:21 +08:00
|
|
|
ignore_errors: true
|
2022-08-02 02:18:50 +08:00
|
|
|
loop: "{{ rbdmirror_services.stdout_lines }}"
|
2017-08-22 22:43:01 +08:00
|
|
|
|
2019-02-12 17:56:28 +08:00
|
|
|
- name: remove old systemd unit files
|
|
|
|
file:
|
2020-09-15 21:46:30 +08:00
|
|
|
path: "{{ item }}"
|
2019-02-12 17:56:28 +08:00
|
|
|
state: absent
|
|
|
|
with_items:
|
2020-09-15 21:46:30 +08:00
|
|
|
- /usr/lib/systemd/system/ceph-rbd-mirror@.service
|
|
|
|
- /usr/lib/systemd/system/ceph-rbd-mirror.target
|
|
|
|
- /lib/systemd/system/ceph-rbd-mirror@.service
|
|
|
|
- /lib/systemd/system/ceph-rbd-mirror.target
|
2019-02-12 17:56:28 +08:00
|
|
|
|
2019-10-07 17:08:44 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
2016-09-14 23:53:30 +08:00
|
|
|
|
2019-10-07 17:08:44 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-facts
|
2017-08-22 22:43:01 +08:00
|
|
|
|
2019-10-07 15:19:50 +08:00
|
|
|
# NOTE: changed from file module to raw find command for performance reasons
|
2019-08-11 03:44:32 +08:00
|
|
|
# The file module has to run checks on current ownership of all directories and files. This is unnecessary
|
|
|
|
# as in this case we know we want all owned by ceph user
|
2017-08-22 22:43:01 +08:00
|
|
|
- name: set proper ownership on ceph directories
|
2019-10-07 15:19:50 +08:00
|
|
|
command: "find /var/lib/ceph /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown {{ ceph_uid }}:{{ ceph_uid }} {} +"
|
2019-08-11 03:44:32 +08:00
|
|
|
changed_when: false
|
2017-08-22 22:43:01 +08:00
|
|
|
|
2018-11-12 20:21:26 +08:00
|
|
|
tasks:
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-handler
|
|
|
|
|
2019-05-20 15:46:10 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-container-engine
|
|
|
|
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
2018-10-19 23:07:55 +08:00
|
|
|
name: ceph-container-common
|
2018-10-01 23:43:24 +08:00
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-rbd-mirror
|
2016-09-14 23:53:30 +08:00
|
|
|
|
|
|
|
|
|
|
|
- name: switching from non-containerized to containerized ceph nfs
|
|
|
|
|
2019-04-01 23:46:15 +08:00
|
|
|
hosts: "{{ nfs_group_name|default('nfss') }}"
|
2016-09-14 23:53:30 +08:00
|
|
|
|
2017-08-25 20:36:07 +08:00
|
|
|
vars:
|
|
|
|
containerized_deployment: true
|
|
|
|
nfs_group_name: nfss
|
|
|
|
|
2016-09-14 23:53:30 +08:00
|
|
|
serial: 1
|
|
|
|
become: true
|
2018-11-12 20:21:26 +08:00
|
|
|
pre_tasks:
|
2016-09-14 23:53:30 +08:00
|
|
|
|
2018-01-06 02:42:16 +08:00
|
|
|
# failed_when: false is here because if we're
|
|
|
|
# working with a jewel cluster then ceph nfs
|
|
|
|
# will not exist
|
2017-08-22 22:43:01 +08:00
|
|
|
- name: stop non-containerized ceph nfs(s)
|
|
|
|
service:
|
2017-09-09 01:28:52 +08:00
|
|
|
name: nfs-ganesha
|
2017-08-22 22:43:01 +08:00
|
|
|
state: stopped
|
|
|
|
enabled: no
|
2018-01-06 02:42:16 +08:00
|
|
|
failed_when: false
|
2017-08-22 22:43:01 +08:00
|
|
|
|
2019-10-07 17:08:44 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
2017-08-22 22:43:01 +08:00
|
|
|
|
2019-10-07 17:08:44 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-facts
|
2017-08-22 22:43:01 +08:00
|
|
|
|
2019-10-07 15:19:50 +08:00
|
|
|
# NOTE: changed from file module to raw find command for performance reasons
|
2019-08-11 03:44:32 +08:00
|
|
|
# The file module has to run checks on current ownership of all directories and files. This is unnecessary
|
|
|
|
# as in this case we know we want all owned by ceph user
|
2017-08-22 22:43:01 +08:00
|
|
|
- name: set proper ownership on ceph directories
|
2019-10-07 15:19:50 +08:00
|
|
|
command: "find /var/lib/ceph /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown {{ ceph_uid }}:{{ ceph_uid }} {} +"
|
2019-08-11 03:44:32 +08:00
|
|
|
changed_when: false
|
2017-08-22 22:43:01 +08:00
|
|
|
|
2018-11-12 20:21:26 +08:00
|
|
|
tasks:
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-handler
|
|
|
|
|
2019-05-20 15:46:10 +08:00
|
|
|
- import_role:
|
|
|
|
name: ceph-container-engine
|
|
|
|
|
2018-10-01 23:43:24 +08:00
|
|
|
- import_role:
|
2018-10-19 23:07:55 +08:00
|
|
|
name: ceph-container-common
|
2018-10-01 23:43:24 +08:00
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-nfs
|
2020-07-03 16:21:49 +08:00
|
|
|
|
2021-04-07 20:36:28 +08:00
|
|
|
- name: switching from non-containerized to containerized iscsigws
|
|
|
|
hosts: "{{ iscsi_gw_group_name|default('iscsigws') }}"
|
|
|
|
vars:
|
|
|
|
containerized_deployment: true
|
|
|
|
iscsi_gw_group_name: iscsigws
|
|
|
|
become: true
|
|
|
|
serial: 1
|
|
|
|
pre_tasks:
|
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
|
|
|
|
|
|
|
- name: stop iscsigw services
|
|
|
|
service:
|
|
|
|
name: "{{ item }}"
|
|
|
|
state: stopped
|
|
|
|
enabled: no
|
|
|
|
with_items:
|
|
|
|
- tcmu-runner
|
|
|
|
- rbd-target-gw
|
|
|
|
- rbd-target-api
|
|
|
|
|
|
|
|
- name: remove old systemd unit files
|
|
|
|
file:
|
|
|
|
path: "/usr/lib/systemd/system/{{ item }}.service"
|
|
|
|
state: absent
|
|
|
|
with_items:
|
|
|
|
- tcmu-runner
|
|
|
|
- rbd-target-gw
|
|
|
|
- rbd-target-api
|
|
|
|
tasks:
|
|
|
|
- import_role:
|
|
|
|
name: ceph-facts
|
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-handler
|
|
|
|
|
|
|
|
# NOTE: changed from file module to raw find command for performance reasons
|
|
|
|
# The file module has to run checks on current ownership of all directories and files. This is unnecessary
|
|
|
|
# as in this case we know we want all owned by ceph user
|
|
|
|
- name: set proper ownership on ceph directories
|
|
|
|
command: "find /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown -h {{ ceph_uid }}:{{ ceph_uid }} {} +"
|
|
|
|
changed_when: false
|
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-container-engine
|
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-container-common
|
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-iscsi-gw
|
|
|
|
|
2020-07-03 16:21:49 +08:00
|
|
|
- name: switching from non-containerized to containerized ceph-crash
|
|
|
|
|
|
|
|
hosts:
|
|
|
|
- "{{ mon_group_name | default('mons') }}"
|
|
|
|
- "{{ osd_group_name | default('osds') }}"
|
|
|
|
- "{{ mds_group_name | default('mdss') }}"
|
|
|
|
- "{{ rgw_group_name | default('rgws') }}"
|
|
|
|
- "{{ rbdmirror_group_name | default('rbdmirrors') }}"
|
|
|
|
- "{{ mgr_group_name | default('mgrs') }}"
|
|
|
|
|
|
|
|
vars:
|
|
|
|
containerized_deployment: true
|
|
|
|
become: true
|
|
|
|
tasks:
|
|
|
|
- name: stop non-containerized ceph-crash
|
|
|
|
service:
|
|
|
|
name: ceph-crash
|
|
|
|
state: stopped
|
|
|
|
enabled: no
|
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-facts
|
|
|
|
tasks_from: container_binary.yml
|
|
|
|
|
|
|
|
- import_role:
|
|
|
|
name: ceph-handler
|
|
|
|
|
|
|
|
- import_role:
|
2021-04-09 15:24:05 +08:00
|
|
|
name: ceph-crash
|
|
|
|
|
|
|
|
- name: final task
|
|
|
|
hosts:
|
|
|
|
- "{{ mon_group_name|default('mons') }}"
|
|
|
|
- "{{ mgr_group_name|default('mgrs') }}"
|
|
|
|
- "{{ osd_group_name|default('osds') }}"
|
|
|
|
- "{{ mds_group_name|default('mdss') }}"
|
|
|
|
- "{{ rgw_group_name|default('rgws') }}"
|
|
|
|
vars:
|
|
|
|
containerized_deployment: true
|
|
|
|
become: true
|
|
|
|
tasks:
|
|
|
|
- import_role:
|
|
|
|
name: ceph-defaults
|
|
|
|
# NOTE: changed from file module to raw find command for performance reasons
|
|
|
|
# The file module has to run checks on current ownership of all directories and files. This is unnecessary
|
|
|
|
# as in this case we know we want all owned by ceph user
|
|
|
|
- name: set proper ownership on ceph directories
|
|
|
|
command: "find /var/lib/ceph /etc/ceph -not -( -user {{ ceph_uid }} -or -group {{ ceph_uid }} -) -execdir chown {{ ceph_uid }}:{{ ceph_uid }} {} +"
|
2021-07-26 23:10:19 +08:00
|
|
|
changed_when: false
|