Update README.md
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
41
README.md
41
README.md
@@ -2,36 +2,41 @@
|
|||||||
|
|
||||||
**I do not recommend this project being used for ones own infrastructure, as
|
**I do not recommend this project being used for ones own infrastructure, as
|
||||||
this project is heavily attuned to my specific host/network setup**
|
this project is heavily attuned to my specific host/network setup**
|
||||||
|
|
||||||
The Ansible Project to provision fresh Debian VMs for my Proxmox instances.
|
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.
|
The configuration of this project is done via files in the `./vars` directory.
|
||||||
Skeleton file can be found as [./secrets.yml.skeleton](./secrets.yml.skeleton).
|
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.
|
||||||
- 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.
|
|
||||||
|
|
||||||
## 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`.
|
vars/
|
||||||
- `k3s_db_connection_string`: Embed this variable in the `k3s.db.`-directory.
|
├── group_vars/
|
||||||
Currently causes loop.
|
│ ├── 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
|
## 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
|
```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
|
## After successful k3s installation
|
||||||
|
|
||||||
To access our Kubernetes cluster from our host machine to work on it via
|
To access our Kubernetes cluster from our host machine to work on it via
|
||||||
|
|||||||
Reference in New Issue
Block a user