]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
docker2podman: manage dashboard nodes
authorDimitri Savineau <dsavinea@redhat.com>
Thu, 16 Apr 2020 16:17:12 +0000 (12:17 -0400)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 13 May 2020 10:02:00 +0000 (12:02 +0200)
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>
infrastructure-playbooks/docker-to-podman.yml
roles/ceph-grafana/tasks/setup_container.yml
roles/ceph-grafana/tasks/systemd.yml [new file with mode: 0644]
roles/ceph-node-exporter/tasks/setup_container.yml
roles/ceph-node-exporter/tasks/systemd.yml [new file with mode: 0644]
roles/ceph-prometheus/handlers/main.yml
roles/ceph-prometheus/tasks/setup_container.yml
roles/ceph-prometheus/tasks/systemd.yml [new file with mode: 0644]
tests/functional/docker2podman/group_vars/all
tests/functional/docker2podman/hosts

index fa0502b4c8d0a86035f5cfa3787e3c0339cd175c..458cee99adad831f5082f8b1183d0428705d5c31 100644 (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:
             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
         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
\ No newline at end of file
index de5f24ae282a7949785675eabc0c8cbbd93f60c8..666eff780bf177aeacae09fe9fad084d7c86dd16 100644 (file)
     - /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:
diff --git a/roles/ceph-grafana/tasks/systemd.yml b/roles/ceph-grafana/tasks/systemd.yml
new file mode 100644 (file)
index 0000000..d513870
--- /dev/null
@@ -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
index 325682cc7f63596ca13d2c38d13bdea772bbfa69..a15c0216041af5ed1f8afc295bcf6765d4b7d810 100644 (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:
diff --git a/roles/ceph-node-exporter/tasks/systemd.yml b/roles/ceph-node-exporter/tasks/systemd.yml
new file mode 100644 (file)
index 0000000..4df9920
--- /dev/null
@@ -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
index 1e84e565ad4b34dc234b1e4ac9ee274b335d0f10..dca87676aaad4cbd685b4f2925a2b512d1600ecf 100644 (file)
@@ -10,3 +10,4 @@
   with_items:
     - 'alertmanager'
     - 'prometheus'
+  when: not docker2podman | default(False) | bool
index b07354718d6d79d843ea06dbe964bd971f479fac..25eec6e96141aaddaeed68fa562a8c03d1927f49 100644 (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:
diff --git a/roles/ceph-prometheus/tasks/systemd.yml b/roles/ceph-prometheus/tasks/systemd.yml
new file mode 100644 (file)
index 0000000..eb587ac
--- /dev/null
@@ -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
index 2f7e7b4993797b76e10fcf3a4a2c53d988f8f626..ceec85e56a94484d7ddc3b53b384a5ab6e15aa36 100644 (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
\ No newline at end of file
+dashboard_admin_password: $sX!cD$rYU6qR^B!
+grafana_admin_password: +xFRe+RES@7vg24n
\ No newline at end of file
index b29e9111cc86e6738a093f826b47a8925c9da05e..2a686216002d59fdeb67214988bc5570638f2331 100644 (file)
@@ -7,5 +7,5 @@ osd0
 [mgrs]
 mon0
 
-#[all:vars]
-#ansible_python_interpreter=/usr/bin/python3
\ No newline at end of file
+[grafana-server]
+mon0
\ No newline at end of file