Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
270 views
in Technique[技术] by (71.8m points)

python 3.x - pyATS package is not installed ansible

I have created a simple playbook to parse the output in json format by using a pyats genie but everytime I run the playbook, I get the following, however I made sure I do have pyats install, can someone take look if I am missing something or doing something wrong.

TASK [show version] ************************************************************************************************
Monday 25 January 2021  18:02:17 +0000 (0:00:00.074)       0:00:00.074 ********
ok: [switch01]

TASK [Set Fact Genie Filter] ***************************************************************************************
Monday 25 January 2021  18:02:25 +0000 (0:00:08.056)       0:00:08.131 ********
fatal: [switch01]: FAILED! => {"msg": "parse_genie: pyATS package is not installed. To install, run 'pip install pyats'."}

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

here is my playbook

---
- name: Genie Parse for IOS 
  hosts: IOS 
  gather_facts: no
  connection: network_cli
  roles:
    - parse_genie
    
  tasks:

    - name: show version
      ios_command:
        commands:
          - show version
      register: version
 
    - name: Set Fact Genie Filter
      set_fact:
        pyats_version: "{{ version['stdout'][0] | parse_genie(command='show version', os='ios') }}"

    - name: Debug Genie Filter
      debug:
        var: pyats_version

I have tried this with virtual environment too with python3.6 but same results, I was following this link https://the-packet-thrower.com/2020/01/04/ticket-please-a-servicenow-automation-post/

question from:https://stackoverflow.com/questions/65890205/pyats-package-is-not-installed-ansible

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...