home lab init
This commit is contained in:
commit
7278922625
65 changed files with 27336 additions and 0 deletions
2
ansible/books/tasks/keyboard.yml
Normal file
2
ansible/books/tasks/keyboard.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
- name: Set keyboard layout
|
||||
ansible.builtin.command: localectl set-keymap dk
|
||||
10
ansible/books/tasks/locale.yml
Normal file
10
ansible/books/tasks/locale.yml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
- name: Ensure locale is set
|
||||
ansible.builtin.locale_gen:
|
||||
name: "en_DK.UTF-8"
|
||||
state: present
|
||||
|
||||
- name: Set system locale
|
||||
ansible.builtin.command: localectl set-locale LANG=en_DK.UTF-8
|
||||
|
||||
- name: Set timezone
|
||||
ansible.builtin.command: timedatectl set-timezone Europe/Copenhagen
|
||||
8
ansible/books/tasks/packages.yml
Normal file
8
ansible/books/tasks/packages.yml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
- name: Install required packages
|
||||
ansible.builtin.apt:
|
||||
name:
|
||||
- python3
|
||||
- curl
|
||||
- git
|
||||
state: present
|
||||
update_cache: yes
|
||||
14
ansible/books/tasks/ssh.yml
Normal file
14
ansible/books/tasks/ssh.yml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
- name: Ensure user plasmagoat exists
|
||||
ansible.builtin.user:
|
||||
name: plasmagoat
|
||||
groups: wheel,docker,networkmanager
|
||||
shell: /usr/bin/zsh
|
||||
state: present
|
||||
|
||||
- name: Set authorized SSH keys for plasmagoat
|
||||
ansible.posix.authorized_key:
|
||||
user: plasmagoat
|
||||
key: "{{ item }}"
|
||||
loop:
|
||||
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCeg/n/..."
|
||||
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICUP7m8jZJ..."
|
||||
16
ansible/books/tasks/users.yml
Normal file
16
ansible/books/tasks/users.yml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
- name: Disable PasswordAuthentication in sshd_config
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: "^PasswordAuthentication"
|
||||
line: "PasswordAuthentication no"
|
||||
|
||||
- name: Disable KbdInteractiveAuthentication in sshd_config
|
||||
ansible.builtin.lineinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: "^KbdInteractiveAuthentication"
|
||||
line: "KbdInteractiveAuthentication no"
|
||||
|
||||
- name: Restart sshd to apply changes
|
||||
ansible.builtin.service:
|
||||
name: ssh
|
||||
state: restarted
|
||||
Loading…
Add table
Add a link
Reference in a new issue