deep_scrub_choked
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
---
|
||||
galaxy_info:
|
||||
company: Red Hat
|
||||
author: Guillaume Abrioux
|
||||
description: Deploy ceph-crash
|
||||
license: Apache
|
||||
min_ansible_version: '2.7'
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- 'all'
|
||||
galaxy_tags:
|
||||
- system
|
||||
dependencies: []
|
||||
@@ -0,0 +1,67 @@
|
||||
---
|
||||
- name: Create and copy client.crash keyring
|
||||
when: cephx | bool
|
||||
block:
|
||||
- name: Create client.crash keyring
|
||||
ceph_key:
|
||||
name: "client.crash"
|
||||
caps:
|
||||
mon: 'allow profile crash'
|
||||
mgr: 'allow profile crash'
|
||||
cluster: "{{ cluster }}"
|
||||
dest: "{{ ceph_conf_key_directory }}"
|
||||
import_key: true
|
||||
mode: "{{ ceph_keyring_permissions }}"
|
||||
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||
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 }}"
|
||||
delegate_to: "{{ groups.get(mon_group_name, [])[0] }}"
|
||||
run_once: true
|
||||
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
||||
|
||||
- name: Get keys from monitors
|
||||
ceph_key_info:
|
||||
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 }}"
|
||||
register: _crash_keys
|
||||
delegate_to: "{{ groups.get(mon_group_name)[0] }}"
|
||||
run_once: true
|
||||
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
||||
|
||||
- name: Copy ceph key(s) if needed
|
||||
ansible.builtin.copy:
|
||||
dest: "{{ ceph_conf_key_directory }}/{{ cluster }}.client.crash.keyring"
|
||||
content: "{{ _crash_keys.stdout + '\n' }}"
|
||||
owner: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||
group: "{{ ceph_uid if containerized_deployment | bool else 'ceph' }}"
|
||||
mode: "{{ ceph_keyring_permissions }}"
|
||||
no_log: "{{ no_log_on_ceph_key_tasks }}"
|
||||
|
||||
- name: Start ceph-crash daemon
|
||||
when: containerized_deployment | bool
|
||||
block:
|
||||
- name: Create /var/lib/ceph/crash/posted
|
||||
ansible.builtin.file:
|
||||
path: /var/lib/ceph/crash/posted
|
||||
state: directory
|
||||
mode: '0755'
|
||||
owner: "{{ ceph_uid }}"
|
||||
group: "{{ ceph_uid }}"
|
||||
|
||||
- name: Include_tasks systemd.yml
|
||||
ansible.builtin.include_tasks: systemd.yml
|
||||
|
||||
- name: Start the ceph-crash service
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ 'ceph-crash@' + ansible_facts['hostname'] if containerized_deployment | bool else 'ceph-crash.service' }}"
|
||||
state: started
|
||||
enabled: true
|
||||
masked: false
|
||||
daemon_reload: true
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
- name: Generate systemd unit file for ceph-crash container
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/ceph-crash.service.j2"
|
||||
dest: /etc/systemd/system/ceph-crash@.service
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
notify: Restart ceph crash
|
||||
@@ -0,0 +1,52 @@
|
||||
[Unit]
|
||||
Description=Ceph crash dump collector
|
||||
{% if container_binary == 'docker' %}
|
||||
After=docker.service network-online.target local-fs.target time-sync.target
|
||||
Requires=docker.service
|
||||
{% else %}
|
||||
After=network-online.target local-fs.target time-sync.target
|
||||
{% endif %}
|
||||
Wants=network-online.target local-fs.target time-sync.target
|
||||
|
||||
[Service]
|
||||
{% if container_binary == 'podman' %}
|
||||
ExecStartPre=-/usr/bin/rm -f /%t/%n-pid /%t/%n-cid
|
||||
ExecStartPre=-/usr/bin/{{ container_binary }} rm --storage ceph-crash-%i
|
||||
{% endif %}
|
||||
ExecStartPre=-/usr/bin/{{ container_binary }} rm -f ceph-crash-%i
|
||||
ExecStart=/usr/bin/{{ container_binary }} run --rm --name ceph-crash-%i \
|
||||
{% if container_binary == 'podman' %}
|
||||
-d --log-driver journald --conmon-pidfile /%t/%n-pid --cidfile /%t/%n-cid \
|
||||
{% endif %}
|
||||
--pids-limit={{ 0 if container_binary == 'podman' else -1 }} \
|
||||
--security-opt label=disable \
|
||||
--net=host \
|
||||
{% if cluster != 'ceph' %}
|
||||
-e CEPH_ARGS="--cluster {{ cluster }}" \
|
||||
{% endif %}
|
||||
{% for v in ceph_common_container_params['volumes'] %}
|
||||
-v {{ v }} \
|
||||
{% endfor %}
|
||||
{% for k, v in ceph_common_container_params['envs'].items() %}
|
||||
-e {{ k }}={{ v }} \
|
||||
{% endfor %}
|
||||
--entrypoint=/usr/bin/ceph-crash {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
|
||||
{% if container_binary == 'podman' %}
|
||||
ExecStop=-/usr/bin/sh -c "/usr/bin/{{ container_binary }} rm -f `cat /%t/%n-cid`"
|
||||
{% else %}
|
||||
ExecStop=-/usr/bin/{{ container_binary }} stop ceph-crash-%i
|
||||
{% endif %}
|
||||
StartLimitInterval=10min
|
||||
StartLimitBurst=30
|
||||
{% if container_binary == 'podman' %}
|
||||
Type=forking
|
||||
PIDFile=/%t/%n-pid
|
||||
{% endif %}
|
||||
KillMode=none
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
TimeoutStartSec=120
|
||||
TimeoutStopSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=ceph.target
|
||||
Reference in New Issue
Block a user