From 556058036f56dbda40377be82a4e2438207a70cd Mon Sep 17 00:00:00 2001 From: shenlan Date: Wed, 25 Jun 2025 23:50:03 +0800 Subject: [PATCH] fix(gpu-k8s): use inventory ssh user for precheck --- playbooks/roles/vhosts/gpu-k8s/tasks/install_cluster.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/playbooks/roles/vhosts/gpu-k8s/tasks/install_cluster.yml b/playbooks/roles/vhosts/gpu-k8s/tasks/install_cluster.yml index d1008a9..3820413 100644 --- a/playbooks/roles/vhosts/gpu-k8s/tasks/install_cluster.yml +++ b/playbooks/roles/vhosts/gpu-k8s/tasks/install_cluster.yml @@ -73,7 +73,9 @@ when: inventory_hostname == (ops_host | default(masters | default(master_ips) | first)) - name: Verify passwordless SSH access to all cluster nodes - shell: ssh -o BatchMode=yes -o StrictHostKeyChecking=no root@{{ item }} hostname + shell: >- + ssh -o BatchMode=yes -o StrictHostKeyChecking=no \ + {{ ansible_ssh_user | default(ansible_user, true) | default('root') }}@{{ item }} hostname loop: "{{ master_ips + node_ips }}" delegate_to: "{{ ops_host | default(masters | default(master_ips) | first) }}" become: false