2023-12-24 17:58:49 +01:00
|
|
|
---
|
|
|
|
- name: Install sudo.
|
2022-12-03 13:40:32 +01:00
|
|
|
apt:
|
2023-12-24 17:58:49 +01:00
|
|
|
name: sudo
|
2022-12-03 13:40:32 +01:00
|
|
|
state: present
|
|
|
|
|
2023-12-24 20:52:13 +01:00
|
|
|
- name: Create data group.
|
|
|
|
group:
|
|
|
|
name: data
|
|
|
|
gid: 1002
|
|
|
|
|
2023-12-24 17:58:49 +01:00
|
|
|
- name: Create debian user.
|
|
|
|
user:
|
|
|
|
name: debian
|
2023-12-24 20:52:13 +01:00
|
|
|
groups:
|
|
|
|
- sudo
|
|
|
|
- data
|
2023-12-24 17:58:49 +01:00
|
|
|
append: true
|
|
|
|
create_home: yes
|
|
|
|
shell: /bin/bash
|
|
|
|
password: "{{ vault_debian_pass | password_hash('sha512') }}"
|
|
|
|
update_password: on_create
|
|
|
|
|
|
|
|
- name: Create SSH directory.
|
|
|
|
file:
|
|
|
|
path: /home/debian/.ssh/
|
|
|
|
state: directory
|
|
|
|
owner: debian
|
|
|
|
group: debian
|
|
|
|
mode: '700'
|
|
|
|
|
|
|
|
- name: Add authorized SSH keys.
|
|
|
|
copy:
|
|
|
|
src: authorized_keys
|
|
|
|
dest: /home/debian/.ssh/authorized_keys
|
|
|
|
owner: debian
|
|
|
|
group: debian
|
|
|
|
mode: '600'
|
|
|
|
|
|
|
|
- name: Install networking config file.
|
|
|
|
template:
|
|
|
|
src: interfaces.j2
|
|
|
|
dest: /etc/network/interfaces.d/eth0
|
|
|
|
notify: restart networking
|