bank: Include Revbank setup
This commit is contained in:
parent
a4b900fb7c
commit
7dde69a9f2
8 changed files with 124 additions and 28 deletions
52
roles/bank/tasks/login.yaml
Normal file
52
roles/bank/tasks/login.yaml
Normal file
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
- name: Add user
|
||||
user:
|
||||
name: bank
|
||||
password: $6$idklol$QrOE/21LDR0vhZBAXwgA7AvnmR6Ju4ZqzAzgeazC08i2yw9kyQjgwu.uuV692iL/cyE7AteDYUxCpcorONXom. # "bank"
|
||||
home: /home/{{ bank_user }}
|
||||
shell: /home/{{ bank_user }}/revbank.git/revbank
|
||||
update_password: always
|
||||
|
||||
- name: Allow password auth for bank user
|
||||
blockinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
insertafter: EOF
|
||||
block: |-
|
||||
Match User bank
|
||||
PasswordAuthentication yes
|
||||
notify: reload sshd
|
||||
|
||||
- name: Clear motd
|
||||
copy:
|
||||
content: ""
|
||||
dest: /etc/motd
|
||||
|
||||
- name: Remove autologin
|
||||
file:
|
||||
path: /etc/systemd/system/getty@tty1.service.d/override.conf
|
||||
state: absent
|
||||
notify: daemon reload
|
||||
when: not bank_local_tty
|
||||
|
||||
- when: bank_local_tty
|
||||
block:
|
||||
- name: Locate agetty
|
||||
command: command -v agetty
|
||||
register: agetty_location_cmd
|
||||
|
||||
- set_fact:
|
||||
agetty_location: "{{ agetty_location_cmd.stdout_lines | join }}"
|
||||
|
||||
- name: Create getty dir
|
||||
file:
|
||||
path: /etc/systemd/system/getty@tty1.service.d
|
||||
state: directory
|
||||
|
||||
- name: Autologin User
|
||||
template:
|
||||
src: tty_autologin.conf
|
||||
dest: /etc/systemd/system/getty@tty1.service.d/override.conf
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
notify: daemon reload
|
Loading…
Add table
Add a link
Reference in a new issue