]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
container: explicitly pull monitoring images v4.0.65
authorDimitri Savineau <dsavinea@redhat.com>
Thu, 19 Aug 2021 18:08:06 +0000 (14:08 -0400)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Mon, 23 Aug 2021 20:21:19 +0000 (16:21 -0400)
We don't pull the monitoring container images (alertmanager, prometheus,
node-exporter and grafana) in a dedicated task like we're doing for the
ceph container image.
This means that the container image pull is done during the start of the
systemd service.
By doing this, pulling the image behind a proxy isn't working with podman.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1995574
Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 5bb7240f878ff9b369ea028839d26fd46342ff77)

roles/ceph-container-common/tasks/fetch_image.yml

index 20bbb206fcd3b4b73bb9f975a55d1e0ca1c3ba8a..019b9a52b1ab94aea8d9fb783b47b15ca8be8341 100644 (file)
     HTTPS_PROXY: "{{ ceph_docker_https_proxy | default('') }}"
     NO_PROXY: "{{ ceph_docker_no_proxy }}"
 
+- name: "pulling alertmanager/prometheus/grafana container images"
+  command: "{{ timeout_command }} {{ container_binary }} pull {{ item }}"
+  changed_when: false
+  register: monitoring_images
+  until: monitoring_images.rc == 0
+  retries: "{{ docker_pull_retry }}"
+  delay: 10
+  loop:
+    - "{{ alertmanager_container_image }}"
+    - "{{ prometheus_container_image }}"
+    - "{{ grafana_container_image }}"
+  when:
+    - dashboard_enabled | bool
+    - inventory_hostname in groups.get(grafana_server_group_name, [])
+  environment:
+    HTTP_PROXY: "{{ ceph_docker_http_proxy | default('') }}"
+    HTTPS_PROXY: "{{ ceph_docker_https_proxy | default('') }}"
+    NO_PROXY: "{{ ceph_docker_no_proxy }}"
+
+- name: "pulling node-exporter container image"
+  command: "{{ timeout_command }} {{ container_binary }} pull {{ node_exporter_container_image }}"
+  changed_when: false
+  register: node_exporter_image
+  until: node_exporter_image.rc == 0
+  retries: "{{ docker_pull_retry }}"
+  delay: 10
+  when:
+    - dashboard_enabled | bool
+    - inventory_hostname in groups.get(mon_group_name, []) or
+      inventory_hostname in groups.get(osd_group_name, []) or
+      inventory_hostname in groups.get(mds_group_name, []) or
+      inventory_hostname in groups.get(rgw_group_name, []) or
+      inventory_hostname in groups.get(mgr_group_name, []) or
+      inventory_hostname in groups.get(rbdmirror_group_name, []) or
+      inventory_hostname in groups.get(nfs_group_name, []) or
+      inventory_hostname in groups.get(iscsi_gw_group_name, []) or
+      inventory_hostname in groups.get(grafana_server_group_name, [])
+  environment:
+    HTTP_PROXY: "{{ ceph_docker_http_proxy | default('') }}"
+    HTTPS_PROXY: "{{ ceph_docker_https_proxy | default('') }}"
+    NO_PROXY: "{{ ceph_docker_no_proxy }}"
+
 - name: "inspecting {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} image after pulling"
   command: "{{ container_binary }} inspect {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
   changed_when: false