22 lines
548 B
YAML
22 lines
548 B
YAML
---
|
|
# Collect MAC Address Table
|
|
# =========================
|
|
# 2023-10-25 stefan init
|
|
|
|
- name: "Collect MAC Address"
|
|
block:
|
|
|
|
- name: "Get facts"
|
|
cisco.ios.ios_facts:
|
|
gather_subset: all
|
|
|
|
- name: "Register output of show command"
|
|
cisco.ios.ios_command:
|
|
commands: 'show mac address-table dynamic'
|
|
register: mac_addr
|
|
|
|
- name: "Save output to file"
|
|
ansible.builtin.copy:
|
|
content="{{ mac_addr.stdout | replace('\\n', '\n') }}"
|
|
dest=/home/stefan/mac_addr/{{ inventory_hostname }}.txt
|