Skip to content

Commit

Permalink
ceph-infra: move dashboard into a dedicated file
Browse files Browse the repository at this point in the history
Instead of using multiple dashboard_enabled condition in the
configure_firewall file we could just have the condition once
and include the dedicated tasks list.

Signed-off-by: Dimitri Savineau <[email protected]>
  • Loading branch information
dsavineau authored and guits committed Dec 18, 2019
1 parent 4535985 commit f4c261e
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 57 deletions.
59 changes: 2 additions & 57 deletions roles/ceph-infra/tasks/configure_firewall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,65 +173,10 @@
- iscsi_gw_group_name in group_names
tags: firewall

- name: open node_exporter port
firewalld:
port: "{{ node_exporter_port }}/tcp"
zone: "{{ ceph_dashboard_firewall_zone }}"
permanent: true
immediate: true
state: enabled
- name: open dashboard ports
include_tasks: dashboard_firewall.yml
when: dashboard_enabled | bool

- block:
- name: open dashboard port
firewalld:
port: "{{ dashboard_port }}/tcp"
zone: "{{ ceph_dashboard_firewall_zone }}"
permanent: true
immediate: true
state: enabled

- name: open mgr/prometheus port
firewalld:
port: "9283/tcp"
zone: "{{ ceph_dashboard_firewall_zone }}"
permanent: true
immediate: true
state: enabled
when:
- dashboard_enabled | bool
- mgr_group_name is defined
- (groups.get(mgr_group_name,[]) | length > 0 and mgr_group_name in group_names) or
(groups.get(mgr_group_name,[]) | length == 0 and mon_group_name in group_names)

- block:
- name: open grafana port
firewalld:
port: "{{ grafana_port }}/tcp"
zone: "{{ ceph_dashboard_firewall_zone }}"
permanent: true
immediate: true
state: enabled

- name: open prometheus port
firewalld:
port: "{{ prometheus_port }}/tcp"
zone: "{{ ceph_dashboard_firewall_zone }}"
permanent: true
immediate: true
state: enabled

- name: open alertmanager port
firewalld:
port: "{{ alertmanager_port }}/tcp"
zone: "{{ ceph_dashboard_firewall_zone }}"
permanent: true
immediate: true
state: enabled
when:
- dashboard_enabled | bool
- inventory_hostname in groups.get('grafana-server', [])

- name: open haproxy ports
firewalld:
port: "{{ haproxy_frontend_port | default(80) }}/tcp"
Expand Down
55 changes: 55 additions & 0 deletions roles/ceph-infra/tasks/dashboard_firewall.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
- name: open node_exporter port
firewalld:
port: "{{ node_exporter_port }}/tcp"
zone: "{{ ceph_dashboard_firewall_zone }}"
permanent: true
immediate: true
state: enabled

- block:
- name: open dashboard port
firewalld:
port: "{{ dashboard_port }}/tcp"
zone: "{{ ceph_dashboard_firewall_zone }}"
permanent: true
immediate: true
state: enabled

- name: open mgr/prometheus port
firewalld:
port: "9283/tcp"
zone: "{{ ceph_dashboard_firewall_zone }}"
permanent: true
immediate: true
state: enabled
when:
- mgr_group_name is defined
- (groups.get(mgr_group_name,[]) | length > 0 and mgr_group_name in group_names) or
(groups.get(mgr_group_name,[]) | length == 0 and mon_group_name in group_names)

- block:
- name: open grafana port
firewalld:
port: "{{ grafana_port }}/tcp"
zone: "{{ ceph_dashboard_firewall_zone }}"
permanent: true
immediate: true
state: enabled

- name: open prometheus port
firewalld:
port: "{{ prometheus_port }}/tcp"
zone: "{{ ceph_dashboard_firewall_zone }}"
permanent: true
immediate: true
state: enabled

- name: open alertmanager port
firewalld:
port: "{{ alertmanager_port }}/tcp"
zone: "{{ ceph_dashboard_firewall_zone }}"
permanent: true
immediate: true
state: enabled
when: inventory_hostname in groups.get('grafana-server', [])

0 comments on commit f4c261e

Please sign in to comment.