From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C3EEA281371 for ; Mon, 11 Aug 2025 22:24:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754951097; cv=none; b=ef49UBK8Jy3NEAPU0awnZLVU1u/nMWReZayqJ7MKDHZphWwyFObaXG0sTXUk0lEFrlm36A9xnnNcOZLQhLIxFkKoFzZ2nf/H7At1tEOcaKzyEs3JtJri03bS8sR917t1p80z+gGJrdRiy8qoowYnceSy192NHo3Jn9Ovto1yKnQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754951097; c=relaxed/simple; bh=b8raAVQDRo3USG2ajHE38FnWfaIpXQ1Mmhe16XRHwOU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hcticsPw/Q8caPm6U0YaEwYCrtUoV/uoWm6cUgqIPB48NLxY8+t2LZHSAfelB28OV/61nfHn8zaber5Dn3T3t2y1z51ScZs6WXnO6vPAaGfyke+da4xS2Mm62DyNYZWVhTpLjgLGY++BQw1I7LVzGq+UfRRYLd6YWsoetOtv/v4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=FziHab7r; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="FziHab7r" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=0kHDI4C3jJ02f0uIbhMa0EBkEhazopSCBYlfjEeSZCU=; b=FziHab7rJH0oEVnNG2Po/1/6pB GUvaYADpKGY/hlvPDlaQ2ueu4SwvkRwgamfRgFWOCUCgpnGIZ8OnR0010s5R8E0Mml+uPPT8AVLFP i2/wX3HkJmKxNcYGudytbLhMFdr2xQnzcRLZp+mu55Rn+d/kF/J4NHhfsBxk8IWTMMQzfPUH0coYM Z6oUon3z/qntl/iar3ImshfVHrTA37Fxcz1lvKmRSwzvETR06Q7lwXWDMxhcT32Apc3xAhOsFlJXW QZVz8fyr7TdJW72ZuSQxkehclou97ugsEPodaJcrKR/uHTlRVnyZPPLFUxzkIEvO/9d7gr1O8iKNB VipUrCyA==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1ulawn-00000009HkS-3aE5; Mon, 11 Aug 2025 22:24:53 +0000 From: Luis Chamberlain To: Chuck Lever , Daniel Gomez , kdevops@lists.linux.dev Cc: Luis Chamberlain Subject: [PATCH 19/23] reboot-limit: fix wait_for tasks using wrong host reference Date: Mon, 11 Aug 2025 15:24:46 -0700 Message-ID: <20250811222452.2213071-20-mcgrof@kernel.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250811222452.2213071-1-mcgrof@kernel.org> References: <20250811222452.2213071-1-mcgrof@kernel.org> Precedence: bulk X-Mailing-List: kdevops@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Luis Chamberlain The wait_for tasks were failing because they were trying to connect to localhost:22 instead of the actual target host when delegated to localhost. Fix by using a proper fallback chain for the host reference: - ansible_ssh_host (preferred, used elsewhere in the role) - ansible_host (fallback) - inventory_hostname (last resort) This ensures the wait_for module connects to the correct host IP/name when checking if the system has gone down or come back up after reboot. Generated-by: Claude AI Signed-off-by: Luis Chamberlain --- playbooks/roles/reboot-limit/tasks/do-reboot.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/playbooks/roles/reboot-limit/tasks/do-reboot.yml b/playbooks/roles/reboot-limit/tasks/do-reboot.yml index 1e5ba925..955f80be 100644 --- a/playbooks/roles/reboot-limit/tasks/do-reboot.yml +++ b/playbooks/roles/reboot-limit/tasks/do-reboot.yml @@ -29,7 +29,7 @@ - name: Wait for system to go down for reboot wait_for: - host: "{{ ansible_host }}" + host: "{{ ansible_ssh_host | default(ansible_host) | default(inventory_hostname) }}" port: 22 state: stopped delay: 5 @@ -41,7 +41,7 @@ - name: Wait for system to come back after reboot wait_for: - host: "{{ ansible_host }}" + host: "{{ ansible_ssh_host | default(ansible_host) | default(inventory_hostname) }}" port: 22 state: started delay: 10 @@ -137,7 +137,7 @@ - name: Wait for system to go down for kexec wait_for: - host: "{{ ansible_host }}" + host: "{{ ansible_ssh_host | default(ansible_host) | default(inventory_hostname) }}" port: 22 state: stopped delay: 5 @@ -149,7 +149,7 @@ - name: Wait for system to come back after kexec wait_for: - host: "{{ ansible_host }}" + host: "{{ ansible_ssh_host | default(ansible_host) | default(inventory_hostname) }}" port: 22 state: started delay: 10 -- 2.47.2