- 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' loop_control: label: "{{ item.line }}" - name: Mask getty@tty1 service ansible.builtin.systemd: name: getty@tty1 enabled: no masked: yes