diff --git a/dashboard.yml b/dashboard.yml index e998e1e539..e22eee5798 100644 --- a/dashboard.yml +++ b/dashboard.yml @@ -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: diff --git a/roles/ceph-defaults/defaults/main.yml b/roles/ceph-defaults/defaults/main.yml index eb34908c87..d6f578f17b 100644 --- a/roles/ceph-defaults/defaults/main.yml +++ b/roles/ceph-defaults/defaults/main.yml @@ -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 diff --git a/roles/ceph-prometheus/templates/alertmanager.yml.j2 b/roles/ceph-prometheus/templates/alertmanager.yml.j2 index 63dfbf7014..97eefc1218 100644 --- a/roles/ceph-prometheus/templates/alertmanager.yml.j2 +++ b/roles/ceph-prometheus/templates/alertmanager.yml.j2 @@ -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: diff --git a/roles/ceph-prometheus/templates/prometheus.yml.j2 b/roles/ceph-prometheus/templates/prometheus.yml.j2 index 2476495bb5..a37175c47f 100644 --- a/roles/ceph-prometheus/templates/prometheus.yml.j2 +++ b/roles/ceph-prometheus/templates/prometheus.yml.j2 @@ -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'] }}"