cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1270
Views
0
Helpful
3
Replies

Basic Ansible script using version 2.13

jay_7301
Level 1
Level 1

Hi All,

This is my first time writing an ansible playbook. Please can anyone help me with the following error. I'm just trying to run a basic show ver to a cisco ios switch.

ansible-playbook new.yml

PLAY [cisco] ***********************************************************************************************************************************************

TASK [show version] ****************************************************************************************************************************************
fatal: [mgmtsw1]: FAILED! => {"msg": "Unable to automatically determine host network os. Please manually configure ansible_network_os value for this host"}

PLAY RECAP *************************************************************************************************************************************************
mgmtsw1 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

Here is my playbook. please forgive the lack of spacing here this is indented correctly in the actual playbook

- hosts: cisco
gather_facts: false
connection: local
tasks:
- name: show version
cisco.ios.ios_command:
Commands: show version
 
and inventory file:
 

[cisco:vars]
ansbile_network_os=ios
ansible_connection=network_cli

[cisco]
mgmtsw1 ansible_host=1.1.1.1

Thanks

3 Replies 3

jay_7301
Level 1
Level 1

ignore - problem resolved.

thanks

what was the fix?

Ruben Cocheno
Spotlight
Spotlight

@jay_7301 

Are we good to close this?

Tag me to follow up.
Please mark it as Helpful and/or Solution Accepted if that is the case. Thanks for making Engineering easy again.
Connect with me for more on Linkedin https://www.linkedin.com/in/rubencocheno/