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:
|
ansible.builtin.cron:
|
||||||
name: firstboot
|
name: firstboot
|
||||||
state: absent
|
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
|
- name: Reboot host
|
||||||
ansible.builtin.shell:
|
ansible.builtin.shell:
|
||||||
cmd: /usr/sbin/reboot now
|
cmd: /usr/sbin/reboot now
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
- name: Disable tty logins
|
||||||
|
import_tasks: tty.yml
|
||||||
|
|
||||||
- name: Remove snapd
|
- name: Remove snapd
|
||||||
import_tasks: snapd.yml
|
import_tasks: snapd.yml
|
||||||
|
|
||||||
|
@ -11,5 +11,5 @@
|
|||||||
update_cache: yes
|
update_cache: yes
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
ansible.builtin.apt:
|
ansible.builtin.apt:
|
||||||
autoclean: yes
|
|
||||||
autoremove: yes
|
autoremove: yes
|
||||||
|
purge: yes
|
||||||
|
@ -3,6 +3,14 @@
|
|||||||
name: snapd
|
name: snapd
|
||||||
state: absent
|
state: absent
|
||||||
purge: yes
|
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
|
- name: Reload systemd unit configurations
|
||||||
ansible.builtin.systemd:
|
ansible.builtin.systemd:
|
||||||
daemon_reload: yes
|
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