Disable login during deployment
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
6b1db0dd23
commit
cd448a0af3
@ -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
|
||||
|
@ -1,3 +1,6 @@
|
||||
- name: Disable tty logins
|
||||
import_tasks: tty.yml
|
||||
|
||||
- name: Remove snapd
|
||||
import_tasks: snapd.yml
|
||||
|
||||
|
@ -11,5 +11,5 @@
|
||||
update_cache: yes
|
||||
- name: Cleanup
|
||||
ansible.builtin.apt:
|
||||
autoclean: yes
|
||||
autoremove: yes
|
||||
purge: yes
|
||||
|
@ -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
|
||||
|
13
ansible/roles/os/tasks/tty.yml
Normal file
13
ansible/roles/os/tasks/tty.yml
Normal 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
|
Loading…
Reference in New Issue
Block a user