Hello,
I am writing an ansible role to manage & create a docker swarm cluster. The target servers are debian 12.
Using the reference page : community.docker.docker_swarm module – Manage Swarm cluster — Ansible Community Documentation
I need to set data_path_port to a specific value not the default one.
This is the code :
- name: Initialize swarm
community.docker.docker_swarm:
state: present
data_path_port: "{{ docker_swarm_data_port }}"
register: swarm_status
when: inventory_hostname in groups['swarm-mgmt'][0]
it fails stating :
fatal: [server]: FAILED! => {"changed": false, "msg": "Docker SDK for Python version is 5.0.3 (tstsrv01's Python /usr/bin/python3.11). Minimum version required is 6.0.0 to set data_path_port option. Use `pip install --upgrade docker` to upgrade."}`
On debian 12 we have this version available :
root@server01:~# apt policy python3-docker
python3-docker:
Installé : 5.0.3-1
Candidat : 5.0.3-1
Table de version :
*** 5.0.3-1 500
500 http://httpredir.debian.org/debian bookworm/main amd64 Packages
100 /var/lib/dpkg/status
The thing is by default we cannot play with pip on system lelve, we need to use python venv, but in this case how can this works with ansible ?
Thank you for your help