Hi Team

I want get output of  *"show mac add int {{ item.key }}"  *as report  for 
each interface, Can anyone guide me how to export the command output only 
matched condition as text file?


*Playbook:*

* roles:*
*    - ansible-network.network-engine*

*  tasks:*
*    - name: Collect switchport interface information*
*      ios_command:*
*       commands:*
*          - show interface status*
*      register: show_interface_status*


*    - name: Parser the interface facts*
*      command_parser:*
*       file: "parser/ios/show_interface_status.yaml"*
*       content: "{{ show_interface_status.stdout.0 }}"*


*    - name: print the vlan 30 interface*
*      ios_command:*
*        commands:*
*          - "show running interface {{ item.key }}"*
*      when: item.value.data.vlan == '100'*
*      with_dict: "{{ interfaces_status_facts }}"*
*      register: vlan30_output*

  
*    - name: print the vlan 30 interface*
*      ios_command:*
*        commands:*
*          - "show mac add int {{ item.key }}"*
*      when: item.value.data.vlan == '1'*
*      with_dict: "{{ interfaces_status_facts }}"*
*      register: vlan30_output*

-- 
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/e48778c0-47f3-4c9e-bc98-d5ad765503a7%40googlegroups.com.

Reply via email to