Fixed issue with IOS SSH connection. The default Ansible setting was to us PK auth so I changed it back to default and added an environment variable for the @home_linux@ collection to keep it working

This commit is contained in:
Vlad Raducanu 2021-04-21 12:19:13 +01:00
parent 1be008aca4
commit b3f9331a12
5 changed files with 28 additions and 20 deletions

View File

@ -1,7 +1,8 @@
all: home:
hosts: hosts:
192.168.1.50: 192.168.1.50:
192.168.1.51: 192.168.1.51:
192.168.1.52: 192.168.1.52:
192.168.1.53: 192.168.1.53:
vars:
ansible_ssh_private_key_file = /home/vraducanu/.ssh/id_rsa

View File

@ -1,5 +1,7 @@
[baguleykit] baguleykit:
172.16.1.254 hosts:
172.16.1.254:
[homekit] homekit:
192.168.1.60 hosts:
192.168.1.60:

View File

@ -1,14 +0,0 @@
---
- name: Test playbook - reads and prints device info
hosts: homekit
gather_facts: false
connection: network_cli
roles:
- common
tasks:
- name: Run one command on device
ios_command:
commands: show version

View File

@ -0,0 +1,19 @@
---
- name: Test playbook - reads and prints device info
hosts: homekit
gather_facts: false
connection: network_cli
roles:
- common
tasks:
- name: Run "show version" command on devices
ios_command:
commands: show version
register: output
- name: Print the output of "show version"
debug:
var: output.stdout_lines