2020-07-03 16:21:49 +08:00
|
|
|
---
|
|
|
|
- name: create and copy client.crash keyring
|
|
|
|
when: cephx | bool
|
|
|
|
block:
|
|
|
|
- name: create client.crash keyring
|
|
|
|
ceph_key:
|
|
|
|
name: "client.crash"
|
2020-10-19 22:57:53 +08:00
|
|
|
caps:
|
|
|
|
mon: 'allow profile crash'
|
|
|
|
mgr: 'allow profile crash'
|
2020-07-03 16:21:49 +08:00
|
|
|
cluster: "{{ cluster }}"
|
|
|
|
dest: "{{ ceph_conf_key_directory }}"
|
|
|
|
import_key: True
|
|
|
|
mode: "{{ ceph_keyring_permissions }}"
|
2020-09-26 00:15:02 +08:00
|
|
|
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
|
|
|
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
2020-07-03 16:21:49 +08:00
|
|
|
environment:
|
2020-09-26 00:15:02 +08:00
|
|
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
|
2020-07-03 16:21:49 +08:00
|
|
|
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
|
|
|
delegate_to: "{{ groups.get(mon_group_name, [])[0] }}"
|
|
|
|
run_once: True
|
|
|
|
|
|
|
|
- name: get keys from monitors
|
2020-10-24 03:19:53 +08:00
|
|
|
ceph_key:
|
|
|
|
name: client.crash
|
|
|
|
cluster: "{{ cluster }}"
|
|
|
|
output_format: plain
|
|
|
|
state: info
|
|
|
|
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-07-03 16:21:49 +08:00
|
|
|
register: _crash_keys
|
|
|
|
delegate_to: "{{ groups.get(mon_group_name)[0] }}"
|
|
|
|
run_once: true
|
|
|
|
|
|
|
|
- name: copy ceph key(s) if needed
|
|
|
|
copy:
|
|
|
|
dest: "{{ ceph_conf_key_directory }}/{{ cluster }}.client.crash.keyring"
|
|
|
|
content: "{{ _crash_keys.stdout + '\n' }}"
|
2020-09-26 00:15:02 +08:00
|
|
|
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
|
|
|
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
2020-07-03 16:21:49 +08:00
|
|
|
mode: "{{ ceph_keyring_permissions }}"
|
2021-05-20 14:04:02 +08:00
|
|
|
no_log: true
|
2020-07-03 16:21:49 +08:00
|
|
|
|
|
|
|
- name: start ceph-crash daemon
|
|
|
|
when: containerized_deployment | bool
|
|
|
|
block:
|
|
|
|
- name: create /var/lib/ceph/crash/posted
|
|
|
|
file:
|
|
|
|
path: /var/lib/ceph/crash/posted
|
|
|
|
state: directory
|
|
|
|
mode: '0755'
|
|
|
|
owner: "{{ ceph_uid }}"
|
|
|
|
group: "{{ ceph_uid }}"
|
|
|
|
|
|
|
|
- name: include_tasks systemd.yml
|
|
|
|
include_tasks: systemd.yml
|
|
|
|
|
|
|
|
- name: start the ceph-crash service
|
|
|
|
systemd:
|
2021-03-03 22:43:50 +08:00
|
|
|
name: "{{ 'ceph-crash@' + ansible_facts['hostname'] if containerized_deployment | bool else 'ceph-crash.service' }}"
|
2020-07-03 16:21:49 +08:00
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
masked: no
|
2020-09-01 17:24:59 +08:00
|
|
|
daemon_reload: yes
|