From 84f601c1bd045d070212828e4ebdde2748a8d490 Mon Sep 17 00:00:00 2001 From: Roberto Alfieri Date: Mon, 11 May 2026 14:58:40 +0200 Subject: [PATCH] [pcp_metrics] Make target hosts configurable via cifmw_pcp_metrics_hosts PCP hook playbooks hardcode hosts: all,!localhost, which causes ansible-playbook to exit rc=2 when compute nodes are unreachable (e.g. not yet provisioned or already torn down). This kills the CI job for a metrics side-effect. Introduce cifmw_pcp_metrics_hosts (default: all,!localhost) so that downstream jobs can exclude host groups that are expected to be unavailable. By not targeting those hosts at all, Ansible never encounters UNREACHABLE errors and exits cleanly. Co-Authored-By: Claude Signed-off-by: Roberto Alfieri --- hooks/playbooks/pcp-metrics-post.yml | 2 +- hooks/playbooks/pcp-metrics-pre.yml | 2 +- roles/pcp_metrics/defaults/main.yaml | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hooks/playbooks/pcp-metrics-post.yml b/hooks/playbooks/pcp-metrics-post.yml index 5423fa406..d188696e8 100644 --- a/hooks/playbooks/pcp-metrics-post.yml +++ b/hooks/playbooks/pcp-metrics-post.yml @@ -7,7 +7,7 @@ # The best place to call this hook is under post_tests actions. # - name: Collect performance metrics - hosts: all,!localhost + hosts: "{{ cifmw_pcp_metrics_hosts }}" gather_facts: false tasks: - name: Gather metrics diff --git a/hooks/playbooks/pcp-metrics-pre.yml b/hooks/playbooks/pcp-metrics-pre.yml index c2b007e32..15240aa71 100644 --- a/hooks/playbooks/pcp-metrics-pre.yml +++ b/hooks/playbooks/pcp-metrics-pre.yml @@ -24,7 +24,7 @@ tasks_from: repo - name: Start collecting performance metrics - hosts: all,!localhost + hosts: "{{ cifmw_pcp_metrics_hosts }}" gather_facts: false tasks: - name: Setup PCP diff --git a/roles/pcp_metrics/defaults/main.yaml b/roles/pcp_metrics/defaults/main.yaml index 1a9b61667..d8dd90545 100644 --- a/roles/pcp_metrics/defaults/main.yaml +++ b/roles/pcp_metrics/defaults/main.yaml @@ -4,6 +4,9 @@ pcp_metrics_setup: false pcp_metrics_gather: false pcp_metrics_plot: false +# Host pattern for PCP hook playbooks (setup and gather) +cifmw_pcp_metrics_hosts: "all,!localhost" + # Setup-related variables pcp_metrics_packages: - pcp # for pmlogger