Ansible Playbooks
This directory contains automation playbooks for managing the homelab infrastructure.
Provisioning & Setup
create_lxc.yml
Creates and bootstraps a new LXC container on Proxmox.
- Input: Prompts for Container Name and IP Address.
- Actions:
- Connects to Proxmox API to create a new unprivileged LXC container (Ubuntu 24.04).
- Starts the container and waits for connectivity.
- Temporarily adds the host to the inventory.
- Automatically triggers
lxc_setup_ubuntu.ymlto secure the new container.
lxc_setup_ubuntu.yml
Secures a fresh Ubuntu installation.
- Target: Hosts in the
[new]group (or fresh installs). - Actions:
- Creates the administrative user (
mbuz). - Sets up SSH public key authentication.
- Disables root login and password authentication for SSH.
- Configures passwordless
sudofor the admin user. - Inventory Update: Moves the host from the
[new]group to the[lxc]group inhosts.ini.
- Creates the administrative user (
lxc_setup_ubuntu_git.yml
Provisions application dependencies on managed hosts.
- Target: Existing managed hosts (e.g.,
[lxc]). - Actions:
- Installs
gitand core utilities. - Clones the central Docker configuration repository from the local Gitea server.
- Prepares the
/opt/dockerdirectory structure.
- Installs
Maintenance & Upgrades
apt_upgrade.yml
Performs system-wide updates.
- Target: All Ubuntu hosts.
- Actions:
- Updates
aptcache. - Performs
dist-upgrade. - Autoremoves unused packages.
- Checks for and notifies if a reboot is required.
- Updates
zabbix_agent_upgrade.yml
Updates Zabbix Agent.
- Target:
zagentsgroup. - Actions:
- Ensures
zabbix-agent2is installed and updated to the latest available version.
- Ensures
zabbix_proxy_install.yml
Installs Zabbix Proxy and Agent.
- Target: Specific Zabbix Proxy host.
- Actions:
- Downloads and installs the Zabbix release package.
- Installs
zabbix-proxy-sqlite3andzabbix-agent2. - Configures PSK encryption and connection settings using
secrets.yml.