Is there a way to output only the last five 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
The debug
task should only output the last five lines.