Ansible role for common server configuration
- Jinja 100%
| defaults | ||
| handlers | ||
| meta | ||
| roles | ||
| tasks | ||
| templates | ||
| vars | ||
| .ansible-lint | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| .markdownlint-cli2.jsonc | ||
| .yamllint | ||
| AGENTS.md | ||
| playbook.yaml | ||
| readme.md | ||
| renovate.json | ||
Ansible Role: Common
Manage core Operating System components and system defaults.
Variables
APT Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
apt_automatic_reboot_time |
No | 04:00 |
Automated reboot time |
apt_automatic_reboot |
No | true |
Enable automated reboots |
apt_enable_multiverse |
No | false |
Enable multiverse repository |
apt_enable_universe |
No | true |
Enable universe repository |
apt_repository |
No | https://archive.ubuntu.com/ubuntu |
APT repository URL (Ubuntu 22) |
apt_repository_main |
No | https://archive.ubuntu.com/ubuntu |
Main APT repository (Ubuntu 24+) |
apt_repository_security |
No | https://archive.ubuntu.com/ubuntu |
Security APT repository (Ubuntu 24+) |
DNS Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
dns_servers |
No | ["192.168.10.1"] |
List of DNS nameservers to use |
dns_search |
No | ["example.internal"] |
List of search domains to use |
dns_options |
No | [] |
List of resolver options |
NTP Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
ntp_server |
No | pool.ntp.org |
NTP server for time synchronization |
timezone |
No | Europe/Amsterdam |
System timezone |
Tags
Available tags for selective execution:
apt- APT package managementapt-cleanup- Clean APT cacheapt-update- Update APT packagesdns- Manage DNS configurationcron- Configure cronenvironment-file- Manage environment fileshostname- Set hostnamehostfile- Manage /etc/hostsfirewall- Configure firewalljournald- Configure journaldlocale- Set system localelldp- Configure LLDPlxd- Configure LXDmotd- Set message of the dayntp- Configure NTPtelemetry- Configure telemetrysnap- Manage snap packagessshd- Configure SSH daemonswap- Configure swapsysctl- Manage sysctl settingssystemctl- Manage systemd servicessyslog- Configure syslogtimezone- Set timezoneusermanagement- Manage users
Example
apt_automatic_reboot: true
apt_automatic_reboot_time: "03:00"
ntp_server: "time.cloudflare.com"
timezone: "UTC"