docs: fix incorrect Ansible paths and standardize inventory references (#13246)

This commit updates documentation across several files to correct broken
file paths and ensure consistency in Ansible command examples

- Standardized inventory naming to `inventory.ini` for sample inventories.
- Fixed `group_vars` paths to reflect the actual directory structure
  (e.g., `group_vars/all/all.yml` instead of `group_vars/all.yml`).
- Corrected the `k8s-cluster.yml` filename in guides.
- Clarified the location for `kubectl_localhost` and `kubeconfig_localhost` settings.
- Replaced non-existent placeholders (like `inventory/single.cfg`) with
  valid repository paths.
- Fixed typos in directory names (e.g., `myclsuter` -> `mycluster`).
This commit is contained in:
Jiří Suchomel
2026-05-21 10:00:47 +02:00
committed by GitHub
parent 7fd29b5529
commit 7214e9899b
7 changed files with 49 additions and 50 deletions
+7 -8
View File
@@ -15,16 +15,15 @@ and [details on the inventory structure expected by Kubespray](/docs/ansible/inv
<your-favorite-editor> inventory/mycluster/inventory.ini
# Review and change parameters under ``inventory/mycluster/group_vars``
<your-favorite-editor> inventory/mycluster/group_vars/all.yml # for every node, including etcd
<your-favorite-editor> inventory/mycluster/group_vars/k8s_cluster.yml # for every node in the cluster (not etcd when it's separate)
<your-favorite-editor> inventory/mycluster/group_vars/kube_control_plane.yml # for the control plane
<your-favorite-editor> inventory/myclsuter/group_vars/kube_node.yml # for worker nodes
<your-favorite-editor> inventory/mycluster/group_vars/all/all.yml # for every node, including etcd
<your-favorite-editor> inventory/mycluster/group_vars/k8s_cluster/k8s-cluster.yml # for every node in the cluster (not etcd when it's separate)
<your-favorite-editor> inventory/mycluster/group_vars/k8s_cluster/kube_control_plane.yml # for the control plane
```
## Installing the cluster
```ShellSession
ansible-playbook -i inventory/mycluster/ cluster.yml -b -v \
ansible-playbook -i inventory/mycluster/inventory.ini cluster.yml -b -v \
--private-key=~/.ssh/private_key
```
@@ -36,7 +35,7 @@ You may want to add worker, control plane or etcd nodes to your existing cluster
- Run the ansible-playbook command, substituting `cluster.yml` for `scale.yml`:
```ShellSession
ansible-playbook -i inventory/mycluster/hosts.yml scale.yml -b -v \
ansible-playbook -i inventory/mycluster/inventory.ini scale.yml -b -v \
--private-key=~/.ssh/private_key
```
@@ -54,7 +53,7 @@ is not working, you can remove the node and install it again.
Use `--extra-vars "node=<nodename>,<nodename2>"` to select the node(s) you want to delete.
```ShellSession
ansible-playbook -i inventory/mycluster/hosts.yml remove-node.yml -b -v \
ansible-playbook -i inventory/mycluster/inventory.ini remove-node.yml -b -v \
--private-key=~/.ssh/private_key \
--extra-vars "node=nodename,nodename2"
```
@@ -87,7 +86,7 @@ the Kubernetes [documentation](https://kubernetes.io/docs/tasks/access-applicati
The main client of Kubernetes is `kubectl`. It is installed on each kube_control_plane
host and can optionally be configured on your ansible host by setting
`kubectl_localhost: true` and `kubeconfig_localhost: true` in the configuration:
`kubectl_localhost: true` and `kubeconfig_localhost: true` in `inventory/mycluster/group_vars/k8s_cluster/k8s-cluster.yml`:
- If `kubectl_localhost` enabled, `kubectl` will download onto `/usr/local/bin/` and setup with bash completion. A helper script `inventory/mycluster/artifacts/kubectl.sh` also created for setup with below `admin.conf`.
- If `kubeconfig_localhost` enabled `admin.conf` will appear in the `inventory/mycluster/artifacts/` directory after deployment.