- hosts: all become: yes gather_facts: false tasks: - name: Read specified log file ansible.builtin.slurp: src: "{{ log_name }}" register: log_contents