Automate everything.
The main principle in v3: basic system setup, and everything else in Docker containers.
Main variable where data places: caddy_dir.
Requirements: Linux or WSL host, full version of ansible (not just ansible-core).
-
Fill
inventories/proddirectory with your hosts, andgroup_vars. -
Select playbook you needed. If your VPS is clean, you usually needed
systemplaybook first. -
Fill variables required by playbook.
-
Run playbook. Example:
ansible-playbook -i inventories/prod playbooks/system/setup.yml --limit myhost
See playbooks directory, and each playbook README.md.
See more in Ansible docs.
cd ~
sudo apt install -y python3 python3-pip python3-venv sshpass # sshpass for password login to the server
mkdir ansible && cd ansible
python3 -m venv .venv
source .venv/bin/activate # use venv to interact with Ansible
pip install ansible passlib # passlib for creating a user with a password on the serverIf you haven't logged into the server yet, do so because otherwise it will complain about known_hosts. Run: ssh root@SERVER_IP
Due to sudo changes in Ubuntu 26.04, you may need to set
ansible_become_exe: "sudo.ws" in your variables.
