Ansible playbooks for home infra
In order to run this playbook, the following must be installed:
- python3
- pip3
- ansible
- paramiko
- pyopenssl
- kubernetes
- ansible-lint
https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#prerequisites
PIP installation
$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
$ python get-pip.py --user
Ansible Installation
$ python -m pip install --user ansible==9
Packages Installation
$ sudo apt install -y sshpass
Don't forget to add ~/.local/bin
to your path!
Install roles
$ ansible-galaxy install -r ./roles/requirements.yml
$ ansible-galaxy collection install kubernetes.core
In some of the playbooks, collections are needed. If there exists a folder such as in playbooks/[name]/collections
then run the following command to install pre-requisite collections for this playbook.
ansible-galaxy install -r ./playbooks/[name]/collections/requirements.yml
This is the main playbook for all hosts - it is largely idempotent and targets all home infra.
ansible-playbook -e @./vault.yml main.yml
winrm quickconfig
# Necessary if WSL is installed.
Enable-PSRemoting -SkipNetworkProfileCheck -Force
winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'