Hi. I have a very basic cisco IOS playbook i'm working on and when I log 
the output to a file I cannot read the format. I read a few threads that 
mention enabling a callback option in the ansible.cfg but that does not 
seem to work. Does anyone know how I can accomplish logging to a readable 
text?

---

- name: IOS General Checks
  hosts: switches
  gather_facts: false
  connection: network_cli

  tasks:
    - name: Standard IOS Checks
      ios_command:
        commands:
          - show int status
          - show int description
      register: output1

    - name: print result
      debug:
        var: output1.stdout_lines

    - name: copy output to file
      copy: content="{{ output1.stdout_lines }}" 
dest=/home/sideswipe/ansible/cisco/logs/{{ inventory_hostname }}.txt

...

# config file for ansible -- https://ansible.com/
# ===============================================

# nearly all parameters can be overridden in ansible-playbook
# or with command line flags. ansible will read ANSIBLE_CONFIG,
# ansible.cfg in the current working directory, .ansible.cfg in
# the home directory or /etc/ansible/ansible.cfg, whichever it
# finds first

[defaults]
display_failed_stderr = no
display_ok_hosts = yes
display_skipped_hosts = yes
show_custom_stats = no
show_per_host_start = no

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/098fbdd3-21e1-4a4c-afa2-16b1649ce4f7%40googlegroups.com.

Reply via email to