Hello,
I have been having some great success with TextFSM and Python. I am now
trying to use it in Ansible.
I have installed the ntc-templates onto my server running ansible awx and
when I run this demo script I get this error:
"msg": "parse_cli_textfsm filter requires TextFSM library to be
installed",
"_ansible_no_log": false
I have verified that the templates folder does exist in this location
---
- name: "PLAY 1: DEMO OF TEXTFSM"
hosts: all
connection: network_cli
gather_facts: no
vars:
ansible_network_os: ios
tasks:
- name: "TASK 1: GET COMMAND OUTPUT"
ios_command:
commands:
- show lldp neighbors
register: lldp_output
- name: "TASK 2: REGISTER OUTPUT TO DEVICE_NEIGHBORS VARIABLE"
set_fact:
device_neighbors: "{{ lldp_output.stdout[0] |
parse_cli_textfsm('~/ntc-templates/templates/cisco_ios_show_lldp_neighbors.textfsm')
}}"
- name: "TASK 3: PRINT OUTPUT"
debug:
msg: "{{ device_neighbors }}"
- name: "TASK 4: PRINT NEIGHBORS"
debug:
msg: "{{ item['LOCAL_INTERFACE'] }}: {{ item['NEIGHBOR'] }}"
loop: "{{ device_neighbors }}"
loop_control:
label: "{{ item['LOCAL_INTERFACE'] }}"
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/9085c74f-7e9a-4e62-9fb4-1dfc1e1e2f1en%40googlegroups.com.