feat: full untested ansible setup

This commit is contained in:
Twirre Meulenbelt
2026-04-22 12:22:58 +02:00
parent b1d9b2a857
commit 0d967909e7
37 changed files with 1362 additions and 1 deletions

30
roles/base/tasks/main.yml Normal file
View File

@@ -0,0 +1,30 @@
---
- name: Set server hostname
ansible.builtin.hostname:
name: "{{ inventory_hostname_short }}"
- name: Ensure hostname resolves in /etc/hosts
ansible.builtin.lineinfile:
path: /etc/hosts
regexp: '^127\.0\.1\.1\s'
line: "127.0.1.1 {{ inventory_hostname }} {{ inventory_hostname_short }}"
state: present
- name: Set server timezone
ansible.builtin.command:
cmd: "timedatectl set-timezone {{ timezone }}"
changed_when: false
- name: Install base packages
ansible.builtin.apt:
name: "{{ base_packages_common }}"
state: present
update_cache: true
- name: Ensure srv root exists
ansible.builtin.file:
path: "{{ srv_root }}"
state: directory
owner: root
group: root
mode: "0755"