playbook: use blocks for grafana-server section

use a block in grafana-server section to avoid duplicate condition.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit be4a565612)
pull/3999/head
Guillaume Abrioux 2019-05-15 14:11:00 +02:00
parent fe5bcc2f9f
commit 406dd2880c
2 changed files with 44 additions and 55 deletions

View File

@ -514,41 +514,35 @@
- hosts: grafana-server - hosts: grafana-server
become: true become: true
tasks: tasks:
- import_role: - block:
name: ceph-defaults - import_role:
tags: ['ceph_update_config'] name: ceph-defaults
when: dashboard_enabled tags: ['ceph_update_config']
- import_role: - import_role:
name: ceph-facts name: ceph-facts
tags: ['ceph_update_config'] tags: ['ceph_update_config']
when: dashboard_enabled - import_role:
- import_role: name: ceph-handler
name: ceph-handler - import_role:
when: dashboard_enabled name: ceph-node-exporter
- import_role: - import_role:
name: ceph-node-exporter name: ceph-common
when: dashboard_enabled - import_role:
- import_role: name: ceph-config
name: ceph-common tags: ['ceph_update_config']
when: dashboard_enabled - import_role:
- import_role: name: ceph-prometheus
name: ceph-config - import_role:
tags: ['ceph_update_config'] name: ceph-grafana
when: dashboard_enabled
- import_role:
name: ceph-prometheus
when: dashboard_enabled
- import_role:
name: ceph-grafana
when: dashboard_enabled when: dashboard_enabled
- hosts: '{{ (groups["mgrs"] | default(groups["mons"]))[0] }}' - hosts: '{{ (groups["mgrs"] | default(groups["mons"]))[0] }}'
become: true become: true
tasks: tasks:
- import_role: - block:
name: ceph-defaults - import_role:
tags: ['ceph_update_config'] name: ceph-defaults
when: dashboard_enabled tags: ['ceph_update_config']
- import_role: - import_role:
name: ceph-dashboard name: ceph-dashboard
when: dashboard_enabled when: dashboard_enabled

View File

@ -507,29 +507,24 @@
- hosts: grafana-server - hosts: grafana-server
become: true become: true
tasks: tasks:
- import_role: - block:
name: ceph-defaults - import_role:
tags: ['ceph_update_config'] name: ceph-defaults
when: dashboard_enabled tags: ['ceph_update_config']
- import_role: - import_role:
name: ceph-facts name: ceph-facts
tags: ['ceph_update_config'] tags: ['ceph_update_config']
when: dashboard_enabled - import_role:
- import_role: name: ceph-handler
name: ceph-handler - import_role:
when: dashboard_enabled name: ceph-common
- import_role: - import_role:
name: ceph-common name: ceph-config
when: dashboard_enabled tags: ['ceph_update_config']
- import_role: - import_role:
name: ceph-config name: ceph-prometheus
tags: ['ceph_update_config'] - import_role:
when: dashboard_enabled name: ceph-grafana
- import_role:
name: ceph-prometheus
when: dashboard_enabled
- import_role:
name: ceph-grafana
when: dashboard_enabled when: dashboard_enabled
- hosts: '{{ (groups["mgrs"] | default(groups["mons"]))[0] }}' - hosts: '{{ (groups["mgrs"] | default(groups["mons"]))[0] }}'