From 8895e380602bc71714fc9a153e381748bc129a66 Mon Sep 17 00:00:00 2001
From: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>
Date: Wed, 28 Jun 2023 15:28:32 +0200
Subject: [PATCH] Update doc after ansible-core upgrade to 2.14 (#10261)

* docs/ansible: update ansible venv install method and ansible version

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

* docs/ansible: add a disclaimer about using version below python 3.9

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>

---------

Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@proton.ch>
---
 docs/ansible.md | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/docs/ansible.md b/docs/ansible.md
index a41cfd314..9a3110b3a 100644
--- a/docs/ansible.md
+++ b/docs/ansible.md
@@ -10,21 +10,29 @@ It is recommended to deploy the ansible version used by kubespray into a python
 ```ShellSession
 VENVDIR=kubespray-venv
 KUBESPRAYDIR=kubespray
-ANSIBLE_VERSION=2.12
-virtualenv  --python=$(which python3) $VENVDIR
+python3 -m venv $VENVDIR
 source $VENVDIR/bin/activate
 cd $KUBESPRAYDIR
-pip install -U -r requirements-$ANSIBLE_VERSION.txt
+pip install -U -r requirements.txt
 ```
 
+In case you have a similar message when installing the requirements:
+
+```ShellSession
+ERROR: Could not find a version that satisfies the requirement ansible==7.6.0 (from -r requirements.txt (line 1)) (from versions: [...], 6.7.0)
+ERROR: No matching distribution found for ansible==7.6.0 (from -r requirements.txt (line 1))
+```
+
+It means that the version of Python you are running is not compatible with the version of Ansible that Kubespray supports.
+If the latest version supported according to pip is 6.7.0 it means you are running Python 3.8 or lower while you need at least Python 3.9 (see the table below).
+
 ### Ansible Python Compatibility
 
 Based on the table below and the available python version for your ansible host you should choose the appropriate ansible version to use with kubespray.
 
 | Ansible Version | Python Version |
 |-----------------|----------------|
-| 2.11            | 2.7,3.5-3.9    |
-| 2.12            | 3.8-3.10       |
+| 2.14            | 3.9-3.11       |
 
 ## Inventory
 
-- 
GitLab