Skip to content

Commit 5887046

Browse files
committed
fix: switch from paramiko to libssh with publickey_algorithms for Cisco
Paramiko works from ansible-navigator but fails from AAP runner with "key cannot be used for signing" due to how runner injects credentials. The new network EE (based on AAP 2.6 / netcommon 8.1.0) supports ansible_libssh_publickey_algorithms, so we can use the default libssh transport with the ssh-rsa algorithm explicitly allowed. This works in both ansible-navigator and AAP Controller contexts. Made-with: Cursor
1 parent c84c990 commit 5887046

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

roles/manage_ec2_instances/tasks/inventory/addhost_network.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
username: "{{ item.tags.Student }}"
4141
ansible_user: "{{ item.tags.username }}"
4242
ansible_port: "{{ ssh_port }}"
43-
ansible_network_cli_ssh_type: "paramiko"
43+
ansible_libssh_publickey_algorithms: "ssh-rsa"
4444
ansible_ssh_private_key_file: "{{ playbook_dir }}/{{ ec2_name_prefix|lower }}/{{ ec2_name_prefix|lower }}-private.pem"
4545
private_ip: "{{ item.private_ip_address }}"
4646
ansible_network_os: "{{ item.tags.ansible_network_os }}"

roles/manage_ec2_instances/templates/instructor_inventory/instructor_inventory_network.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ansible_ssh_private_key_file="{{ playbook_dir }}/{{ ec2_name_prefix }}/{{ ec2_na
2525
{% endfor %}
2626
{% for host in rtr1_node_facts.instances %}
2727
{% if 'student' ~ number == host.tags.Student %}
28-
{{ host.tags.Student }}-{{ host.tags.short_name }} ansible_host={{ host.public_ip_address }} ansible_user={{ host.tags.username }} ansible_network_os={{ host.tags.ansible_network_os }} ansible_connection=network_cli ansible_network_cli_ssh_type=paramiko
28+
{{ host.tags.Student }}-{{ host.tags.short_name }} ansible_host={{ host.public_ip_address }} ansible_user={{ host.tags.username }} ansible_network_os={{ host.tags.ansible_network_os }} ansible_connection=network_cli ansible_libssh_publickey_algorithms=ssh-rsa
2929
{% endif %}
3030
{% endfor %}
3131
{% for host in rtr2_node_facts.instances %}

roles/manage_ec2_instances/templates/student_inventory/instances_network.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ arista
5252
[cisco:vars]
5353
ansible_network_os=ios
5454
ansible_connection=network_cli
55-
ansible_network_cli_ssh_type=paramiko
55+
ansible_libssh_publickey_algorithms=ssh-rsa
5656
{% endif %}
5757

5858
{% if network_type == "multivendor" or network_type == "juniper" %}

roles/populate_controller/vars/network.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ controller_groups:
165165
variables:
166166
ansible_network_os: ios
167167
ansible_connection: network_cli
168-
ansible_network_cli_ssh_type: paramiko
168+
ansible_libssh_publickey_algorithms: ssh-rsa
169169
- name: arista
170170
inventory: "Workshop Inventory"
171171
variables:

0 commit comments

Comments
 (0)