Is there a way to output only the last 5 lines of an Ansible shell output, for example?
Maybe using loops?
Example:
- name: Running Migrations
ansible.builtin.shell: /some-script-produces-lot-of-output.sh
register: ps
- debug: var=ps.stdout_lines
Debug should only output the last 5 lines.