Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard: replace hardcoded groupname with groupname variable #7607

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
1 change: 1 addition & 0 deletions roles/ceph-defaults/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ ceph_release_num:
cluster: ceph

# Inventory host group variables
all_group_name: all # useful if runned against a global inventory that includes non-ceph hosts
mon_group_name: mons
osd_group_name: osds
rgw_group_name: rgws
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