From 25e951525f853b6c4a9bbd263202037384e0f414 Mon Sep 17 00:00:00 2001 From: Anthony Perkins Date: Fri, 22 Nov 2019 15:53:09 +0000 Subject: [PATCH] Move console setup to a new task --- roles/netbsd/tasks/console.yml | 13 +++++++++++++ roles/netbsd/tasks/main.yml | 2 ++ roles/netbsd/tasks/xorg.yml | 12 ------------ 3 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 roles/netbsd/tasks/console.yml diff --git a/roles/netbsd/tasks/console.yml b/roles/netbsd/tasks/console.yml new file mode 100644 index 0000000..53024a8 --- /dev/null +++ b/roles/netbsd/tasks/console.yml @@ -0,0 +1,13 @@ +--- +- name: Disable getty on /dev/console + become: true + lineinfile: + path: /etc/ttys + regexp: ^console\s+ + line: 'console "/usr/libexec/getty Pc" vt100 off secure' +- name: Enable getty on /dev/ttyE0 + become: true + lineinfile: + path: /etc/ttys + regexp: ^ttyE0\s+ + line: 'ttyE0 "/usr/libexec/getty Pc" wsvt25 on secure' diff --git a/roles/netbsd/tasks/main.yml b/roles/netbsd/tasks/main.yml index 530e518..f6bcd41 100644 --- a/roles/netbsd/tasks/main.yml +++ b/roles/netbsd/tasks/main.yml @@ -3,4 +3,6 @@ - include: packages-gui.yml when: gui == true - include: sudo.yml +- include: console.yml - include: xorg.yml + when: gui == true diff --git a/roles/netbsd/tasks/xorg.yml b/roles/netbsd/tasks/xorg.yml index 0b8d33a..be731e1 100644 --- a/roles/netbsd/tasks/xorg.yml +++ b/roles/netbsd/tasks/xorg.yml @@ -5,15 +5,3 @@ path: /etc/rc.conf regexp: ^xdm=.* line: xdm=YES -- name: Disable getty on /dev/console - become: true - lineinfile: - path: /etc/ttys - regexp: ^console\s+ - line: 'console "/usr/libexec/getty Pc" vt100 off secure' -- name: Enable getty on /dev/ttyE0 - become: true - lineinfile: - path: /etc/ttys - regexp: ^ttyE0\s+ - line: 'ttyE0 "/usr/libexec/getty Pc" wsvt25 on secure'