'dict object' has no attribute 'stdout'

- name: Save output to file
  ansible.builtin.copy:
    content: |-
      {{ '\n'.join(output.stdout_lines[0:1]) }}
    dest: "show-output/{{ inventory_hostname }}.ios"
  when output.stdout_lines is defined

D’oh! Test one thing and post something else. Argh!
How about this:

  • name: Save output to file
    ansible.builtin.copy:
    content: |
    {{ output.stdout_lines[0:1] | join(‘\n’) }}
    dest: “show-output/{{ inventory_hostname }}.ios”
    when output.stdout_lines is defined