- name: Disable extra tty ansible.builtin.lineinfile: path: /etc/systemd/logind.conf regexp: "{{ item.regexp }}" line: "{{ item.line }}" loop: - { regexp: '^#NAutoVTs=', line: 'NAutoVTs=1'} - { regexp: '^#ReserveVT=', line: 'ReserveVT=11'} - name: Mask getty@tty1 service ansible.builtin.systemd: name: getty@tty1 enabled: no masked: yes