cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

Ansible not working with Cisco IOS - "network os iOS is not supported"

dhr.tech1
Beginner
Beginner

Hi All,

 

I am trying to setup Ansible with Cisco IOS but receive error listed below. I have provided details below. (attached screen shot for reference)

TASK [run multiple commands on remote nodes] ***********************************
fatal: [CSR1]: FAILED! => {"msg": "network os iOS is not supported"}

Ansible Version: ansible 2.9.27

=====================Host File=================

## Ansible Hosts File for Home Lab

[all:vars]
ansible_user=dhruv
ansible_ssh_pass=cisco
ansible_network_os=iOS
ansible_connection=network_cli

[CSR-Router]
CSR1 ansible_host=192.168.111.10

 

# host all : refer to all the devices

====== Playbook ================

---
- name: show version and other user level commands
hosts: all
gather_facts: false
connection: local

tasks:
- name: run multiple commands on remote nodes
ios_command:
commands:
- show version
- show ip int brief
- show cry isa sa details


register: print_output

- debug: var=print_output.stdout_lines

 

============== configuration File =====================

 

[defaults]
inventory = /home/dhruv/babi.com/hosts
host_key_checking = False
# Don’t worry about RSA Fingerprints
retry_files_enabled = False
# Do not create retry files on job failure
forks = 4
# The number of devices Ansible can connect at once. By default it connects with 5 devices at one time.

 

Regards,

Dhruv

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Claudia de Luna
Rising star
Rising star

Hi @dhr.tech1  

Have you tried

ansible_network_os=ios

In network automation work its important to pay attention to case.  iOS does not equal ios

Apologies if its not that simple and that was just an auto correct thing in your text!

View solution in original post

2 REPLIES 2

Claudia de Luna
Rising star
Rising star

Hi @dhr.tech1  

Have you tried

ansible_network_os=ios

In network automation work its important to pay attention to case.  iOS does not equal ios

Apologies if its not that simple and that was just an auto correct thing in your text!

dhr.tech1
Beginner
Beginner

Hi, thanks for the update it worked last night. I updated the host file as below.

 

[all:vars]
ansible_user=dhruv
ansible_ssh_pass=cisco
ansible_network_os=ios

[CSR-Router]
CSR1 ansible_host=192.168.111.10

 

# host all : refer to all the devices

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: