- hosts: all tasks: - name: Read init file ansible.builtin.slurp: path: /etc/default/console-setup register: __slurped - name: Validate desired string is present assert: that: >- 'ACTIVE_CONSOLES="/dev/tty1"' in ( __slurped["content"] | b64decode )