ceph / ceph/cephmetrics

Replacing usage of group 'all' by dynamic generated group containing all ceph groups

Open
#247 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
66
Forks
29
PR merge metrics
No merged PRs in 30d

Description

Scenario:
- using the inventory which contains more groups that might be not directly part of ceph deployment

Result:
- the prometheus.yml templated on the host will have additional non-ceph host in the `node` section
- if the non-ceph host will be not available for some reason the cephmetrics deployment will fail on the first gather_facts playbook

Those are caused by the line the https://github.com/ceph/cephmetrics/blob/master/ansible/roles/ceph-prometheus/templates/prometheus.yml#L19:
```
{% for host in (groups['all'] | difference(groups['ceph-grafana'])) %}
```
and the playbook where the facts are gathered for `all` group https://github.com/ceph/cephmetrics/blob/e5873d512c98774a758b24375479ae27da57d345/ansible/playbook.yml#L2:L6
```
- hosts: all
gather_facts: true
any_errors_fatal: true
tags:
- always
```
I think the usage of group "all" here can be replaced by using some dynamic inventory. This approach would allow to have the other hosts in the inventory and would made the prometheus.yml template more precise.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with ansible/roles/ceph-prometheus/templates/prometheus.yml and ansible/playbook.yml, focusing on the groups used for Prometheus nodes and fact gathering. Inspect how the inventory defines Ceph hosts and how a dynamic group could represent them. Done means unrelated inventory hosts are excluded from the generated node section and are not included in the all-host fact-gathering play.

Written by the indexing model from the issue text.

Assessment

Tech stack
ansible
Domain
devops, observability-sre
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.