failing to run playbook

325 views
Skip to first unread message

nitesh shet

unread,
Jun 19, 2021, 12:07:07 PM6/19/21
to ansible...@googlegroups.com
Hi experts,
 I am running below playbook :-
---
- name: "run show version"
  hosts: servers
  gather_facts: False
  tasks:
   - name: "cli command"
     ansible.netcommon.cli_command:
        command: "show chassis-1"

on my centos server with inventory entries is like:-
[servers]
172.16.12.215

[servers:vars]
ansible_user=temproot
ansible_ssh_pass=******
ansible_python_interpreter=/usr/bin/python
ansible_port=22
ansible_network_os="ios"
ansible_connection=ansible.netcommon.network_cli


but when i ran playbook i am getting below error:-
fatal: [172.16.12.215]: FAILED! => {"changed": false, "msg": "paramiko is not installed: cannot import name _get_backend"}

but , pip list | grep paramiko
paramiko        2.7.2
exist.
please let me know how to tackle this.



Dick Visser

unread,
Jun 20, 2021, 12:44:06 AM6/20/21
to ansible...@googlegroups.com
You are mixing up several things. 

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAPgfy9UNNJ%3DsYZz3OC%2BX1Z0YP2FOv9L0hSL8ZhK%3DyAT%3DLx%2BiNA%40mail.gmail.com.
--
Sent from a mobile device - please excuse the brevity, spelling and punctuation.

nitesh shet

unread,
Jun 20, 2021, 6:00:05 AM6/20/21
to ansible...@googlegroups.com
Hi,
 cat ios.yml
---

- name: Backup current switch config (ios)
  cisco.ios.ios_config:
    backup: yes
  register: backup_ios_location
  when: ansible_network_os == 'cisco.ios.ios'
as per the doc i try to use it but when i ran i am getting syntax error like below:-

 ansible-playbook ios.yml
ERROR! 'cisco.ios.ios_config' is not a valid attribute for a Play

The error appears to be in '/etc/ansible/ios.yml': line 3, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: Backup current switch config (ios)
  ^ here

even i did change the inventory file and added vars in separate yml file

Dick Visser

unread,
Jun 20, 2021, 10:02:27 AM6/20/21
to ansible...@googlegroups.com
Your playbook is also faulty. 
Check the examples on 

Probably do some more reading there 

Reply all
Reply to author
Forward
0 new messages