Post-Tyranny-Tech-Infrastru.../ansible/hcloud.yml
Pieter 171cbfbb32 WIP: Ansible base configuration - common role (#2)
Progress on Issue #2: Ansible Base Configuration

Completed:
-  Ansible installed via pipx (isolated Python environment)
-  Hetzner Cloud dynamic inventory configured
-  Ansible configuration (ansible.cfg)
-  Common role for base system hardening:
  - SSH hardening (key-only, no root password)
  - UFW firewall configuration
  - Fail2ban for SSH protection
  - Automatic security updates
  - Timezone and system packages
-  Comprehensive Ansible README with setup guide

Architecture Updates:
- Added Decision #15: pipx for isolated Python environments
- Updated ADR changelog with pipx adoption

Still TODO for #2:
- Docker role
- Traefik role
- Setup playbook
- Deploy playbook
- Testing against live server

Files added:
- ansible/README.md - Complete Ansible guide
- ansible/ansible.cfg - Ansible configuration
- ansible/hcloud.yml - Hetzner dynamic inventory
- ansible/roles/common/* - Base hardening role

Partial progress on #2

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-27 14:00:22 +01:00

37 lines
755 B
YAML

# Hetzner Cloud Dynamic Inventory Configuration
# Queries Hetzner Cloud API for server list at runtime
# Requires: HCLOUD_TOKEN environment variable
plugin: hetzner.hcloud.hcloud
# Optional: Filter by label
# label_selector: role=app-server
# Group servers by labels
keyed_groups:
# Group by client label
- key: labels.client
prefix: client
separator: _
# Group by role label
- key: labels.role
prefix: role
separator: _
# Group by location
- key: location
prefix: location
separator: _
# Compose custom variables
compose:
ansible_host: ipv4_address
server_id: id
server_type: server_type
datacenter: datacenter
# Create groups for all servers
groups:
# All Hetzner Cloud servers
hetzner_cloud: True