Update README.md

Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
Tuan-Dat Tran
2025-07-27 16:16:35 +02:00
parent dbaebaee80
commit 2b759cc2ab

View File

@@ -2,36 +2,41 @@
**I do not recommend this project being used for ones own infrastructure, as
this project is heavily attuned to my specific host/network setup**
The Ansible Project to provision fresh Debian VMs for my Proxmox instances.
Some values are hard coded such as the public key both in
[./scripts/debian_seed.sh](./scripts/debian_seed.sh) and [./group_vars/all/vars.yml](./group_vars/all/vars.yml).
## Prerequisites
## Configuration
- [secrets.yml](secrets.yml) in the root directory of this repository.
Skeleton file can be found as [./secrets.yml.skeleton](./secrets.yml.skeleton).
- IP Configuration of hosts like in [./host_vars/\*](./host_vars/*)
- Setup [~/.ssh/config](~/.ssh/config) for the respective hosts used.
- Install `passlib` for your operating system. Needed to hash passwords ad-hoc.
The configuration of this project is done via files in the `./vars` directory.
The inventory is composed of `.ini` files in the `./vars` directory. Each `.ini` file represents an inventory and can be used with the `-i` flag when running playbooks.
## Improvable Variables
The variables for the hosts and groups are defined in the `./vars/group_vars` directory. The structure of this directory is as follows:
- `group_vars/k3s/vars.yml`:
- `k3s.server.ips`: Take list of IPs from host_vars `k3s_server*.yml`.
- `k3s_db_connection_string`: Embed this variable in the `k3s.db.`-directory.
Currently causes loop.
```
vars/
├── group_vars/
├── all/
│ │ ├── secrets.yml
│ │ └── vars.yml
│ ├── <group_name>/
│ │ ├── *.yml
├── docker.ini
├── k3s.ini
├── kubernetes.ini
├── proxmox.ini
└── vps.ini
```
The `all` group contains variables that are common to all hosts. Each other directory in `group_vars` corresponds to a group defined in the inventory files and contains variables specific to that group.
## Run Playbook
To run a first playbook and test the setup the following command can be executed.
To run a playbook, you need to specify the inventory file and the playbook file. For example, to run the `k3s-servers.yml` playbook with the `k3s.ini` inventory, you can use the following command:
```sh
ansible-playbook -i production -J k3s-servers.yml
ansible-playbook -i vars/k3s.ini playbooks/k3s-servers.yml
```
This will run the [./k3s-servers.yml](./k3s-servers.yml) playbook and execute
its roles.
## After successful k3s installation
To access our Kubernetes cluster from our host machine to work on it via