initial bootstrapping workflow

This commit is contained in:
Jef Roosens 2023-12-24 17:58:49 +01:00
parent f2f99a932d
commit 5ad30d3343
Signed by: Jef Roosens
GPG key ID: B75D4F293C7052DB
11 changed files with 129 additions and 36 deletions

View file

@ -1,25 +1,37 @@
- name: Install packages
---
- name: Install sudo.
apt:
name:
# Needed for handling GPG keys for repositories
- debian-keyring
- debian-archive-keyring
- apt-transport-https
# Easy to edit files
- vim
- tmux
name: sudo
state: present
- name: Install Vim config
get_url:
url: 'https://r8r.be/vim'
dest: '{{ item.dest }}'
owner: "{{ item.user }}"
group: "{{ item.user }}"
mode: '644'
with_items:
- user: debian
dest: "/home/debian/.vimrc"
- user: root
dest: "/root/.vimrc"
- name: Create debian user.
user:
name: debian
groups: sudo
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