Simple question, what’s the best way to capture stdout from a task that is 
performed?  For example I want to run a command to gather some telemetry from a 
switch but is using the debug the best way to get the stdout data?  I feel like 
there is a different way to do this without using debug.


---
- name: show mac address-table
  register: output
  nxos_command:
    commands:
      - show mac address-table | json
    provider: "{{ cli }}"
- name: output debug for mac address-table
  debug: var=output


- name: copy output to file
  copy:
    content: "{{ output.stdout_lines }}\n"
    dest: /var/tmp/macaddress.txt


Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10 
[14393 - 16.0.7167.4026]

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CY1PR0301MB12609B3A9DA5F3E17B7B4C39DD360%40CY1PR0301MB1260.namprd03.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to