docker2podman: manage dashboard nodes

The dashboard nodes (alertmanager, grafana, node-exporter, and prometheus)
were not manage during the docker to podman migration.

This adds the systemd container template of those services to a dedicated
file (systemd.yml) in order to include it in the docker2podman playbook.

This also adds the dashboard container images pull from docker to podman.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1829389

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
pull/5366/head
Dimitri Savineau 2020-04-16 12:17:12 -04:00 committed by Guillaume Abrioux
parent d38f21aeba
commit 252e78b4e4
10 changed files with 86 additions and 28 deletions

View File

@ -46,6 +46,7 @@
- "{{ mgr_group_name | default('mgrs') }}"
- "{{ iscsi_gw_group_name | default('iscsigws') }}"
- "{{ rbdmirror_group_name | default('rbdmirrors') }}"
- "{{ grafana_server_group_name|default('grafana-server') }}"
gather_facts: false
become: true
tasks:
@ -86,6 +87,30 @@
inventory_hostname in groups.get(iscsi_gw_group_name, []) or
inventory_hostname in groups.get(nfs_group_name, [])
- name: "pulling alertmanager/grafana/prometheus images from docker daemon"
command: "{{ timeout_command }} {{ container_binary }} pull docker-daemon:{{ item }}"
changed_when: false
register: pull_image
until: pull_image.rc == 0
retries: "{{ docker_pull_retry }}"
delay: 10
loop:
- "{{ alertmanager_container_image }}"
- "{{ grafana_container_image }}"
- "{{ prometheus_container_image }}"
when:
- dashboard_enabled | bool
- inventory_hostname in groups.get(grafana_server_group_name, [])
- name: "pulling {{ node_exporter_container_image }} image from docker daemon"
command: "{{ timeout_command }} {{ container_binary }} pull docker-daemon:{{ node_exporter_container_image }}"
changed_when: false
register: pull_image
until: pull_image.rc == 0
retries: "{{ docker_pull_retry }}"
delay: 10
when: dashboard_enabled | bool
- import_role:
name: ceph-mon
tasks_from: systemd.yml
@ -131,6 +156,28 @@
tasks_from: systemd.yml
when: inventory_hostname in groups.get(rgw_group_name, [])
- name: dashboard configuration
when: dashboard_enabled | bool
block:
- import_role:
name: ceph-node-exporter
tasks_from: systemd.yml
- import_role:
name: ceph-facts
tasks_from: grafana.yml
when: inventory_hostname in groups.get(grafana_server_group_name, [])
- import_role:
name: ceph-grafana
tasks_from: systemd.yml
when: inventory_hostname in groups.get(grafana_server_group_name, [])
- import_role:
name: ceph-prometheus
tasks_from: systemd.yml
when: inventory_hostname in groups.get(grafana_server_group_name, [])
- name: reload systemd daemon
systemd:
daemon_reload: yes

View File

@ -10,13 +10,8 @@
- /etc/grafana
- /var/lib/grafana
- name: ship systemd service
template:
src: grafana-server.service.j2
dest: "/etc/systemd/system/grafana-server.service"
owner: root
group: root
mode: 0644
- name: include_tasks systemd.yml
include_tasks: systemd.yml
- name: start the grafana-server service
systemd:

View File

@ -0,0 +1,8 @@
---
- name: ship systemd service
template:
src: grafana-server.service.j2
dest: "/etc/systemd/system/grafana-server.service"
owner: root
group: root
mode: 0644

View File

@ -1,11 +1,6 @@
---
- name: ship systemd service
template:
src: node_exporter.service.j2
dest: "/etc/systemd/system/node_exporter.service"
owner: root
group: root
mode: 0644
- name: include_tasks systemd.yml
include_tasks: systemd.yml
- name: start the node_exporter service
systemd:

View File

@ -0,0 +1,8 @@
---
- name: ship systemd service
template:
src: node_exporter.service.j2
dest: "/etc/systemd/system/node_exporter.service"
owner: root
group: root
mode: 0644

View File

@ -10,3 +10,4 @@
with_items:
- 'alertmanager'
- 'prometheus'
when: not docker2podman | default(False) | bool

View File

@ -1,15 +1,6 @@
---
- name: ship systemd services
template:
src: "{{ item }}.j2"
dest: "/etc/systemd/system/{{ item }}"
owner: root
group: root
mode: 0644
with_items:
- 'alertmanager.service'
- 'prometheus.service'
notify: service handler
- name: include_tasks systemd.yml
include_tasks: systemd.yml
- name: start prometheus services
systemd:

View File

@ -0,0 +1,12 @@
---
- name: ship systemd services
template:
src: "{{ item }}.j2"
dest: "/etc/systemd/system/{{ item }}"
owner: root
group: root
mode: 0644
with_items:
- 'alertmanager.service'
- 'prometheus.service'
notify: service handler

View File

@ -42,4 +42,5 @@ openstack_pools:
- "{{ openstack_cinder_pool }}"
handler_health_mon_check_delay: 10
handler_health_osd_check_delay: 10
dashboard_enabled: false
dashboard_admin_password: $sX!cD$rYU6qR^B!
grafana_admin_password: +xFRe+RES@7vg24n

View File

@ -7,5 +7,5 @@ osd0
[mgrs]
mon0
#[all:vars]
#ansible_python_interpreter=/usr/bin/python3
[grafana-server]
mon0