mirror of https://github.com/ceph/ceph-ansible.git
defaults: change default grafana-server name
This change default value of grafana-server group name. Adding some tasks in ceph-defaults in order to keep backward compatibility. Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>pull/5821/head
parent
902575369c
commit
eefe11d90c
|
@ -60,7 +60,7 @@ ansible_provision = proc do |ansible|
|
||||||
'clients' => (0..CLIENTS - 1).map { |j| "#{LABEL_PREFIX}client#{j}" },
|
'clients' => (0..CLIENTS - 1).map { |j| "#{LABEL_PREFIX}client#{j}" },
|
||||||
'iscsigws' => (0..NISCSI_GWS - 1).map { |j| "#{LABEL_PREFIX}iscsi_gw#{j}" },
|
'iscsigws' => (0..NISCSI_GWS - 1).map { |j| "#{LABEL_PREFIX}iscsi_gw#{j}" },
|
||||||
'mgrs' => (0..MGRS - 1).map { |j| "#{LABEL_PREFIX}mgr#{j}" },
|
'mgrs' => (0..MGRS - 1).map { |j| "#{LABEL_PREFIX}mgr#{j}" },
|
||||||
'grafana-server' => (0..GRAFANA - 1).map { |j| "#{LABEL_PREFIX}grafana#{j}" }
|
'monitoring' => (0..GRAFANA - 1).map { |j| "#{LABEL_PREFIX}grafana#{j}" }
|
||||||
}
|
}
|
||||||
|
|
||||||
ansible.extra_vars = {
|
ansible.extra_vars = {
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
status: "Complete"
|
status: "Complete"
|
||||||
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
end: "{{ lookup('pipe', 'date +%Y%m%d%H%M%SZ') }}"
|
||||||
|
|
||||||
- hosts: "{{ grafana_server_group_name }}"
|
- hosts: "{{ monitoring_group_name }}"
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
become: true
|
become: true
|
||||||
pre_tasks:
|
pre_tasks:
|
||||||
|
|
|
@ -57,7 +57,7 @@ dummy:
|
||||||
#iscsi_gw_group_name: iscsigws
|
#iscsi_gw_group_name: iscsigws
|
||||||
#mgr_group_name: mgrs
|
#mgr_group_name: mgrs
|
||||||
#rgwloadbalancer_group_name: rgwloadbalancers
|
#rgwloadbalancer_group_name: rgwloadbalancers
|
||||||
#grafana_server_group_name: grafana-server
|
#monitoring_group_name: monitoring
|
||||||
|
|
||||||
# If configure_firewall is true, then ansible will try to configure the
|
# If configure_firewall is true, then ansible will try to configure the
|
||||||
# appropriate firewalling rules so that Ceph daemons can communicate
|
# appropriate firewalling rules so that Ceph daemons can communicate
|
||||||
|
|
|
@ -57,7 +57,7 @@ fetch_directory: ~/ceph-ansible-keys
|
||||||
#iscsi_gw_group_name: iscsigws
|
#iscsi_gw_group_name: iscsigws
|
||||||
#mgr_group_name: mgrs
|
#mgr_group_name: mgrs
|
||||||
#rgwloadbalancer_group_name: rgwloadbalancers
|
#rgwloadbalancer_group_name: rgwloadbalancers
|
||||||
#grafana_server_group_name: grafana-server
|
#monitoring_group_name: monitoring
|
||||||
|
|
||||||
# If configure_firewall is true, then ansible will try to configure the
|
# If configure_firewall is true, then ansible will try to configure the
|
||||||
# appropriate firewalling rules so that Ceph daemons can communicate
|
# appropriate firewalling rules so that Ceph daemons can communicate
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
|
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
|
||||||
- "{{ nfs_group_name|default('nfss') }}"
|
- "{{ nfs_group_name|default('nfss') }}"
|
||||||
- "{{ iscsi_gw_group_name|default('iscsigws') }}"
|
- "{{ iscsi_gw_group_name|default('iscsigws') }}"
|
||||||
- "{{ grafana_server_group_name|default('grafana-server') }}"
|
- "{{ monitoring_group_name|default('monitoring') }}"
|
||||||
become: true
|
become: true
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
vars:
|
vars:
|
||||||
|
@ -818,7 +818,7 @@
|
||||||
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
||||||
|
|
||||||
- name: redeploy alertmanager/grafana/prometheus daemons
|
- name: redeploy alertmanager/grafana/prometheus daemons
|
||||||
hosts: "{{ grafana_server_group_name|default('grafana-server') }}"
|
hosts: "{{ monitoring_group_name|default('monitoring') }}"
|
||||||
serial: 1
|
serial: 1
|
||||||
become: true
|
become: true
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
|
@ -961,7 +961,7 @@
|
||||||
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
|
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
|
||||||
- "{{ nfs_group_name|default('nfss') }}"
|
- "{{ nfs_group_name|default('nfss') }}"
|
||||||
- "{{ iscsi_gw_group_name|default('iscsigws') }}"
|
- "{{ iscsi_gw_group_name|default('iscsigws') }}"
|
||||||
- "{{ grafana_server_group_name|default('grafana-server') }}"
|
- "{{ monitoring_group_name|default('monitoring') }}"
|
||||||
become: true
|
become: true
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
tasks:
|
tasks:
|
||||||
|
@ -1014,19 +1014,19 @@
|
||||||
when: dashboard_enabled | bool
|
when: dashboard_enabled | bool
|
||||||
block:
|
block:
|
||||||
- name: update the placement of alertmanager hosts
|
- name: update the placement of alertmanager hosts
|
||||||
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply alertmanager --placement='{{ groups.get(grafana_server_group_name, []) | length }} label:{{ grafana_server_group_name }}'"
|
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply alertmanager --placement='{{ groups.get(monitoring_group_name, []) | length }} label:{{ monitoring_group_name }}'"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
environment:
|
environment:
|
||||||
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
||||||
|
|
||||||
- name: update the placement of grafana hosts
|
- name: update the placement of grafana hosts
|
||||||
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply grafana --placement='{{ groups.get(grafana_server_group_name, []) | length }} label:{{ grafana_server_group_name }}'"
|
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply grafana --placement='{{ groups.get(monitoring_group_name, []) | length }} label:{{ monitoring_group_name }}'"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
environment:
|
environment:
|
||||||
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
||||||
|
|
||||||
- name: update the placement of prometheus hosts
|
- name: update the placement of prometheus hosts
|
||||||
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply prometheus --placement='{{ groups.get(grafana_server_group_name, []) | length }} label:{{ grafana_server_group_name }}'"
|
command: "{{ cephadm_cmd }} shell --fsid {{ fsid }} -- ceph --cluster {{ cluster }} orch apply prometheus --placement='{{ groups.get(monitoring_group_name, []) | length }} label:{{ monitoring_group_name }}'"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
environment:
|
environment:
|
||||||
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
|
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
|
||||||
- "{{ nfs_group_name|default('nfss') }}"
|
- "{{ nfs_group_name|default('nfss') }}"
|
||||||
- "{{ iscsi_gw_group_name|default('iscsigws') }}"
|
- "{{ iscsi_gw_group_name|default('iscsigws') }}"
|
||||||
- "{{ grafana_server_group_name|default('grafana-server') }}"
|
- "{{ monitoring_group_name|default('monitoring') }}"
|
||||||
become: true
|
become: true
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
vars:
|
vars:
|
||||||
|
@ -43,10 +43,10 @@
|
||||||
when: dashboard_enabled | bool
|
when: dashboard_enabled | bool
|
||||||
run_once: true
|
run_once: true
|
||||||
block:
|
block:
|
||||||
- name: fail if [grafana-server] group doesn't exist or empty
|
- name: fail if [monitoring] group doesn't exist or empty
|
||||||
fail:
|
fail:
|
||||||
msg: "you must add a [grafana-server] group and add at least one node."
|
msg: "you must add a [monitoring] group and add at least one node."
|
||||||
when: groups[grafana_server_group_name] is undefined or groups[grafana_server_group_name] | length == 0
|
when: groups[monitoring_group_name] is undefined or groups[monitoring_group_name] | length == 0
|
||||||
|
|
||||||
- name: fail when dashboard_admin_password is not set
|
- name: fail when dashboard_admin_password is not set
|
||||||
fail:
|
fail:
|
||||||
|
@ -197,7 +197,7 @@
|
||||||
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
|
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
|
||||||
- "{{ nfs_group_name|default('nfss') }}"
|
- "{{ nfs_group_name|default('nfss') }}"
|
||||||
- "{{ iscsi_gw_group_name|default('iscsigws') }}"
|
- "{{ iscsi_gw_group_name|default('iscsigws') }}"
|
||||||
- "{{ grafana_server_group_name|default('grafana-server') }}"
|
- "{{ monitoring_group_name|default('monitoring') }}"
|
||||||
become: true
|
become: true
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
tasks:
|
tasks:
|
||||||
|
@ -285,7 +285,7 @@
|
||||||
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
||||||
|
|
||||||
- name: adjust monitoring service placement
|
- name: adjust monitoring service placement
|
||||||
hosts: "{{ grafana_server_group_name|default('grafana-server') }}"
|
hosts: "{{ monitoring_group_name|default('monitoring') }}"
|
||||||
become: true
|
become: true
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
tasks:
|
tasks:
|
||||||
|
@ -304,19 +304,19 @@
|
||||||
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
||||||
|
|
||||||
- name: update the placement of alertmanager hosts
|
- name: update the placement of alertmanager hosts
|
||||||
command: "{{ cephadm_cmd }} shell -- ceph --cluster {{ cluster }} orch apply alertmanager --placement='label:{{ grafana_server_group_name }}'"
|
command: "{{ cephadm_cmd }} shell -- ceph --cluster {{ cluster }} orch apply alertmanager --placement='label:{{ monitoring_group_name }}'"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
environment:
|
environment:
|
||||||
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
||||||
|
|
||||||
- name: update the placement of grafana hosts
|
- name: update the placement of grafana hosts
|
||||||
command: "{{ cephadm_cmd }} shell -- ceph --cluster {{ cluster }} orch apply grafana --placement='label:{{ grafana_server_group_name }}'"
|
command: "{{ cephadm_cmd }} shell -- ceph --cluster {{ cluster }} orch apply grafana --placement='label:{{ monitoring_group_name }}'"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
environment:
|
environment:
|
||||||
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
||||||
|
|
||||||
- name: update the placement of prometheus hosts
|
- name: update the placement of prometheus hosts
|
||||||
command: "{{ cephadm_cmd }} shell -- ceph --cluster {{ cluster }} orch apply prometheus --placement='label:{{ grafana_server_group_name }}'"
|
command: "{{ cephadm_cmd }} shell -- ceph --cluster {{ cluster }} orch apply prometheus --placement='label:{{ monitoring_group_name }}'"
|
||||||
changed_when: false
|
changed_when: false
|
||||||
environment:
|
environment:
|
||||||
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
CEPHADM_IMAGE: '{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}'
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
- clients
|
- clients
|
||||||
- iscsigws
|
- iscsigws
|
||||||
- mgrs
|
- mgrs
|
||||||
- grafana-server
|
- monitoring
|
||||||
|
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
become: True
|
become: True
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
- "{{ mgr_group_name | default('mgrs') }}"
|
- "{{ mgr_group_name | default('mgrs') }}"
|
||||||
- "{{ iscsi_gw_group_name | default('iscsigws') }}"
|
- "{{ iscsi_gw_group_name | default('iscsigws') }}"
|
||||||
- "{{ rbdmirror_group_name | default('rbdmirrors') }}"
|
- "{{ rbdmirror_group_name | default('rbdmirrors') }}"
|
||||||
- "{{ grafana_server_group_name|default('grafana-server') }}"
|
- "{{ monitoring_group_name | default('monitoring') }}"
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
become: true
|
become: true
|
||||||
tasks:
|
tasks:
|
||||||
|
@ -117,7 +117,7 @@
|
||||||
- "{{ prometheus_container_image }}"
|
- "{{ prometheus_container_image }}"
|
||||||
when:
|
when:
|
||||||
- dashboard_enabled | bool
|
- dashboard_enabled | bool
|
||||||
- inventory_hostname in groups.get(grafana_server_group_name, [])
|
- inventory_hostname in groups.get(monitoring_group_name, [])
|
||||||
|
|
||||||
- name: "pulling {{ node_exporter_container_image }} image from docker daemon"
|
- name: "pulling {{ node_exporter_container_image }} image from docker daemon"
|
||||||
command: "{{ timeout_command }} {{ container_binary }} pull docker-daemon:{{ node_exporter_container_image }}"
|
command: "{{ timeout_command }} {{ container_binary }} pull docker-daemon:{{ node_exporter_container_image }}"
|
||||||
|
@ -193,17 +193,17 @@
|
||||||
- import_role:
|
- import_role:
|
||||||
name: ceph-facts
|
name: ceph-facts
|
||||||
tasks_from: grafana.yml
|
tasks_from: grafana.yml
|
||||||
when: inventory_hostname in groups.get(grafana_server_group_name, [])
|
when: inventory_hostname in groups.get(monitoring_group_name, [])
|
||||||
|
|
||||||
- import_role:
|
- import_role:
|
||||||
name: ceph-grafana
|
name: ceph-grafana
|
||||||
tasks_from: systemd.yml
|
tasks_from: systemd.yml
|
||||||
when: inventory_hostname in groups.get(grafana_server_group_name, [])
|
when: inventory_hostname in groups.get(monitoring_group_name, [])
|
||||||
|
|
||||||
- import_role:
|
- import_role:
|
||||||
name: ceph-prometheus
|
name: ceph-prometheus
|
||||||
tasks_from: systemd.yml
|
tasks_from: systemd.yml
|
||||||
when: inventory_hostname in groups.get(grafana_server_group_name, [])
|
when: inventory_hostname in groups.get(monitoring_group_name, [])
|
||||||
|
|
||||||
- name: reload systemd daemon
|
- name: reload systemd daemon
|
||||||
systemd:
|
systemd:
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
- "{{ nfs_group_name|default('nfss') }}"
|
- "{{ nfs_group_name|default('nfss') }}"
|
||||||
- "{{ client_group_name|default('clients') }}"
|
- "{{ client_group_name|default('clients') }}"
|
||||||
- "{{ mgr_group_name|default('mgrs') }}"
|
- "{{ mgr_group_name|default('mgrs') }}"
|
||||||
- grafana-server
|
- "{{ monitoring_group_name | default('monitoring') }}"
|
||||||
|
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@
|
||||||
- "{{ nfs_group_name|default('nfss') }}"
|
- "{{ nfs_group_name|default('nfss') }}"
|
||||||
- "{{ client_group_name|default('clients') }}"
|
- "{{ client_group_name|default('clients') }}"
|
||||||
- "{{ mgr_group_name|default('mgrs') }}"
|
- "{{ mgr_group_name|default('mgrs') }}"
|
||||||
- grafana-server
|
- "{{ monitoring_group_name|default('monitoring') }}"
|
||||||
- clients
|
- clients
|
||||||
- iscsigws
|
- iscsigws
|
||||||
|
|
||||||
|
@ -172,8 +172,8 @@
|
||||||
when: dashboard_enabled | bool
|
when: dashboard_enabled | bool
|
||||||
|
|
||||||
|
|
||||||
- name: purge ceph grafana-server
|
- name: purge ceph monitoring
|
||||||
hosts: grafana-server
|
hosts: monitoring
|
||||||
become: true
|
become: true
|
||||||
vars:
|
vars:
|
||||||
grafana_services:
|
grafana_services:
|
||||||
|
@ -690,7 +690,7 @@
|
||||||
- "{{ nfs_group_name|default('nfss') }}"
|
- "{{ nfs_group_name|default('nfss') }}"
|
||||||
- "{{ client_group_name|default('clients') }}"
|
- "{{ client_group_name|default('clients') }}"
|
||||||
- "{{ mgr_group_name|default('mgrs') }}"
|
- "{{ mgr_group_name|default('mgrs') }}"
|
||||||
- grafana-server
|
- "{{ monitoring_group_name|default('monitoring') }}"
|
||||||
|
|
||||||
gather_facts: false # Already gathered previously
|
gather_facts: false # Already gathered previously
|
||||||
|
|
||||||
|
|
|
@ -369,7 +369,7 @@
|
||||||
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
|
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
|
||||||
- "{{ nfs_group_name|default('nfss') }}"
|
- "{{ nfs_group_name|default('nfss') }}"
|
||||||
- "{{ mgr_group_name|default('mgrs') }}"
|
- "{{ mgr_group_name|default('mgrs') }}"
|
||||||
- grafana-server
|
- "{{ monitoring_group_name | default('monitoring') }}"
|
||||||
- iscsigws
|
- iscsigws
|
||||||
- clients
|
- clients
|
||||||
|
|
||||||
|
@ -407,7 +407,7 @@
|
||||||
|
|
||||||
- name: purge ceph-grafana
|
- name: purge ceph-grafana
|
||||||
|
|
||||||
hosts: grafana-server
|
hosts: monitoring
|
||||||
|
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
- "{{ nfs_group_name|default('nfss') }}"
|
- "{{ nfs_group_name|default('nfss') }}"
|
||||||
- "{{ client_group_name|default('clients') }}"
|
- "{{ client_group_name|default('clients') }}"
|
||||||
- "{{ iscsi_gw_group_name|default('iscsigws') }}"
|
- "{{ iscsi_gw_group_name|default('iscsigws') }}"
|
||||||
- "{{ grafana_server_group_name|default('grafana-server') }}"
|
- "{{ monitoring_group_name|default('monitoring') }}"
|
||||||
|
|
||||||
any_errors_fatal: True
|
any_errors_fatal: True
|
||||||
become: True
|
become: True
|
||||||
|
@ -898,7 +898,7 @@
|
||||||
name: ceph-node-exporter
|
name: ceph-node-exporter
|
||||||
|
|
||||||
- name: upgrade monitoring node
|
- name: upgrade monitoring node
|
||||||
hosts: "{{ grafana_server_group_name }}"
|
hosts: "{{ monitoring_group_name }}"
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
become: true
|
become: true
|
||||||
tasks:
|
tasks:
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
- name: get a list of node where the keyring should be copied
|
- name: get a list of node where the keyring should be copied
|
||||||
set_fact:
|
set_fact:
|
||||||
list_target_node: "{{ list_target_node | default([]) | union(((groups.get('all') | difference(groups.get(grafana_server_group_name, []) + groups.get(client_group_name, []) + groups.get(nfs_group_name, []) + groups.get(iscsi_gw_group_name, []))) + groups.get(item, [])) | unique) }}"
|
list_target_node: "{{ list_target_node | default([]) | union(((groups.get('all') | difference(groups.get(monitoring_group_name, []) + groups.get(client_group_name, []) + groups.get(nfs_group_name, []) + groups.get(iscsi_gw_group_name, []))) + groups.get(item, [])) | unique) }}"
|
||||||
run_once: True
|
run_once: True
|
||||||
with_items:
|
with_items:
|
||||||
- "{{ mon_group_name if groups.get(mon_group_name, []) | length > 0 else [] }}"
|
- "{{ mon_group_name if groups.get(mon_group_name, []) | length > 0 else [] }}"
|
||||||
|
|
|
@ -49,7 +49,7 @@ client_group_name: clients
|
||||||
iscsi_gw_group_name: iscsigws
|
iscsi_gw_group_name: iscsigws
|
||||||
mgr_group_name: mgrs
|
mgr_group_name: mgrs
|
||||||
rgwloadbalancer_group_name: rgwloadbalancers
|
rgwloadbalancer_group_name: rgwloadbalancers
|
||||||
grafana_server_group_name: grafana-server
|
monitoring_group_name: monitoring
|
||||||
|
|
||||||
# If configure_firewall is true, then ansible will try to configure the
|
# If configure_firewall is true, then ansible will try to configure the
|
||||||
# appropriate firewalling rules so that Ceph daemons can communicate
|
# appropriate firewalling rules so that Ceph daemons can communicate
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
---
|
---
|
|
@ -0,0 +1,16 @@
|
||||||
|
---
|
||||||
|
- name: convert grafana-server group name if exist
|
||||||
|
add_host:
|
||||||
|
name: "{{ item }}"
|
||||||
|
groups: "monitoring"
|
||||||
|
ansible_host: "{{ hostvars[item]['ansible_host'] | default(omit) }}"
|
||||||
|
ansible_port: "{{ hostvars[item]['ansible_port'] | default(omit) }}"
|
||||||
|
delegate_to: localhost
|
||||||
|
with_items: "{{ groups.get(grafana_server_group_name, []) }}"
|
||||||
|
when: groups.get(grafana_server_group_name, []) | length > 0
|
||||||
|
run_once: True
|
||||||
|
|
||||||
|
- name: set_fact monitoring_group_name
|
||||||
|
set_fact:
|
||||||
|
monitoring_group_name: "{{ grafana_server_group_name | default(monitoring_group_name) }}"
|
||||||
|
run_once: True
|
|
@ -2,34 +2,34 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}"
|
grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first }}"
|
||||||
when:
|
when:
|
||||||
- groups.get(grafana_server_group_name, []) | length > 0
|
- groups.get(monitoring_group_name, []) | length > 0
|
||||||
- ip_version == 'ipv4'
|
- ip_version == 'ipv4'
|
||||||
- dashboard_enabled | bool
|
- dashboard_enabled | bool
|
||||||
- inventory_hostname in groups[grafana_server_group_name]
|
- inventory_hostname in groups[monitoring_group_name]
|
||||||
|
|
||||||
- name: set grafana_server_addr fact - ipv6
|
- name: set grafana_server_addr fact - ipv6
|
||||||
set_fact:
|
set_fact:
|
||||||
grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap }}"
|
grafana_server_addr: "{{ hostvars[inventory_hostname]['ansible_all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap }}"
|
||||||
when:
|
when:
|
||||||
- groups.get(grafana_server_group_name, []) | length > 0
|
- groups.get(monitoring_group_name, []) | length > 0
|
||||||
- ip_version == 'ipv6'
|
- ip_version == 'ipv6'
|
||||||
- dashboard_enabled | bool
|
- dashboard_enabled | bool
|
||||||
- inventory_hostname in groups[grafana_server_group_name]
|
- inventory_hostname in groups[monitoring_group_name]
|
||||||
|
|
||||||
- name: set grafana_server_addrs fact - ipv4
|
- name: set grafana_server_addrs fact - ipv4
|
||||||
set_fact:
|
set_fact:
|
||||||
grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first]) | unique }}"
|
grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_all_ipv4_addresses'] | ips_in_ranges(public_network.split(',')) | first]) | unique }}"
|
||||||
with_items: "{{ groups.get(grafana_server_group_name, []) }}"
|
with_items: "{{ groups.get(monitoring_group_name, []) }}"
|
||||||
when:
|
when:
|
||||||
- groups.get(grafana_server_group_name, []) | length > 0
|
- groups.get(monitoring_group_name, []) | length > 0
|
||||||
- ip_version == 'ipv4'
|
- ip_version == 'ipv4'
|
||||||
- dashboard_enabled | bool
|
- dashboard_enabled | bool
|
||||||
|
|
||||||
- name: set grafana_server_addrs fact - ipv6
|
- name: set grafana_server_addrs fact - ipv6
|
||||||
set_fact:
|
set_fact:
|
||||||
grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap]) | unique }}"
|
grafana_server_addrs: "{{ (grafana_server_addrs | default([]) + [hostvars[item]['ansible_all_ipv6_addresses'] | ips_in_ranges(public_network.split(',')) | last | ipwrap]) | unique }}"
|
||||||
with_items: "{{ groups.get(grafana_server_group_name, []) }}"
|
with_items: "{{ groups.get(monitoring_group_name, []) }}"
|
||||||
when:
|
when:
|
||||||
- groups.get(grafana_server_group_name, []) | length > 0
|
- groups.get(monitoring_group_name, []) | length > 0
|
||||||
- ip_version == 'ipv6'
|
- ip_version == 'ipv6'
|
||||||
- dashboard_enabled | bool
|
- dashboard_enabled | bool
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
---
|
---
|
||||||
|
- name: include_tasks convert_grafana_server_group_name.yml
|
||||||
|
include_tasks: convert_grafana_server_group_name.yml
|
||||||
|
when: grafana_server_group_name is defined
|
||||||
|
|
||||||
- name: include facts.yml
|
- name: include facts.yml
|
||||||
include_tasks: facts.yml
|
include_tasks: facts.yml
|
||||||
|
|
|
@ -64,5 +64,5 @@
|
||||||
- "tcp"
|
- "tcp"
|
||||||
- "udp"
|
- "udp"
|
||||||
when:
|
when:
|
||||||
- grafana_server_group_name is defined
|
- monitoring_group_name is defined
|
||||||
- grafana_server_group_name in group_names
|
- monitoring_group_name in group_names
|
||||||
|
|
|
@ -19,14 +19,14 @@ scrape_configs:
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
- job_name: 'node'
|
- job_name: 'node'
|
||||||
static_configs:
|
static_configs:
|
||||||
{% for host in (groups['all'] | difference(groups[grafana_server_group_name]|union(groups.get(client_group_name, [])))) %}
|
{% for host in (groups['all'] | difference(groups[monitoring_group_name] | union(groups.get(client_group_name, [])))) %}
|
||||||
- targets: ['{{ host }}:{{ node_exporter_port }}']
|
- targets: ['{{ host }}:{{ node_exporter_port }}']
|
||||||
labels:
|
labels:
|
||||||
instance: "{{ hostvars[host]['ansible_nodename'] }}"
|
instance: "{{ hostvars[host]['ansible_nodename'] }}"
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
- job_name: 'grafana'
|
- job_name: 'grafana'
|
||||||
static_configs:
|
static_configs:
|
||||||
{% for host in groups[grafana_server_group_name] %}
|
{% for host in groups[monitoring_group_name] %}
|
||||||
- targets: ['{{ host }}:{{ node_exporter_port }}']
|
- targets: ['{{ host }}:{{ node_exporter_port }}']
|
||||||
labels:
|
labels:
|
||||||
instance: "{{ hostvars[host]['ansible_nodename'] }}"
|
instance: "{{ hostvars[host]['ansible_nodename'] }}"
|
||||||
|
|
|
@ -212,15 +212,15 @@
|
||||||
- ceph_rbd_mirror_configure | default(false) | bool
|
- ceph_rbd_mirror_configure | default(false) | bool
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: fail if [grafana-server] group doesn't exist
|
- name: fail if monitoring group doesn't exist
|
||||||
fail:
|
fail:
|
||||||
msg: "you must add a [grafana-server] group and add at least one node."
|
msg: "you must add a monitoring group and add at least one node."
|
||||||
when: groups[grafana_server_group_name] is undefined
|
when: groups[monitoring_group_name] is undefined
|
||||||
|
|
||||||
- name: fail when [grafana-server] doesn't contain at least one node.
|
- name: fail when monitoring doesn't contain at least one node.
|
||||||
fail:
|
fail:
|
||||||
msg: "you must add at least one node in the [grafana-server] hosts group"
|
msg: "you must add at least one node in the monitoring hosts group"
|
||||||
when: groups[grafana_server_group_name] | length < 1
|
when: groups[monitoring_group_name] | length < 1
|
||||||
|
|
||||||
- name: fail when dashboard_admin_password and/or grafana_admin_password are not set
|
- name: fail when dashboard_admin_password and/or grafana_admin_password are not set
|
||||||
fail:
|
fail:
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
- clients
|
- clients
|
||||||
- iscsigws
|
- iscsigws
|
||||||
- mgrs
|
- mgrs
|
||||||
- grafana-server
|
- monitoring
|
||||||
|
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
become: True
|
become: True
|
||||||
|
@ -423,7 +423,7 @@
|
||||||
- import_playbook: dashboard.yml
|
- import_playbook: dashboard.yml
|
||||||
when:
|
when:
|
||||||
- dashboard_enabled | bool
|
- dashboard_enabled | bool
|
||||||
- groups.get(grafana_server_group_name, []) | length > 0
|
- groups.get(monitoring_group_name, []) | length > 0
|
||||||
|
|
||||||
- hosts:
|
- hosts:
|
||||||
- mons
|
- mons
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
- clients
|
- clients
|
||||||
- mgrs
|
- mgrs
|
||||||
- iscsigws
|
- iscsigws
|
||||||
- grafana-server
|
- monitoring
|
||||||
- rgwloadbalancers
|
- rgwloadbalancers
|
||||||
|
|
||||||
gather_facts: false
|
gather_facts: false
|
||||||
|
@ -444,7 +444,7 @@
|
||||||
- import_playbook: dashboard.yml
|
- import_playbook: dashboard.yml
|
||||||
when:
|
when:
|
||||||
- dashboard_enabled | bool
|
- dashboard_enabled | bool
|
||||||
- groups.get(grafana_server_group_name, []) | length > 0
|
- groups.get(monitoring_group_name, []) | length > 0
|
||||||
|
|
||||||
- hosts:
|
- hosts:
|
||||||
- mons
|
- mons
|
||||||
|
|
|
@ -127,7 +127,7 @@ def node(host, request):
|
||||||
request.function, group_names)
|
request.function, group_names)
|
||||||
pytest.skip(reason)
|
pytest.skip(reason)
|
||||||
|
|
||||||
if request.node.get_closest_marker('ceph_crash') and group_names in [['nfss'], ['iscsigws'], ['clients'], ['grafana-server']]:
|
if request.node.get_closest_marker('ceph_crash') and group_names in [['nfss'], ['iscsigws'], ['clients'], ['monitoring']]:
|
||||||
pytest.skip('Not a valid test for nfs, client or iscsigw nodes')
|
pytest.skip('Not a valid test for nfs, client or iscsigw nodes')
|
||||||
|
|
||||||
if request.node.get_closest_marker("no_docker") and docker:
|
if request.node.get_closest_marker("no_docker") and docker:
|
||||||
|
|
|
@ -32,5 +32,5 @@ rbd-mirror0
|
||||||
[iscsigws]
|
[iscsigws]
|
||||||
iscsi-gw0
|
iscsi-gw0
|
||||||
|
|
||||||
[grafana-server]
|
[monitoring]
|
||||||
mon0
|
mon0
|
||||||
|
|
|
@ -40,3 +40,4 @@ node_exporter_container_image: "quay.io/prometheus/node-exporter:v0.17.0"
|
||||||
prometheus_container_image: "quay.io/prometheus/prometheus:v2.7.2"
|
prometheus_container_image: "quay.io/prometheus/prometheus:v2.7.2"
|
||||||
alertmanager_container_image: "quay.io/prometheus/alertmanager:v0.16.2"
|
alertmanager_container_image: "quay.io/prometheus/alertmanager:v0.16.2"
|
||||||
grafana_container_image: "quay.io/app-sre/grafana:5.4.3"
|
grafana_container_image: "quay.io/app-sre/grafana:5.4.3"
|
||||||
|
grafana_server_group_name: ceph_monitoring
|
||||||
|
|
|
@ -32,5 +32,5 @@ rbd-mirror0
|
||||||
[iscsigws]
|
[iscsigws]
|
||||||
iscsi-gw0
|
iscsi-gw0
|
||||||
|
|
||||||
[grafana-server]
|
[ceph_monitoring]
|
||||||
mon0
|
mon0
|
||||||
|
|
|
@ -23,5 +23,5 @@ rgw0
|
||||||
[clients]
|
[clients]
|
||||||
client0
|
client0
|
||||||
|
|
||||||
[grafana-server]
|
[monitoring]
|
||||||
mon0
|
mon0
|
|
@ -27,5 +27,5 @@ rbd-mirror0
|
||||||
[iscsigws]
|
[iscsigws]
|
||||||
iscsi-gw0
|
iscsi-gw0
|
||||||
|
|
||||||
[grafana-server]
|
[monitoring]
|
||||||
mon0
|
mon0
|
||||||
|
|
|
@ -22,5 +22,5 @@ mds0
|
||||||
#rgw0
|
#rgw0
|
||||||
#mds0
|
#mds0
|
||||||
|
|
||||||
[grafana-server]
|
[monitoring]
|
||||||
mon0
|
mon0
|
|
@ -22,5 +22,5 @@ mds0
|
||||||
#rgw0
|
#rgw0
|
||||||
#mds0
|
#mds0
|
||||||
|
|
||||||
[grafana-server]
|
[monitoring]
|
||||||
mon0
|
mon0
|
|
@ -7,5 +7,5 @@ osd0
|
||||||
[mgrs]
|
[mgrs]
|
||||||
mon0
|
mon0
|
||||||
|
|
||||||
[grafana-server]
|
[monitoring]
|
||||||
mon0
|
mon0
|
|
@ -26,7 +26,7 @@ rbd-mirror0
|
||||||
[iscsigws]
|
[iscsigws]
|
||||||
iscsi-gw0
|
iscsi-gw0
|
||||||
|
|
||||||
[grafana-server]
|
[monitoring]
|
||||||
mon0
|
mon0
|
||||||
|
|
||||||
#[all:vars]
|
#[all:vars]
|
||||||
|
|
Loading…
Reference in New Issue