make sure
>>>pip3 install ansible
vars:
# template_path: ./templates/
textfsm_show_version_filter: ./cisco_ios_show_version.template
- set_fact:
show_version_result: "{{ show_version.stdout.0 | parse_cli_textfsm(textfsm_show_version_filter) }}"
- debug:
var: show_version_result.0.UPTIME
- lineinfile:
path: ./output/test.txt
line: "Device {{ansible_net_hostname}} has UP for {{show_version_result.0.UPTIME}} \n"
pip3 install ntc_templates
- name: TEST NTC TEMPLATE FILTERS
set_fact:
OUTPUT: "{{ show_ap_summary.stdout.0 | ntc_parse('show ap summary', 'cisco_wlc_ssh', '/Users/conor_wu/Ansible/ntc-templates/templates/') }}"
- name:
debug:
msg: "{{OUTPUT.0.ap_name}} with IP ADDRESS {{OUTPUT.0.ip}}, has {{OUTPUT.0.clients}} Clients"