feat(playbook): add the install playbook

!37
This commit is contained in:
2024-03-13 22:32:26 +09:30
parent 32c3f7ab71
commit 447bb621cd
4 changed files with 95 additions and 9 deletions

View File

@ -32,11 +32,31 @@ To install this collection use `ansible-galaxy collection install nofusscomputin
Most of the features of this collection are from the included role `nfc_kubernetes`, please [view its page for feature details](roles/nfc_kubernetes/index.md).
## Default Variables
## Using this collection
This collection has been designed to be a complete and self-contained management tool for a K3s kubernetes cluster.
## K3s Kubernetes Installation
By default the install playbook will install to localhost.
``` bash
ansible-playbook nofusscomputing.kubernetes.install
```
The install playbook has a dynamic `hosts` key. This has been done to specifically support running the playbook from AWX and being able to populate the field from the survey feature. Order of precedence for the host variable is as follows:
- `nfc_pb_host` set to any valid value that a playbook `hosts` key can accept
- `nfc_pb_kubernetes_cluster_name` with the name of the cluster. This variable is appended to string `kubernetes_cluster_` to serve as a group name for the cluster to be installed. i.e. for a cluster called `prime`, the group name would be set to `kubernetes_cluster_prime`
- `--limit` specified at runtime
- `localhost`
For the available variables please view the [nfc_kubernetes role docs](roles/nfc_kubernetes/index.md#default-variables)
``` yaml title="defaults/main.yaml" linenums="1"
--8<-- "defaults/main.yml"
```

View File

@ -107,6 +107,8 @@ If the playbook is setup as per [our recommendation](ansible.md) step 2 onwards
## Default Variables
On viewing these variables you will notice there are single dictionary keys prefixed `nfc_role_kubernetes_` and a dictionary of dictionaries `kubernetes_config`. variables prefixed with `nfc_role_kubernetes_` are for single node installs with the `kubernetes_config` dictionary containing all of the information for an entire cluster. The `kubernetes_config` dictionary variables take precedence. Even if you are installing a cluster on multiple nodes, you are still advised to review the variables prefixed with `nfc_role_kubernetes_` as they may still be needed. i.e. setting a node type use keys `nfc_role_kubernetes_prime`, `nfc_role_kubernetes_master` and `nfc_role_kubernetes_worker`.
``` yaml title="defaults/main.yaml" linenums="1"