Disable login during deployment
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2021-06-11 14:44:43 +02:00
parent 6b1db0dd23
commit cd448a0af3
5 changed files with 38 additions and 1 deletions

View File

@ -2,6 +2,19 @@
ansible.builtin.cron:
name: firstboot
state: absent
- name: Restore extra tty
ansible.builtin.lineinfile:
path: /etc/systemd/logind.conf
regexp: "{{ item.regexp }}"
line: "{{ item.line }}"
loop:
- { regexp: '^NAutoVTs=', line: '#NAutoVTs=6'}
- { regexp: '^ReserveVT=', line: '#ReserveVT=6'}
- name: Unmask getty@tty1 service
ansible.builtin.systemd:
name: getty@tty1
enabled: yes
masked: no
- name: Reboot host
ansible.builtin.shell:
cmd: /usr/sbin/reboot now

View File

@ -1,3 +1,6 @@
- name: Disable tty logins
import_tasks: tty.yml
- name: Remove snapd
import_tasks: snapd.yml

View File

@ -11,5 +11,5 @@
update_cache: yes
- name: Cleanup
ansible.builtin.apt:
autoclean: yes
autoremove: yes
purge: yes

View File

@ -3,6 +3,14 @@
name: snapd
state: absent
purge: yes
- name: Delete leftover files
ansible.builtin.file:
path: /root/snapd
state: absent
- name: Hold snapd package
ansible.builtin.dpkg_selections:
name: snapd
selection: hold
- name: Reload systemd unit configurations
ansible.builtin.systemd:
daemon_reload: yes

View File

@ -0,0 +1,13 @@
- 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