deep_scrub_choked
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
---
|
||||
###########
|
||||
# GENERAL #
|
||||
###########
|
||||
|
||||
ceph_exporter_addr: "0.0.0.0"
|
||||
ceph_exporter_port: 9926
|
||||
ceph_exporter_stats_period: 5 # seconds
|
||||
ceph_exporter_prio_limit: 5
|
||||
|
||||
##########
|
||||
# DOCKER #
|
||||
##########
|
||||
|
||||
# If you want to add parameters, you should retain the existing ones and include the new ones.
|
||||
ceph_exporter_container_params:
|
||||
args:
|
||||
- -f
|
||||
- -n=client.ceph-exporter
|
||||
- --sock-dir=/var/run/ceph
|
||||
- --addrs={{ ceph_exporter_addr }}
|
||||
- --port={{ ceph_exporter_port }}
|
||||
- --stats-period={{ ceph_exporter_stats_period }}
|
||||
- --prio-limit={{ ceph_exporter_prio_limit }}
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
galaxy_info:
|
||||
company: Red Hat
|
||||
author: Guillaume Abrioux
|
||||
description: Deploy ceph-exporter
|
||||
license: Apache
|
||||
min_ansible_version: '2.7'
|
||||
platforms:
|
||||
- name: EL
|
||||
versions:
|
||||
- 'all'
|
||||
galaxy_tags:
|
||||
- system
|
||||
dependencies: []
|
||||
@@ -0,0 +1,58 @@
|
||||
---
|
||||
- name: Create and copy client.ceph-exporter keyring
|
||||
when: cephx | bool
|
||||
block:
|
||||
- name: Create client.ceph-exporter keyring
|
||||
ceph_key:
|
||||
name: "client.ceph-exporter"
|
||||
caps:
|
||||
mon: 'allow r'
|
||||
mgr: 'allow r'
|
||||
osd: 'allow r'
|
||||
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.ceph-exporter
|
||||
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: _exporter_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.ceph-exporter.keyring"
|
||||
content: "{{ _exporter_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: Include_tasks systemd.yml
|
||||
ansible.builtin.include_tasks: systemd.yml
|
||||
when: containerized_deployment | bool
|
||||
|
||||
- name: Start the ceph-exporter service
|
||||
ansible.builtin.systemd:
|
||||
name: "{{ 'ceph-exporter@' + ansible_facts['hostname'] if containerized_deployment | bool else 'ceph-exporter.service' }}"
|
||||
state: started
|
||||
enabled: true
|
||||
masked: false
|
||||
daemon_reload: true
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
- name: Generate systemd unit file for ceph-exporter container
|
||||
ansible.builtin.template:
|
||||
src: "{{ role_path }}/templates/ceph-exporter.service.j2"
|
||||
dest: /etc/systemd/system/ceph-exporter@.service
|
||||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
notify: Restart ceph exporter
|
||||
@@ -0,0 +1,50 @@
|
||||
[Unit]
|
||||
Description=Ceph exporter
|
||||
{% 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-exporter-%i
|
||||
{% endif %}
|
||||
ExecStartPre=-/usr/bin/{{ container_binary }} rm -f ceph-exporter-%i
|
||||
ExecStart=/usr/bin/{{ container_binary }} run --rm --name ceph-exporter-%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 \
|
||||
{% for v in ceph_common_container_params['volumes'] + ceph_exporter_container_params['volumes'] | default([]) %}
|
||||
-v {{ v }} \
|
||||
{% endfor %}
|
||||
{% for k, v in (ceph_common_container_params['envs'] | combine(ceph_exporter_container_params['envs'] | default({}))).items() %}
|
||||
-e {{ k }}={{ v }} \
|
||||
{% endfor %}
|
||||
--entrypoint=/usr/bin/ceph-exporter {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} \
|
||||
{{ (ceph_common_container_params['args'] + ceph_exporter_container_params['args'] | default([])) | join(' ') }}
|
||||
{% 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-exporter-%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