Skip to content

Commit 937abbe

Browse files
committed
Fix fanout ssh authentication failed issue
PR sonic-net#7778 added support of SSH to fanout switch using TACACS account. However, this PR introduced an issue. It mistakenly set SSH password to variable `ansible_ssh_password` instead of expected `ansible_ssh_pass`. Consequently, deploy fanout switch failed with authentication failure. This change corrected variable name `ansible_ssh_password` to `ansible_ssh_pass` in the touched files. Signed-off-by: Xin Wang <[email protected]>
1 parent 0f0bc94 commit 937abbe

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

ansible/roles/fanout/tasks/fanout_eos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
- name: set login to tacacs if tacacs is defined
2-
set_fact: ansible_ssh_user={{ fanout_tacacs_eos_user }} ansible_ssh_password={{ fanout_tacacs_eos_password }}
2+
set_fact: ansible_ssh_user={{ fanout_tacacs_eos_user }} ansible_ssh_pass={{ fanout_tacacs_eos_password }}
33
when: >
44
fanout_tacacs_user is not defined and fanout_tacacs_user is not defined and
55
fanout_tacacs_eos_user is defined and fanout_tacacs_eos_password is defined
66
77
- name: prepare fanout switch admin login info
8-
set_fact: ansible_ssh_user={{ fanout_admin_user }} ansible_ssh_password={{ fanout_admin_password }}
8+
set_fact: ansible_ssh_user={{ fanout_admin_user }} ansible_ssh_pass={{ fanout_admin_password }}
99
when: >
1010
fanout_tacacs_user is not defined and fanout_tacacs_user is not defined and
1111
fanout_tacacs_eos_user is not defined and fanout_tacacs_eos_password is not defined

ansible/roles/fanout/tasks/fanout_mlnx.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
### playbook
88
################################################################################################
99
- name: set login to tacacs if tacacs is defined
10-
set_fact: ansible_ssh_user={{ fanout_tacacs_mlnx_user }} ansible_ssh_password={{ fanout_tacacs_mlnx_password }}
10+
set_fact: ansible_ssh_user={{ fanout_tacacs_mlnx_user }} ansible_ssh_pass={{ fanout_tacacs_mlnx_password }}
1111
when: >
1212
fanout_tacacs_user is not defined and fanout_tacacs_user is not defined and
1313
fanout_tacacs_mlnx_user is defined and fanout_tacacs_mlnx_password is defined

ansible/roles/fanout/tasks/fanout_sonic.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
- debug: msg="{{ device_info[inventory_hostname] }}"
22

33
- name: set login to tacacs if tacacs is defined
4-
set_fact: ansible_ssh_user={{ fanout_tacacs_sonic_user }} ansible_ssh_password={{ fanout_tacacs_sonic_password }}
4+
set_fact: ansible_ssh_user={{ fanout_tacacs_sonic_user }} ansible_ssh_pass={{ fanout_tacacs_sonic_password }}
55
when: >
66
fanout_tacacs_user is not defined and fanout_tacacs_user is not defined and
77
fanout_tacacs_sonic_user is defined and fanout_tacacs_sonic_password is defined
88
99
- name: prepare fanout switch admin login info
10-
set_fact: ansible_ssh_user={{ fanout_sonic_user }} ansible_ssh_password={{ fanout_sonic_password }}
10+
set_fact: ansible_ssh_user={{ fanout_sonic_user }} ansible_ssh_pass={{ fanout_sonic_password }}
1111
when: >
1212
fanout_tacacs_user is not defined and fanout_tacacs_user is not defined and
1313
fanout_tacacs_sonic_user is not defined and fanout_tacacs_sonic_password is not defined

ansible/roles/fanout/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313

1414
- set_fact: sw_type="{{ device_info[inventory_hostname]['Type'] }}"
1515

16-
# fanout_tacacs_user can override fanout_tacacs_sonic_user,
16+
# fanout_tacacs_user can override fanout_tacacs_sonic_user,
1717
# fanout_tacacs_sonic_user can override fanout_sonic_user
1818
- name: set login info if fanout_tacacs_user and fanout_tacacs_password is defined
19-
set_fact: ansible_ssh_user={{ fanout_tacacs_user }} ansible_ssh_password={{ fanout_tacacs_password }}
19+
set_fact: ansible_ssh_user={{ fanout_tacacs_user }} ansible_ssh_pass={{ fanout_tacacs_password }}
2020
when: fanout_tacacs_user is defined and fanout_tacacs_password is defined
2121
tags: always
2222

0 commit comments

Comments
 (0)