Automation and configuration management for my home infrastructure using Ansible.
This repository contains playbooks, roles, and inventory definitions used to configure and maintain systems in my home lab. It is designed to automate system setup, enforce configuration standards, and simplify repeatable infrastructure tasks.
Typical use cases include:
- Initial system provisioning
- Configuration management
- Package installation
- Service configuration
- Home lab infrastructure automation
This repository follows a typical Ansible project structure:
home-ansible/ ├── inventory/ │ ├── hosts.yml │ └── group_vars/ ├── host_vars/ ├── playbooks/ │ ├── site.yml │ ├── workstation.yml │ ├── server.yml │ └── network.yml ├── roles/ │ ├── common/ │ ├── docker/ │ ├── monitoring/ │ └── security/ ├── files/ ├── templates/ ├── ansible.cfg └── requirements.yml
Defines managed hosts and groups.
Example:
all:
children:
servers:
hosts:
nas01:
proxmox01:
workstations:
hosts:
macbook:
workstation01:Playbooks define orchestration tasks across hosts.
Example run:
ansible-playbook -i inventory/hosts.yml playbooks/site.ymlRoles organize reusable automation logic.
Example roles may include:
roles/common
roles/docker
roles/security
roles/monitoring
Roles allow modular automation for:
- OS configuration
- Package installation
- Container setup
- User management
- Security hardening
Controller machine:
- Python 3.9+
- Ansible 2.14+
- SSH access to target machines
- SSH key authentication recommended
Install Ansible:
pip install ansibleor
brew install ansiblegit clone https://github.com/StrangeDaize/home-ansible.git
cd home-ansibleIf using Galaxy roles:
ansible-galaxy install -r requirements.ymlEnsure passwordless SSH is working:
ssh-copy-id user@hostTest connectivity:
ansible all -i inventory/hosts.yml -m pingRun the main site playbook:
ansible-playbook -i inventory/hosts.yml playbooks/site.ymlRun against a specific host:
ansible-playbook -i inventory/hosts.yml playbooks/site.yml --limit nas01Run with privilege escalation:
ansible-playbook -i inventory/hosts.yml playbooks/site.yml -KSensitive values should be stored using Ansible Vault.
Encrypt a file:
ansible-vault encrypt group_vars/all/vault.ymlRun playbook with vault:
ansible-playbook playbooks/site.yml --ask-vault-passThis repository can automate tasks such as:
- Initial Linux server setup
- Installing Docker and container services
- Deploying monitoring tools
- Configuring SSH and security policies
- Maintaining consistent system configuration
- CI pipeline for playbook linting
- Automated testing with Molecule
- Infrastructure diagrams
- Dynamic inventory integration
- GitOps workflow for home infrastructure
MIT License