Fix GPU cluster playbook SSH setup

This commit is contained in:
shenlan 2025-06-26 00:07:02 +08:00
parent 68830ab067
commit bf20dd62c3
2 changed files with 4 additions and 1 deletions

View File

@ -1,7 +1,9 @@
- hosts: all
become: true
vars:
ops_host: "127.0.0.1"
# Use the inventory hostname for delegation so Ansible
# applies the correct connection variables
ops_host: "ops-1"
masters:
- "k8s-1"
nodes:

View File

@ -75,6 +75,7 @@
- name: Verify passwordless SSH access to all cluster nodes
shell: >-
ssh -o BatchMode=yes -o StrictHostKeyChecking=no \
-i {{ ansible_ssh_private_key_file | default('~/.ssh/id_rsa') }} \
{{ 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) }}"