From 94d7d42f14a7072835cab014cfc8966bf2b2d9ae Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 22 Oct 2021 16:10:52 +1100 Subject: [PATCH] ensure-dstat-graph: pull updated branch This updated branch fixes a few issues and should ensure display with pcp-dstat (I9234b226242f145db9c235797649202aa530ec74) Add an override so we pull it Change-Id: I0d5e1b567c364a9e6c7aa0b95de17abffaef0434 --- roles/dstat-graph/defaults/main.yaml | 2 ++ roles/dstat-graph/tasks/main.yaml | 8 ++++++-- roles/ensure-dstat-graph/defaults/main.yaml | 3 +++ roles/ensure-dstat-graph/tasks/main.yaml | 15 ++++++++++++--- test-playbooks/dstat-graph.yaml | 9 +++++++-- 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/roles/dstat-graph/defaults/main.yaml b/roles/dstat-graph/defaults/main.yaml index 18ec03672..98fde15ad 100644 --- a/roles/dstat-graph/defaults/main.yaml +++ b/roles/dstat-graph/defaults/main.yaml @@ -1,3 +1,5 @@ dstat_graph_cache_path: /opt/cache/dstat_graph dstat_graph_download_path: /tmp/dstat_graph dstat_data_path: "{{ ansible_user_dir }}/zuul-output/logs/dstat.csv" +# only for gate testing to make sure we pull the latest +dstat_graph_cache_ignore: false diff --git a/roles/dstat-graph/tasks/main.yaml b/roles/dstat-graph/tasks/main.yaml index 4a0a1ea55..2f6399ed3 100644 --- a/roles/dstat-graph/tasks/main.yaml +++ b/roles/dstat-graph/tasks/main.yaml @@ -4,12 +4,16 @@ register: dstat_cache - name: Set dstat_graph path - when: dstat_cache.stat.exists + when: > + dstat_cache.stat.exists and not + dstat_graph_cache_ignore set_fact: dstat_path: "{{ dstat_graph_cache_path }}" - name: Set dstat_graph path - when: not dstat_cache.stat.exists + when: > + not dstat_cache.stat.exists or + dstat_graph_cache_ignore set_fact: dstat_path: "{{ dstat_graph_download_path }}" diff --git a/roles/ensure-dstat-graph/defaults/main.yaml b/roles/ensure-dstat-graph/defaults/main.yaml index 119d3b070..ca6fe1c33 100644 --- a/roles/ensure-dstat-graph/defaults/main.yaml +++ b/roles/ensure-dstat-graph/defaults/main.yaml @@ -1,2 +1,5 @@ dstat_graph_cache_path: /opt/cache/dstat_graph dstat_graph_download_path: /tmp/dstat_graph + +# only for gate testing to make sure we pull the latest +dstat_graph_cache_ignore: false diff --git a/roles/ensure-dstat-graph/tasks/main.yaml b/roles/ensure-dstat-graph/tasks/main.yaml index 77c68f3b5..ad4edd30f 100644 --- a/roles/ensure-dstat-graph/tasks/main.yaml +++ b/roles/ensure-dstat-graph/tasks/main.yaml @@ -4,8 +4,17 @@ register: dstat_cache - name: Clone dstat_graph - when: not dstat_cache.stat.exists + when: > + not dstat_cache.stat.exists or + dstat_graph_cache_ignore git: - repo: https://github.com/Dabz/dstat_graph + # NOTE(ianw) 2021-10-22 : this project hasn't had an update in 4 + # years ... it relies on https://github.com/novus/nvd3 which has + # never been updated for D3 >v3 (which is currently up to 7). + # This update is far from perfect but converts the non-graph bits + # to current boostrap and fixes some display issues with + # pcp-dstat. Use this while we see if the original upstream have + # interest in it any more. + repo: https://github.com/ianw/dstat_graph dest: "{{ dstat_graph_download_path }}" - version: c99e5d201ed924a816d99056f8f7d320d625b3ef + version: bootstrap5 diff --git a/test-playbooks/dstat-graph.yaml b/test-playbooks/dstat-graph.yaml index ed7f28083..b38a3d810 100644 --- a/test-playbooks/dstat-graph.yaml +++ b/test-playbooks/dstat-graph.yaml @@ -1,6 +1,8 @@ - hosts: all roles: - - ensure-dstat-graph + - role: ensure-dstat-graph + vars: + dstat_graph_cache_ignore: true - run-dstat # Simulate workload @@ -14,4 +16,7 @@ - hosts: all roles: - - dstat-graph + - role: dstat-graph + vars: + dstat_graph_cache_ignore: true +