2020-07-03 16:21:49 +08:00
|
|
|
---
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Create and copy client.crash keyring
|
2020-07-03 16:21:49 +08:00
|
|
|
when: cephx | bool
|
|
|
|
block:
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Create client.crash keyring
|
2020-07-03 16:21:49 +08:00
|
|
|
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 }}"
|
2024-02-14 18:14:02 +08:00
|
|
|
import_key: true
|
2020-07-03 16:21:49 +08:00
|
|
|
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] }}"
|
2024-02-14 18:14:02 +08:00
|
|
|
run_once: true
|
2021-08-09 20:57:33 +08:00
|
|
|
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
2020-07-03 16:21:49 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- 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
|
2021-08-09 20:57:33 +08:00
|
|
|
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
2020-07-03 16:21:49 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Copy ceph key(s) if needed
|
|
|
|
ansible.builtin.copy:
|
2020-07-03 16:21:49 +08:00
|
|
|
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-08-09 20:57:33 +08:00
|
|
|
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
2020-07-03 16:21:49 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Start ceph-crash daemon
|
2020-07-03 16:21:49 +08:00
|
|
|
when: containerized_deployment | bool
|
|
|
|
block:
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Create /var/lib/ceph/crash/posted
|
|
|
|
ansible.builtin.file:
|
2020-07-03 16:21:49 +08:00
|
|
|
path: /var/lib/ceph/crash/posted
|
|
|
|
state: directory
|
|
|
|
mode: '0755'
|
|
|
|
owner: "{{ ceph_uid }}"
|
|
|
|
group: "{{ ceph_uid }}"
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Include_tasks systemd.yml
|
|
|
|
ansible.builtin.include_tasks: systemd.yml
|
2020-07-03 16:21:49 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Start the ceph-crash service
|
|
|
|
ansible.builtin.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
|
2024-02-14 18:14:02 +08:00
|
|
|
enabled: true
|
|
|
|
masked: false
|
|
|
|
daemon_reload: true
|