Skip to content

Commit

Permalink
Replace hardcoded groupname with groupname variable
Browse files Browse the repository at this point in the history
  • Loading branch information
gael-api committed Oct 2, 2024
1 parent 9f64b52 commit 0bf0581
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dashboard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
# using groups[] here otherwise it can't fallback to the mon if there's no mgr group.
# adding an additional | default(omit) in case where no monitors are present (external ceph cluster)
- name: Deploy dashboard
hosts: "{{ groups['mgrs'] | default(groups['mons']) | default(omit) }}"
hosts: "{{ groups[mgr_group_name] | default(groups[mon_group_name]) | default(omit) }}"
gather_facts: false
become: true
pre_tasks:
Expand Down
2 changes: 1 addition & 1 deletion roles/ceph-prometheus/templates/alertmanager.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ route:
receivers:
- name: 'ceph-dashboard'
webhook_configs:
{% for host in groups['mgrs'] | default(groups['mons']) %}
{% for host in groups[mgr_group_name] | default(groups[mon_group_name]) %}
- url: '{{ dashboard_protocol }}://{{ hostvars[host]['ansible_facts']['fqdn'] }}:{{ dashboard_port }}/api/prometheus_receiver'
{% if dashboard_protocol == 'https' and alertmanager_dashboard_api_no_ssl_verify | bool %}
http_config:
Expand Down
2 changes: 1 addition & 1 deletion roles/ceph-prometheus/templates/prometheus.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ scrape_configs:
{% endfor %}
- job_name: 'node'
static_configs:
{% for host in (groups['all'] | difference(groups[monitoring_group_name] | union(groups.get(client_group_name, []))) | union(groups.get(osd_group_name, []))) %}
{% for host in (groups[all_group_name] | difference(groups[monitoring_group_name] | union(groups.get(client_group_name, []))) | union(groups.get(osd_group_name, []))) %}
- targets: ['{{ host }}:{{ node_exporter_port }}']
labels:
instance: "{{ hostvars[host]['ansible_facts']['nodename'] }}"
Expand Down

0 comments on commit 0bf0581

Please sign in to comment.